下载
分享两个镜像源:
zookeeper官网下载:https://zookeeper.apache.org/releases.html
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.5.10/apache-zookeeper-3.5.10-bin.tar.gz --no-check-certificate
安装
1、解压到/usr/local/
目录下
tar -zxvf ./apache-zookeeper-3.5.10-bin.tar.gz -C /usr/local/
2、进入目录并修改名称
cd /usr/local && mv apache-zookeeper-3.5.10-bin/ zookeeper-3.5.10
3、进入 zookeeper 创建两个文件
cd zookeeper-3.5.10
mkdir data
mkdir logs
4、创建配置文件
vim conf/zoo.cfg
5、写入配置信息
tickTime = 2000
dataDir = /usr/local/zookeeper-3.5.10/data
dataLogDir = /usr/local/zookeeper-3.5.10/logs
tickTime = 2000
clientPort = 2181
initLimit = 5
syncLimit = 2
启动zookeeper
启动服务:
/usr/local/zookeeper-3.5.10/bin/zkServer.sh start
连接服务:
/usr/local/zookeeper-3.5.10/bin/zkCli.sh
查看服务状态:
/usr/local/zookeeper-3.5.10/bin/zkServer.sh status
停止服务:
/usr/local/zookeeper-3.5.10/bin/zkServer.sh stop