- https://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html#sc_zkCommands
- https://phunt1.wordpress.com/
(leader only) echo dump | nc localhost 2181
echo stat | nc localhost 2181
echo conf | nc localhost 2181
echo cons | nc localhost 2181
echo envi | nc localhost 2181
$./zookeeper-shell.sh 127.0.0.1:2181
Connecting to ....
Welcome to ZooKeeper!
JLine support is disabled
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
ls /brokers/ids
[1, 2, 3, 4, 5, 6]
- https://github.com/outbrain/zookeepercli
- kazoo in python
./zkCli.sh -server 127.0.0.1:9575
- http://www.mtitek.com/tutorials/zookeeper/zkCli.php
- darrenfu/bigdata#6 force delete
zkCli> ls /brokers/topics/test_topic
zkCli> get /brokers/topics/test_topic
{"version":1,"partitions":{"0":[2,3,1]}}
cZxid = 0x100000f06
ctime = Wed Oct 11 23:46:51 UTC 2017
mZxid = 0x100000f06
mtime = Wed Oct 11 23:46:51 UTC 2017
pZxid = 0x100000f09
cversion = 1
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 40
numChildren = 1
zkCli> get /config/topics/test_topic
{"version":1,"config":{"retention.ms":"1000"}}
Server not coming up because of file corruption A server might not be able to read its database and fail to come up because of some file corruption in the transaction logs of the ZooKeeper server. You will see some IOException on loading ZooKeeper database. In such a case, make sure all the other servers in your ensemble are up and working. Use "stat" command on the command port to see if they are in good health. After you have verified that all the other servers of the ensemble are up, you can go ahead and clean the database of the corrupt server. Delete all the files in datadir/version-2 and datalogdir/version-2/. Restart the server.