下载地址
http://archive.apache.org/dist/zookeeper/
进入如上的Url,选择合适的zookeeper版本,下载"tar.gz"文件;
解压安装
解压到当前目录
tar -zvxf zookeeper-3.4.9.tar.gz
进入到Zookeeper的根目录
cd zookeeper-3.4.9 mkdir data mkdir logs
创建配置文件zoo.cfg
cd conf
vim zoo.cfg
dataDir=/root/mysoftware/zookeeper/zookeeper-3.4.9/data dataLogDir=/root/mysoftware/zookeeper/zookeeper-3.4.9/logs clientPort=2181 initLimit=5 syncLimit=2 tickTime=2000
进入到bin目录就能启动Zookeeper了:
cd bin/ ./zkServer.sh start
客户端连接:
./zkCli.sh
zk服务端命令
./zkServer.sh start ./zkServer.sh stop ./zkServer.sh restart ./zkServer.sh status
参考:
https://www.cnblogs.com/lsdb/p/7297731.html