zookeeper安装

 

1 下载zookeeper 

2 解压到安装目录 

3 拷贝conf下zoo_sample.cfg配置文件为zoo.cfg 

4 tickTime=2000

  

# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/tmp/zookeeper 需要修改 ,必须是创建好的 
# the port at which the clients will connect
clientPort=2181 
#需要自己添加的server列表  server.id=机器名或ip:监听端口:选举端口  下面两个端口是默认的 
# id 是要写到相应机器得数据目录的myid的文件中,需要自己创建 echo 1>myid 
server.1=cloud1:2888:3888
server.2=cloud2:2888:3888
server.3=cloud3:2888:3888

 

5 创建数据目录并且 创建myid 

6 启动 bin下 ./zkServer.sh start 

7 jps 查看 进程 QuorumPeerMain启动成功 

8 查看工作状态 ./zkServer.sh status

9 zooker 客户端连接  ./zkCli.sh  查看里面内容和保存一些信息 ,help 

 10 必须存大于活集群的一半,才能正常运行 

 

11  统一命名服务,配置管理(动态增加,删除),集群管理(选举),共享锁(分布式应用中)

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值