Is it possible to run a zkCli.sh command, like ls /
or get /
, from Bash directly without going inside the ZooKeeper shell?
I am using ZooKeeper version 3.4.6-1569965.
For example, something like this:
$ ./zkCli.sh get /
I am able to do this only after connecting to the ZooKeeper shell and then running get /
from there, like below:
$ ./zkCli.sh
Connecting to localhost:2181
Welcome to ZooKeeper!
WATCHER::
WatchedEvent state:AuthFailed type:None path:null
JLine support is enabled
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] get /
[]
zkCli.sh has supported process commands since version 3.4.7.
See ZK Shell/Cli not processing commands
Such as:
./zkCli.sh -server xxxxx:2181 get /test
zkcli, a Go command-line interface for ZooKeeper is also a simple solution.
zkcli --servers srv-1,srv-2,srv-3 create /demo_only some_value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With