Pre-requisites
- OpenJDK8
- Zookeeper
Install OpenJDK
|
...
$ vim /home/zookeeper/zookeeper-3.4.13/conf/zoo.cfg |
|
Now, do the below changes in log4.properties
file as follows.
$ vim /home/zookeeper/zookeeper-3.4.13/conf/log4j.properties |
zookeeper.log.dir=/var/log/zookeeper zookeeper.tracelog.dir=/var/log/zookeeper log4j.rootLogger=INFO, CONSOLE, ROLLINGFILE |
...
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.
$ /home/zookeeper/zookeeper-3.4.13/bin/zkServer.sh status |
Zookeeper Service Status Check.
$ echo stat | nc node1 2181 |
Lists brief details for the server and connected clients.
$ echo mntr | nc node1 2181 |
Zookeeper list of variables for cluster health monitoring.
$ echo srvr | nc localhost 2181 |
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:
$ /home/zookeeper/zookeeper-3.4.13/bin/zkCli.sh -server `hostname -f`:2181 |
Connect to Zookeeper data node and lists the contents.