ZooKeeper: Install

本文介绍如何下载并安装ZooKeeper,包括配置独立模式和集群模式的方法。此外,还详细介绍了启动ZooKeeper服务及连接客户端的过程,并强调了在可靠的服务中使用集群的重要性。

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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值