zk is a command line client to the Zookeeper
distributed storage service designed to be fast, easy to install,
and Unix-friendly. It's written in Go.
$ go get github.com/mmcgrana/zk
And use with e.g.:
$ echo data | zk create /path $ zk get /path data $ echo new-data | zk set /path $ zk get /path new-data $ zk children / path namespace zookeeper
zk help or
zk help <command> to see full usage details:
$ zk help Usage: zk <command> [arguments] [options] Commands: exists show if node exists stat show node details get show node data create create node with initial data set write node data delete delete node children list node children help show help Run 'zk help <command>' for details.
to trigger the installation of corresponding watches on the
requested node. For example:
$ bash -c "sleep 10; echo second-value | zk set /key" & $ zk get /key --watch # pauses for ~10s, then returns first-value $ zk get /key # returns immediately second-value
By default the client targets
127.0.0.1:2181. To configure one or
more different Zookeepers to target, export
host:port format with a
, between each server. For example:
$ export ZOOKEEPER_SERVERS=220.127.116.11:2181,18.104.22.168:2181,22.214.171.124:2181 $ zk ...
Other Zookeeper CLIs
You may be interested in these other Zookeper command line clients:
zk project borrows much of its CLI scaffolding and therefore
CLI aesthetic from the
zk is designed to behave like a standard Unix tool and
be composed with other such tools.
Please see CONTRIBUTING.md.
Please see LICENSE.md