Zookeeper Cluster Deployment

    • Download Zookeeper

    Using the Zookeeper 3.4.11 as example. Please make sure the java open jdk7 runtime environment is installed on the server.

    • Modify the configuration file
    1. $ cp conf/zoo_sample.cfg conf/zoo.cfg
    2. $ vim conf/zoo.cfg
    • The configuration file is modified as below
    1. tickTime=2000
    2. initLimit=10
    3. syncLimit=5
    4. dataLogDir=/opt/app/zookeeper/logs
    5. clientPort=2181
    6. server.2=192.168.2.81:2888:3888
    7. server.3=192.168.2.82:2888:3888
    • Create a data folder

    Do the same installation to the other servers which need install zookeeper.

    • Create a Zookeeper node identification file myid

    Create myid number, execution on each server, pay attention to each servermyid to correspond to the correct number.

    1. 192.168.2.80
    1. 192.168.2.81
    2. $ echo "2" > /opt/app/zookeeper/zkdata/myid
    • Start Zookeeper
    1. $ /opt/app/zookeeper/bin/zkServer.sh start
    1. 192.168.2.81
    2. $ /opt/app/zookeeper/bin/zkServer.sh start
    • Zookeeper status check
    1. $ /opt/app/zookeeper/bin/zkServer.sh status

    If the Zookeeper start failed, please check the below reasons:

    2、The integer in the myid file is not formatted correctly or does not correspond to the server integer inzoo.cfg.

    3、The firewall does not open the Zookeeper service port, such as 2888 and3888.