- 编辑rc.local
vim /etc/rc.d/rc.local
2.需要指定jdk路径以及zookeeper启动路径
export JAVA_HOME=/app/jdk1.8.0_144
/app/zookeeper-3.4.11/bin/zkServer.sh start
3. 启动zookeeper
cd /app/zookeeper-3.4.11/bin
./zkServer.sh start
- 查看zk启动状态
/app/zookeeper-3.4.11/bin
./zkServer.sh status
- 重启服务器,查看zk启动状态
reboot
./zkServer.sh status