Back

Zookeeper

$ echo <cmd> | nc <ipaddress> <port>
ie. $ echo <dump> | nc 127.0.0.1 2181

dump

  Lists the outstanding sessions and ephemeral nodes. This only works on the leader.

envi

  Print details about serving environment

kill

  Shuts down the server. This must be issued from the machine the ZooKeeper server is running on.

reqs

  List outstanding requests

ruok

  Tests if server is running in a non-error state. The server will respond with imok if it is running. Otherwise it will not respond at all.

srst

  Reset statistics returned by stat command.

stat

  Lists statistics about performance and connected clients.


Check host connections

$ echo "stat" | nc 127.0.0.1 2181 | grep 128 | awk -F":" '{print $1}' | sort | uniq -c