安装zookeeper服务
- mkdir -p /usr/local/services/zookeeper #创建zk安装目录
- cd /usr/local/services/zookeeper
- wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz #下载zookeeper-3.4.14.tar.gz
- tar -zxvf zookeeper-3.4.14.tar.gz #解压缩
- cd /usr/local/services/zookeeper/zookeeper-3.4.14
- 创建数据及日志文件夹
mkdir data logs
- 复制 zoo_sample.cfg 文件的并命名为为 zoo.cfg:
cp zoo_sample.cfg zoo.cfg
- 更改配置
vim zoo.cfg - 启动 ../bin/zkServer.sh start 停止 ../bin/zkServer.sh stop 重启 ../bin/zkServer.sh restart