Giter VIP home page Giter VIP logo

zk's Introduction

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

zk's People

Contributors

fdr avatar funkygao avatar mmcgrana avatar

Watchers

 avatar  avatar

Forkers

tomwans

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.