ZK Configuration Notes

Source: Internet
Author: User

[Email protected]_centos_6 ~]# cd/home/downloads/zookeeper-3.4.6

[Email protected]_centos_6 zookeeper-3.4.6]# CD conf

[Email protected]_centos_6 conf]# Cat Zk1.cfg

ticktime=2000

initlimit=10

Synclimit=5

Datadir=/home/apache/zoo/zk1

clientport=2181

server.1=10.6.212.188:2888:3888

server.2=10.6.212.188:2889:3889

server.3=10.6.212.188:2890:3890

[Email protected]_centos_6 conf]# Cat Zk2.cfg

ticktime=2000

initlimit=10

Synclimit=5

Datadir=/home/apache/zoo/zk2

clientport=2182

server.1=10.6.212.188:2888:3888

server.2=10.6.212.188:2889:3889

server.3=10.6.212.188:2890:3890

[Email protected]_centos_6 conf]# Cat Zk3.cfg

ticktime=2000

initlimit=10

Synclimit=5

Datadir=/home/apache/zoo/zk3

clientport=2183

server.1=10.6.212.188:2888:3888

server.2=10.6.212.188:2889:3889

server.3=10.6.212.188:2890:3890

[[Email protected]_centos_6 conf]# ls

Configuration.xsl log4j.properties zk1.cfg zk2.cfg zk3.cfg _zoo.cfg zoo_sample.cfg

[Email protected]_centos_6 conf]# tree/home/apache/zoo/

/home/apache/zoo/

├──zk1

│├──myid

│└──version-2

│├──acceptedepoch

│├──currentepoch

│├──log.100000001

│└──snapshot.0

├──zk2

│├──myid

│└──version-2

│├──acceptedepoch

│├──currentepoch

│└──log.100000001

└──zk3

├──myid

└──version-2

├──acceptedepoch

├──currentepoch

├──log.100000001

└──snapshot.100000000


6 Directories, files

[[Email Protected]_centos_6 conf]#



Start three zookeeper servers:

bin/zkserver.sh Start Conf/zk1.cfg

bin/zkserver.sh Start Conf/zk2.cfg

bin/zkserver.sh Start Conf/zk3.cfg


See zookeeper who is leader who is Follewer:

bin/zkserver.sh Status Conf/zk1.cfg

JMX enabled by default

Using config:conf/zk1.cfg

Mode:follower


bin/zkserver.sh Status Conf/zk2.cfg

JMX enabled by default

Using config:conf/zk2.cfg

Mode:leader


bin/zkserver.sh Status Conf/zk3.cfg

JMX enabled by default

Using config:conf/zk3.cfg

Mode:follower


It's obvious that 2 is leader.

ZK Configuration Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.