Skip to content

tomwans/zk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zk

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.

Getting Started

Install with:

$ 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

Usage Details

Use 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.

Watches

Commands exists, get, and children accept --watch options 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

Server Configuration

By default the client targets 127.0.0.1:2181. To configure one or more different Zookeepers to target, export ZOOKEPER_SERVERS in host:port format with a , between each server. For example:

$ export ZOOKEEPER_SERVERS=23.22.49.116:2181,23.20.114.164:2181,54.197.120.188:2181
$ zk ...

Other Zookeeper CLIs

You may be interested in these other Zookeper command line clients:

hk Lineage

The zk project borrows much of its CLI scaffolding and therefore CLI aesthetic from the hk project. Like hk, zk is designed to behave like a standard Unix tool and be composed with other such tools.

Contributing

Please see CONTRIBUTING.md.

License

Please see LICENSE.md

About

Zookeeper CLI designed to be fast, easy to install, and Unix-friendly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%