ZooKeeper 3.9.1 本地安装
1.下载ZooKeeper 3.9.1
https://dlcdn.apache.org/zookeeper/zookeeper-3.9.1/apache-zookeeper-3.9.1-bin.tar.gz
2.安装JDK
3.解压
mkdir /usr/zookeeper
mkdir /usr/zookeeper/zkData
tar -zxvf apache-zookeeper-3.9.1-bin.tar.gz -C /usr/zookeeper/
4.修改配置
cd /usr/zookeeper/apache-zookeeper-3.9.1-bin/conf/
mv zoo_sample.cfg zoo.cfg
vi zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/usr/zookeeper/zkData
clientPort=2181
# admin.serverPort 默认占8080端口
admin.serverPort=7777
5.启动服务端[必须]和客户端[可选]
如果无法正常启动,查看logs目录下的日志文件进行具体分析
../bin/zkServer.sh start
../bin/zkCli.sh
6.停止服务端
../bin/zkServer.sh stop