其他分享
首页 > 其他分享> > zookeeper08-ZooKeeper的重配置

zookeeper08-ZooKeeper的重配置

作者:互联网

1、为什么不使用简单的扩容

2、ZooKeeper的重配置

]# grep '^[^#]' /usr/local/apache-zookeeper-3.5.9-bin/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/tmp/zookeeper/data
clientPort=2181
dataLogDir=/tmp/zookeeper/log
server.1=10.1.1.10:2888:3888
server.2=10.1.1.11:2888:3888
server.3=10.1.1.12:2888:3888
--从配置文件中删除了clientPort
]# vim /usr/local/apache-zookeeper-3.5.9-bin/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/tmp/zookeeper/data
dataLogDir=/tmp/zookeeper/log
dynamicConfigFile=./conf/dyn.cfg

--dyn.cfg文件只由服务器条目组成
]# vim /usr/local/apache-zookeeper-3.5.9-bin/conf/dyn.cfg
server.1=10.1.1.10:1188:1288:participant;2181
server.2=10.1.1.11:2188:2288:participant;2182
server.3=10.1.1.12:3188:3288:participant;2183
[zk: localhost:2181(CONNECTED) 0] reconfig -remove 2,3 -add server.4=10.1.1.14:4188:4288:participant;2184,server.5=10.1.1.15:5188:5288:participant;2185
server.1=10.1.1.10:1188:1288:participant;2181
server.4=10.1.1.14:4188:4288:participant;2184
server.5=10.1.1.15:5188:5288:participant;2185
[zk: localhost:2181(CONNECTED) 0] get /zookeeper/config 
server.1=10.1.1.10:2888:3888:participant
server.2=10.1.1.11:2888:3888:participant
server.3=10.1.1.12:2888:3888:participant
version=0

3、管理客户端的连接串

标签:10.1,配置,participant,配置文件,ZooKeeper,zookeeper08,服务器,客户端
来源: https://www.cnblogs.com/maiblogs/p/15836741.html