1 上传zookeeper到 /opt/software
2 解压zookeeper到/opt/software
cd /opt/upload
tar -zxvf apache-zookeeper-3.9.1-bin.tar.gz -C /opt/software/
2 重命名zookeeper
mv apache-zookeeper-3.9.1-bin/ zookeeper-3.9.1
3 创建zoo.cfg
cd /opt/software/zookeeper-3.9.1/conf
cp zoo_sample.cfg zoo.cfg
4 修改 zoo.cfg
cd /opt/software/zookeeper-3.9.1/conf
vim zoo.cfg
修改以下内容
dataDir=/opt/software/zookeeper-3.9.1/zookeeper
5 启动zookeeper
cd /opt/software/zookeeper-3.9.1/bin
./zkServer.sh start
6 查看zookeeper状态
cd /opt/software/zookeeper-3.9.1/bin
./zkServer.sh status
出现standalone,表示安装成功。
7 停止zookeeper
cd /opt/software/zookeeper-3.9.1/bin
./zkServer.sh stop