安装:
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
cd /usr/local/
tar -zxvf zookeeper-3.4.6.tar.gz
mv zookeeper-3.4.6 zookeeper
配置:
cd zookeeper/conf
vi zoo.cfg
配置文件--------------zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/usr/local/zookeeper/data
dataLogDir=/usr/local/zookeeper/logs
clientPort=2181
maxClientCnxns=60
autopurge.snapRetainCount=3
autopurge.purgeInterval=12
备注:logs、data目录必须在运行前存在,不存在的手工添加
管理命令:
启动:
cd /usr/local/zookeeper
./bin/zkServer.sh start
停止:
cd /usr/local/zookeeper
./bin/zkServer.sh stop
重启:
cd /usr/local/zookeeper
./bin/zkServer.sh restart
本文转自yzy121403725 51CTO博客,原文链接:http://blog.51cto.com/lookingdream/1862881,如需转载请自行联系原作者