下载
- 下载链接
https://archive.apache.org/dist/zookeeper/ - 上传
我直接本地下好了,拖到对应文件夹 - 解压,重命名,注意路径
tar -zxvf /opt/Zookeeper/apache-zookeeper-3.7.2-bin.tar.gz -C /opt/
mv /opt/apache-zookeeper-3.7.2-bin /opt/zookeeper
- 在安装目录下创建zkdata和zkdatalog两个文件夹
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/08b4e3a4c00d8655b35ff936eebb745b.png)
配置
- 安装目录/conf/zoo_sample.cfg复制粘贴一份zoo.cfg
cp /opt/zookeeper/conf/zoo_sample.cfg /opt/zookeeper/conf/zoo.cfg
- 修改
dataDir=/opt/zookeeper/zkdata
dataLogDir=/opt/zookeeper/zkdatalog
- 配置环境变量
echo 'export ZOOKEEPER_HOME=/opt/zookeeper/' >> /etc/profile
echo 'export PATH=$PATH:$ZOOKEEPER_HOME/bin' >> /etc/profile
source /etc/profile
启动
zkServer.sh start
zkServer.sh status
zkCli.sh
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/2cfd62f1bea099345e95dc0fe91b4698.png)