简介
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
原文地址:http://blog.51cto.com/hzde0128/2299600
时间: 2024-11-02 11:33:24