1,下载
release地址:Apache ZooKeeper
地址:https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz
2,安装
bash
# 解压并进入解压目录
tar zxvf apache-zookeeper-3.8.3-bin.tar.gz -C /usr/local/ && cd /usr/local/
# 重命名并进入目录
mv apache-zookeeper-3.8.3-bin zookeeper && cd zookeeper
# 创建目录
mkdir data && cd data && echo 1 > myid
3,配置
bash
# 设置配置文件
cp conf/zoo_sample.cfg conf/zoo.cfg && vi conf/zoo.cfg
bash
# zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/usr/local/zookeeper/data
clientPort=2181
admin.serverPort=2182
4,启动
bash
bin/zkServer.sh start