Keep the zookeeper happy and the whole zoo stays calm — leader, followers, sync state and znodes of your ensemble in one screen
I've been writing about elephants for a while now. Every elephant needs a zookeeper. 🐘
Apache ZooKeeper is the quiet coordinator behind a lot of systems. ClickHouse replicates its tables through it. Other HA tools can use it to elect their leaders. And like every good coordinator, you only notice it when it's gone: suddenly ClickHouse tables are read-only, and the root cause is three hops away.
That's why ZooKeeper got its own plugin in Ivory.
The problems
- Four-letter words over
nc.echo mntr | nc host 2181on every node, then reading the output line by line. - The whitelist. ZooKeeper only answers the commands in
4lw.commands.whitelist, so half the time the first answer is "not executed because it is not in the whitelist". - Who's the leader? You find out by asking every node for its
zk_server_state. - Followers out of sync. The leader knows how many followers are synced — but only if you ask it, and only in
mntr. - Which ensemble is this node even in? A node configured into a different ensemble answers just as nicely.
How Ivory solves them
One overview for the ensemble
Ivory reads ZooKeeper through its own four-letter-word commands, mntr and conf, on the client port. So the only thing to do on the ZooKeeper side is to make sure both are in 4lw.commands.whitelist. And if a command is refused, Ivory quotes ZooKeeper's reply instead of guessing why.
The overview shows every node:
- Role —
leaderandstandaloneare the leader,followerandobserverare replicas. - Members — read from the
server.Nlines of the node's configuration, as long as they carry a client port (…;2181). - Tags — the ZooKeeper version, the number of znodes and connections, and the server state when it's neither leader nor follower.
Because every node reports the ensemble it's configured into, a node from another ensemble is flagged right away.
Honest about what it can't see
ZooKeeper doesn't report replication lag per follower, so Ivory doesn't show a lag for it. A wrong lag is worse than no lag, and I'd rather leave the column empty than invent a number.
The same goes for membership in Ivory's single-host template: its server.N lines carry no client port, so there each node shows only itself instead of a guessed list.
Warnings that matter
- Followers not in sync with the leader,
- a server not serving requests,
- a configuration Ivory couldn't read.
Operations
Leader election in ZooKeeper is automatic and can't be triggered by hand, so Ivory doesn't pretend otherwise. You can view the configuration (conf) — and that's it. Ivory watches ZooKeeper rather than operating it.
A znode console
Each node has a console for znodes: ls, get, create, set, delete and exists, plus the mntr, srvr, stat, ruok and conf commands. If you give it database credentials, Ivory uses them as digest authentication.
The saved queries cover the root children, the ensemble configuration, and the znodes Patroni and ClickHouse keep. When ClickHouse says a replica lost its session, that's where you go next.
The machine behind each node
Give Ivory an SSH key, and each node shows its host's CPU, memory, network, processes and any log file. ZooKeeper is very sensitive to slow disks and long GC pauses, and this is where you'll see them. If it runs in Docker, the Container tab has its logs, inspect, start, stop and restart.
Need a new ensemble?
Ivory deploys one over plain SSH from a template. Both templates run the official zookeeper:3.9 image with the four-letter words Ivory needs already whitelisted.
- ZooKeeper (Multi Host) — three nodes
zookeeper1–zookeeper3, one per machine, client port2181(quorum2888, election3888). Server ids are 1–3 in order; replace the example addresses with your hosts and keep the order. - ZooKeeper (Single Host) — all three on one machine on client ports
2181–2183.
The single-host template is exactly what Ivory's ClickHouse single-host template points at. Deploy ZooKeeper first, then ClickHouse on the same machine, and you have a replicated ClickHouse cluster to play with in a few minutes.
Ask your AI agent
Connect Claude, Cursor or Codex to Ivory's built-in MCP server and ask:
"Which ZooKeeper node is the leader, and are all followers in sync?"
"ClickHouse lost its ZooKeeper session — is the ensemble healthy?"
"List the znodes ClickHouse keeps for the analytics cluster."
"Is anything wrong with the machine behind zookeeper2?"
It works through Ivory, with your permissions. See the MCP docs.
Try it
docker run -p 80:80 --restart always veegres/ivory Open http://localhost, finish the setup wizard and add your ensemble. ZooKeeper support is in beta — feedback and issues are very welcome.
Keep the zookeeper happy, and the whole zoo stays calm. 😉
Useful links:


