zookeeper 支持某些特定的四字命令与其交互,用户获取 zookeeper 服务的当前状态及相关信息,用户在客户端可以通过 telenet 或者 nc(netcat) 向 zookeeper 提交相应的命令。我采用了CentOS 8的安装命令进行安装:
yum install nc
之后当我在zookeeper启动的时候随便输入了一条指令后提示:ruok is not executed because it is not in the whitelist.
按照百度的步骤我在conf/zoo.cfg里添加了:4lw.commands.whitelist=*
之后再次输入指令后却又提示我:This ZooKeeper instance is not currently serving requests
后来排查了一遍错误后发现是自己的Zookeeper集群没有全部启动,之后全部重启之后解决了问题,能够得到正常输出: