Installing Druid
This section provides a step-by-step guide to installing Druid.
Pre-requisites
Before installing Druid, make sure the following things are in place:
- Create directories and place the respective files provided as a release
artifact, in the specified locations.
- create /home/druid/allmetrics directory, and place all_metrics.sh and allmetrics_airflow.json files inside the folder.
- create /home/druid/cdpdashboard/cdpleadconv directory, and place cdp_leadconv.sh and cdp_leadconv.json files inside the folder.
- create /home/druid/cdpdashboard/cdpuniqueusers directory, and place cdp_uniqueusers.sh and cdp_uniqueusers.json files inside the folder.
- create /home/druid/cdpdashboard/events directory, and place events_druid_with_python.sh and events_v1.json files inside the folder.
- create /home/druid/daily directory, and place uploadmysqlmappingfiles.sh files inside the folder.
- Install mc client. Follow the steps below to install mc client.
- Download the mc client, and update the execute permissions using below
command.
curl -fsSLhttps://dl.min.io/client/mc/release/linux-amd64/mc > /usr/bin/mc && chmod +x /usr/bin/mc - Navigate vi /etc/profile, and update the mc path in the system profile
file using the below
information.
export PATH="/usr/bin/mc:$PATH" - Verify the version of the mc client using below
command.
mc --version
- Download the mc client, and update the execute permissions using below
command.
Setting up MySQL
To set up MySQL, follow the steps below:
- Install the MySQL
server.
yum install mysql-server - Start the MySQL
server.
systemctl start mysqld - On successful starting up of the server, check for the
status.
systemctl status mysqld mysql -u root - Create a user for the MySQL
server.
CREATE USER 'druid'@'localhost' IDENTIFIED BY 'Oc3f4EagD5cUnZnUy5uMQ=='; CREATE DATABASE druid DEFAULT CHARACTER SET utf8mb4; - Grant comprehensive privileges on the druid database to the
user.
GRANT CREATE, ALTER, DROP, INSERT, UPDATE, INDEX, DELETE, SELECT, REFERENCES ON druid.* TO 'druid'@'localhost' WITH GRANT OPTION;FLUSH PRIVILEGES;
Installing Druid and MySQL connector
To install Druid binary and MySQL connector, follow the steps below:
- Download the latest package of Apache Druid
binary.
wget https://archive.apache.org/dist/druid/25.0.0/apache-druid-25.0.0-bin.tar.gz - Extract the tar package, and move the directory to the local
folder.
tar -xzf apache-druid-28.0.1-bin.tar.gz mv apache-druid-25.0.0 /sdd/ - Download the MySQL Connector/J library (version 5.1.49) to the current working
directory.
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar - Copy the jar file to the local directory as shown
below.
cp mysql-connector-java-5.1.49.jar /sdd/apache-druid-25.0.0/extensions/mysql-metadata-storage/
Updating Druid Configuration
To update the druid configuration, follow the steps below:
- Open common.runtime.properties files in text editor, and update
mysql-metadata-storage and druid-s3-extensions in druid.extensions.loadList
along with other extensions
section.
vi /sdd/apache-druid-25.0.0/conf/druid/single-server/small/_common/common.runtime.properties druid.extensions.loadList=["druid-hdfs-storage", "druid-kafka-indexing-service", "druid-datasketches", "druid-multi-stage-query","mysql-metadata-storage", "druid-s3-extensions"] - Comment the Derby configurations, and update the following properties in
common.runtime.properties.
druid.metadata.storage.type=mysql druid.metadata.storage.connector.connectURI=jdbc:mysql://<host>/druid?allowPublicKeyRetrieval=true&useSSL=false druid.metadata.storage.connector.user=druid druid.metadata.storage.connector.password=<password> - Update the following to store segments in
S3.
druid.storage.type=s3 druid.storage.bucket=druid-bucket druid.storage.baseKey=druid/segments - Add the druid.storage.disableAcl=true at the end of the
file.
nohup ./start-single-server-small & ps -eaf | grep supervise