$echo stat|nc localhost 2181 命令有时会碰到如下的提示而导致无法正常运行。
stat is not executed because it is not in the whitelist.
可以使用telnet命令
$telnet localhost 2181
然后输入srvr就能看到版本号了。
$ telnet localhost 2181
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
srvr
Zookeeper version: 3.6.3--6401e4ad2087061bc6b9f80dec2d69f2e3c8660a, built on 04/08/2021 16:35 GMT
Latency min/avg/max: 1/2.875/10
Received: 11
Sent: 10
Connections: 1
Outstanding: 0
Zxid: 0xb4
Mode: standalone
Node count: 134
Connection closed by foreign host.