1 下载
下载地址:https://dlcdn.apache.org/zookeeper
进入要下载的版本,选择有bin的
2 解压
下载的安装包放入指定目录 本文以这个路径为例 /apps/software/zookeeper
cd到目录并解压
cd /apps/software/zookeeper
tar -zxvf apache-zookeeper-3.9.0-bin.tar.gz
3 配置文件修改 zoo.cfg
1)在安装根目录新建 data 和 logs 两个文件夹
2)进入到conf目录将zoo_sample.cfg 文件复制一份并重命名为zoo.cfg
cd /apps/software/zookeeper/apache-zookeeper-3.9.0-bin/conf
cp zoo_sample.cfg zoo.cfg
3)将两个文件夹并配置到 zoo.cfg 文件中
vim zoo.cfg
dataDir=/apps/software/zookeeper/apache-zookeeper-3.9.0-bin/data
dataLogDir=/apps/software/zookeeper/apache-zookeeper-3.9.0-bin/logs
4 启动
进入到bin目录启动
cd /apps/software/zookeeper/apache-zookeeper-3.9.0-bin/bin
./zkServer.sh start
查看状态
./zkServer.sh status
停止zookeeper
./zkServer.sh stop