参考官方文档:http://zookeeper.apache.org/doc/current/zookeeperStarted.html
三台主机:
centos7: 192.168.41.47
centos7: 192.168.41.127
centos7: 192.168.41.86
下载:
三台机器执行相同操作
#tar xf zookeeper-3.4.12.tar.gz -C /usr/local/
# mv /usr/local/zookeeper-3.4.12 /usr/local/zookeeper
# cd /usr/local/zookeeper/conf
#cp zoo_sample.cfg zoo.cfg
#vim zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/tmp/zookeeper
clientPort=2181
server.1=192.168.41.47:2888:3888
server.2=192.168.41.127:2888:3888
server.3=192.168.41.86:2888:3888
#echo "1" /tmp/zookeeper/myid #第1台机器
#echo "2" /tmp/zookeeper/myid #第2台机器
#echo "3" /tmp/zookeeper/myid #第3台机器
启动zookeeper
./zkServer.sh start
原文地址:http://blog.51cto.com/haoyonghui/2113660
时间: 2024-10-13 01:26:01