Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Pre-requisites

  • OpenJDK8
  • Zookeeper

Install OpenJDK

$ sudo apt-get install openjdk-8-jdk 

...

$ vim /home/zookeeper/zookeeper-3.4.13/conf/zoo.cfg


dataDir=/var/lib/zookeeper
server.1=node1:2888:3888
server.2=node2:2888:3888
server.3=node3:2888:3888


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

...

Zookeeper Service Start on all the Nodes.

Zookeeper Service Start on all three Nodes.Image Modified


The log file will be created in /var/log/zookeeper of zookeeper named zookeeper.log, tail the file to see logs for any errors.

$ tail -f /var/log/zookeeper/zookeeper.log


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.

$ /home/zookeeper/zookeeper-3.4.13/bin/zkServer.sh status