Add support for zk admin commands (aka four letter cmds)
Bug #865370 reported by
Kapil Thangavelu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
txzookeeper |
In Progress
|
Wishlist
|
Kapil Thangavelu |
Bug Description
Useful debugging and status information can be obtained using the four letter commands.
Related branches
Changed in txzookeeper: | |
importance: | Undecided → Wishlist |
status: | New → In Progress |
assignee: | nobody → Kapil Thangavelu (hazmat) |
To post a comment you must log in.
I use those in two ways, either simple command line:
$ echo stat | nc 127.0.0.1 2181
or via as very simple helper:
from socket import create_connection
def send_command( host=u' 127.0.0. 1', port=2181, command=b'ruok'): connection( (host, port)) sendall( command)
sock = create_
sock.
result = sock.recv(8192)
sock.close()
return [l.strip() for l in result.split('\n') if l]
>>> send_command( command= b'stat' )