Skip to main content

ZooKeeper operations

v0.1.11

Cluster + 4lw command + watch + session introspection. Read-only. Set ZK_SERVERS env var (host:port,host:port,…). All four-letter words need to be in zoo.cfg's `4lw.commands.whitelist`.

8 allowed by default
Pack ID
zookeeper
Vendor
emisar
OS
linux
Actions
8
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
nc

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install zookeeper --hash sha256:1a4ae4641425f2833cf25d6ab8c6317e92f15101b6f7b6b739f61d20b894473b

Setup

No credentials and no env vars. Each action targets a ZooKeeper node by a required server argument (host:port) and probes it with a four-letter word over a plain nc TCP connection.

Notes

  • Targeting is per-call, not via env: pass server=host:port to every action (the ZK_SERVERS list in the description is operator shorthand, not read by any action).
  • The 4lw commands (srvr, stat, conf, cons, wchs, ruok, mntr, envi) only work if each is in the node's zoo.cfg 4lw.commands.whitelist.
  • The runner host must have plain TCP reach to the client port (default 2181); 4lw is unauthenticated, so restrict it at the network layer.

Verify it works

Runs zk.ruok, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify zookeeper

Install and configure a pack walks through the whole sequence on a host.

Actions 8 total

View on GitHub
  • zk.conf exec low Low — read-only or trivially reversible

    conf (server config)

    Show the server's effective configuration via the `conf` four-letter word. The output is a fixed, bounded property list (client ports, data/log dirs and sizes, tick + session timeouts, serverId, and on quorum members the election/quorum ports and membership) — it discloses paths and topology; stock ZooKeeper does not dump zoo.cfg or arbitrary properties here, so auth material like `superDigest` never appears.

    View source on GitHub
  • zk.cons exec low Low — read-only or trivially reversible

    cons (all connections)

    List all client connections + their session + per-session stats.

    View source on GitHub
  • zk.envi exec low Low — read-only or trivially reversible

    envi (server env)

    Show the server's JVM + OS environment via the `envi` four-letter word. The output is a fixed, bounded property list (zookeeper.version, host.name, java.version/vendor/home, class + library paths, java.io.tmpdir, os.*, user.name/home/dir, JVM memory totals) — it discloses install paths, usernames, and topology; stock ZooKeeper does not print arbitrary system properties or injected secret values here.

    View source on GitHub
  • zk.mntr exec low Low — read-only or trivially reversible

    mntr (monitoring metrics)

    Show per-server metrics in a metrics-friendly format.

    View source on GitHub
  • zk.ruok exec low Low — read-only or trivially reversible

    ruok (health probe)

    Check server health — returns 'imok' if server is serving.

    View source on GitHub
  • zk.srvr exec low Low — read-only or trivially reversible

    srvr (server stats)

    Show server version, latency, packets, mode (leader/follower/standalone).

    View source on GitHub
  • zk.stat exec low Low — read-only or trivially reversible

    stat (server + per-conn stats)

    Show server + per-connection latency, packet counts.

    View source on GitHub
  • zk.wchs exec low Low — read-only or trivially reversible

    wchs (watch summary)

    Show active watch counts.

    View source on GitHub