版权声明:写文章辛苦,请不要复制粘贴,如果要,请注明来处 https://blog.csdn.net/u012627861/article/details/83003334
安装
- 下载ZooKeeper(tar.gz文件,下载后解压即可)
你可以在https://www.apache.org/dyn/closer.cgi/zookeeper/
查看下载地址。下面的地址也可以任选一个
http://mirror.bit.edu.cn/apache/zookeeper/ (建议,秒下)
http://mirrors.hust.edu.cn/apache/zookeeper/
http://mirrors.shu.edu.cn/apache/zookeeper/
http://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/ - 配置ZooKeeper
解压下载好的ZooKeeper压缩包,复制一份conf/zoo-sample.cfg
并改名为zoo.cfg
。因为ZooKeeper启动时默认会读取conf/zoo.cfg
文件。如果找不到该文件将会启动失败并提示invalid config
。完了后如下图:
- 启动ZooKeeper
windows:双击运行bin/zkServer.cmd
mac:sh bin/zkServer.sh start
基本操作
- 启动
windows:双击运行bin/zkServer.cmd
mac/linux:sh bin/zkServer.sh start
- 关闭
mac/linux:sh bin/zkServer.sh stop
- 重启
mac/linux:sh bin/zkServer.sh restart
(完)