ZooKeeper: Install

ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.

 

Download from offical websit  http://zookeeper.apache.org/

 

#tar -zxf zookeeper-3.4.6.tar.gz

#cd zookeeper-3.4.6

 

 

----conf/zoo.cfg------

 standalone mode

tickTime=2000
dataDir=/var/lib/zookeeper
clientPort=2181

 

Replicated mode

tickTime=2000
dataDir=/var/lib/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
server.1=zhj-c0:2888:3888
server.2=zhj-c1:2888:3888
server.3=zhj-c2:2888:3888

Distributed the zookeeper dir to all zookeeper nodes

 

Set ZOOKEEPER_HOME and PATH in ~/.bashrc

 

Start ZooKeeper

zkServer.sh start

 

Connecting to ZooKeeper

zkCli.sh -server 127.0.0.1:2181

 

 

 

 

Running Replicated ZooKeeper

 

 



Solution:The reason is that the myid file doesn't exist, you should create the myid file and put the corressponding id  in the file in every node of zookeeper cluster. Meanwhile, the dataDir should be created manually first.

Till to now, I start the zookeeper cluster successfully by runing the zkServer.sh start on very node by manually. There maybe a shutcut to start all servers by some command or script.

see:http://docs.ngdata.com/lilyenterprise-docs-1_0/471-lily/493-lily.html

 

Note:For reliable ZooKeeper service, you should deploy ZooKeeper in a cluster known as an ensemble. As long as a majority of the ensemble are up, the service will be available. Because Zookeeper requires a majority, it is best to use an odd number of machines

 

references:

http://zookeeper.apache.org/doc/r3.4.6/zookeeperAdmin.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值