单节点安装参考:http://blog.sina.com.cn/s/blog_6f6bc30e0101pb13.html
zookeeper集群安装
-
注意事项:
-
1.注意 /etc/hosts需要配置
-
2.注意打开每台节点之间的iptables通讯
3台主机配置文件如下
-
[root@DB-23 zookeeper]# more conf/zoo.cfg | grep -v "#"
-
tickTime=2000
-
initLimit=10
-
syncLimit=5
-
dataDir=/data/app/zookeeper/data
-
clientPort=2181
-
autopurge.purgeInterval=1
-
-
server.1=10.32.7.113:2889:3888
-
server.2=10.32.7.112:2889:3888
-
server.3=10.32.7.111:2889:3888
修改每台机器的myid
-
myid需要与配置文件中的server后面的数字对应
-
[root@DB-23 data]# pwd
/data/app/zookeeper/data
[root@DB-23 data]# more myid
1
-
-
[root@DB-22 data]# pwd
/data/app/zookeeper/data
[root@DB-22 data]# more myid
2
-
[root@DB-21 data]# pwd
/data/app/zookeeper/data
[root@DB-21 data]# more myid
3
启动每台机器的zookeeper并校验
-
[root@DB-21 conf]# zk-server status
-
JMX enabled by default
-
Using config: /data/app/zookeeper/bin/../conf/zoo.cfg
-
Mode: follower
-
-
[root@DB-22 conf]# zk-server status
-
JMX enabled by default
-
Using config: /data/app/zookeeper/bin/../conf/zoo.cfg
-
Mode: leader --选出来的leader
-
-
[root@DB-23 data]# zk-server status
-
JMX enabled by default
-
Using config: /data/app/zookeeper/bin/../conf/zoo.cfg
-
Mode: follower
网站名称:【Zookeeper】zookeeper集群安装
文章分享:
http://njwzjz.com/article/ihcjdj.html