首页 > 其他 > 详细

zookeeper分布式集群

时间:2018-10-13 22:34:49      阅读:158      评论:0      收藏:0      [点我收藏+]
简介

zookeeper:分布式协调应用程序
官方网站:http://zookeeper.apache.org/

最新版本:3.4.13
下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.13/zookeeper-3.4.13.tar.gz

安装部署

vim /etc/hosts
192.168.33.14 node4
192.168.33.15 node5
192.168.33.16 node6

下载安装

yum -y install java
yum -y install wget 
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.13/zookeeper-3.4.13.tar.gz
tar xf zookeeper-3.4.13.tar.gz 
mv zookeeper-3.4.13 /usr/local/zookeeper

配置

mv /usr/local/zookeeper/conf/zoo{_sample,}.cfg
cat >> /usr/local/zookeeper/conf/zoo.cfg<<EOF
server.1 = node4:2888:3888
server.2 = node5:2888:3888
server.3 = node6:2888:3888
EOF

node4:
echo 1 > /tmp/zookeeper/myid
node5:
echo 2 > /tmp/zookeeper/myid
node6:
echo 3 > /tmp/zookeeper/myid

启动集群

cd /usr/local/zookeeper/bin && ./zkServer.sh start

查看集群节点状态

查看下面的信息说明集群配置正常,如果不正常,查看日志文件/usr/local/zookeeper/bin/zookeeper.out

./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Mode: leader

zookeeper分布式集群

原文:http://blog.51cto.com/hzde0128/2299600

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!