Build Apache Drill
Pre-requisites
OpenJDK8
Zookeeper
Install OpenJDK
|
Make sure you have the right OpenJDK version
|
It should display 1.8.0_111
Set JAVA_HOME
|
Building Apache Zookeeper
Download and unzip the Zookeeper package from Official Apache archive in all machines that will be used for zookeeper quorum as shown below:
$ tar -xzvf zookeeper-3.4.12.tar.gz |
Edit the /etc/hosts file across all the nodes and add the ipaddress and hostname (nodenames).
|
Create zookeeper user
|
Configure zookeeper
Now, Create the directory zookeeper under /var/lib folder which will serve as Zookeeper data directory and create another zookeeper directory under /var/log where all the Zookeeper logs will be captured. Both of the directory ownership need to be changed as zookeeper.
$ sudo mkdir /var/lib/zookeeper $ cd /var/lib $ sudo chown zookeeper:zookeeper zookeeper/ $ sudo mkdir /var/log/zookeeper $ cd /var/log $ sudo chown zookeeper:zookeeper zookeeper/ |
Edit the bashrc for the zookeeper user via setting up the following Zookeeper environment variables.
$ export ZOO_LOG_DIR=/var/log/zookeeper |
Source the .bashrc in current login session:
|
Create the server id for the ensemble. Each zookeeper server should have a unique number in the myid file within the ensemble and should have a value between 1 and 255.
In Node1
|
In Node2
|
In Node3
|
Now, go to the conf folder under the Zookeeper home directory (location of the Zookeeper directory after Archive has been unzipped/extracted).
|
By default, a sample conf file with name zoo_sample.cfg will be present in conf directory. Make a copy of it with name zoo.cfg as shown below, and edit new zoo.cfg as described across all the nodes.
|
Edit zoo.cfg and the below
|
|
Now, do the below changes in log4.properties file as follows.
|
|
After the configuration has been done in zoo.cfg file in all three nodes, start zookeeper in all the nodes one by one, using following command:
|
Zookeeper Service Start on all the Nodes.
The log file will be created in /var/log/zookeeper of zookeeper named zookeeper.log, tail the file to see logs for any errors.
|
Verify the Zookeeper Cluster and Ensemble
In Zookeeper ensemble out of three servers, one will be in leader mode and other two will be in follower mode. You can check the status by running the following commands.
|
Zookeeper Service Status Check.
|
Lists brief details for the server and connected clients.
|
Zookeeper list of variables for cluster health monitoring.
|
Lists full details for the Zookeeper server.
If you need to check and see the znode, you can connect by using the below command on any of the zookeeper node:
|
Connect to Zookeeper data node and lists the contents.