标签:解压 数字 使用 sync sam max apach zoo.cfg 进入
# tar -xf zookeeper-3.4.14.tar.gz -C /opt/
# cd /opt/
# mv zookeeper-3.4.14/ zookeeper
# grep -E -v ‘^#.*|^$‘ zoo1.cfg
tickTime=2000 #CS之间的心跳时间,默认为2秒
initLimit=10 #集群中follower服务器和leader服务器初始连接时能容忍的最多心跳数
syncLimit=5 #集群中follower服务器和leader服务器之间请求和应答最多能容忍的心跳数
dataDir=/opt/zookeeper/Server1/data #该目录用来存放myid信息和一些版本等信息
dataLogDir=/opt/zookeeper/Server1/log #日志目录
clientPort=2181 #客户端连接的端口,默认是2181
maxClientCnxns=6000 #最大连接数
maxSessionTimeout=60000 #会话超时时长
server.1=test3:2888:3888 #集群配置信息server.N = HHH:A:B N服务器编号,HHH服务器地址,A表示flower跟leader的通信端口,默认2888, B表示选举端口,默认3888
server.2=test3:2788:3788
server.3=test3:2688:3688
zoo2.cfg:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/opt/zookeeper/Server2/data
dataLogDir=/opt/zookeeper/Server2/log
clientPort=2182
server.1=test3:2888:3888
server.2=test3:2788:3788
server.3=test3:2688:3688
zoo3.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/opt/zookeeper/Server3/data
dataLogDir=/opt/zookeeper/Server3/log
clientPort=2183
server.1=test3:2888:3888
server.2=test3:2788:3788
server.3=test3:2688:3688
# mkdir -pv /opt/zookeeper/Server{1,2,3}/{data,log}
# echo 1 > opt/zookeeper/Server1/data/myid
# echo 2 > opt/zookeeper/Server2/data/myid
# echo 3 > opt/zookeeper/Server3/data/myid
# vi /etc/profile.d/zookeeper.sh
export ZOOKEEPER_HOME=/opt/zookeeper
export PATH=$PATH:$ZOOKEEPER_HOME
# . /etc/profile.d/zookeeper.sh
# zkServer.sh start /opt/zookeeper/conf/zoo1.cfg
# zkServer.sh start /opt/zookeeper/conf/zoo2.cfg
# zkServer.sh start /opt/zookeeper/conf/zoo3.cfg
查看zookeeper状态
# zkServer.sh status /opt/zookeeper/conf/zoo1.cfg
# zkServer.sh status /opt/zookeeper/conf/zoo2.cfg
# zkServer.sh status /opt/zookeeper/conf/zoo3.cfg
标签:解压 数字 使用 sync sam max apach zoo.cfg 进入
原文地址:https://blog.51cto.com/hld1992/2375513