1.yum -y install nc
2.echo stat|nc ip port
有些时候,第二步执行时候会报错:
stat is not executed because it is not in the whitelist.
解决方法:
1.那么需要停止 zookeeper
bin/zkServer.sh stop
2.编辑zkServer.sh
vim bin/zkServer.sh
在下图处添加一行代码: ZOOMAIN="-Dzookeeper.4lw.commands.whitelist=* ${ZOOMAIN}",保存、退出
3.启动zookeeper
bin/zkServer.sh start
4.查看版本
echo stat|nc 127.0.0.1 2181