Apache ZooKeeper
Apache ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services for distributed systems. It provides a hierarchical key-value store (znodes), watches for change notifications, ephemeral nodes for presence detection, and sequential nodes for leader election and distributed locking. ZooKeeper exposes a Java/C client API and an HTTP Admin Server API for monitoring and management. It is widely used by Kafka, Hadoop, HBase, Storm, and other distributed systems.
APIs
Apache ZooKeeper Admin Server API
The ZooKeeper Admin Server provides HTTP endpoints on port 8080 that expose the four-letter-word equivalent commands as REST endpoints for cluster monitoring, configuration, and...
Apache ZooKeeper Client API
The ZooKeeper client API provides Java and C language bindings for distributed coordination operations. Operations include create (create znodes), delete, exists (check existenc...
Features
Tree-structured znode namespace similar to a filesystem for organized configuration storage.
Client watches on znodes trigger one-time callbacks on change events for reactive patterns.
Nodes that disappear when the creating client session expires for presence detection.
Auto-incrementing sequential znodes for implementing distributed queues and leader election.
Compare-and-set and multi-operation batches for consistent distributed state updates.
Per-znode access control lists for authentication and authorization of znode operations.
Read-only observer servers for scaling read throughput without affecting write quorum.
Use Cases
Distributed leader election using ephemeral sequential znodes for coordination.
Centralized configuration storage with watch-based change notification to services.
Service registration and lookup using ephemeral znodes as presence indicators.
Distributed mutex and read/write locks using ephemeral sequential znode recipes.
Kafka broker coordination, HBase region server management, and Hadoop NameNode fencing.
Integrations
ZooKeeper (legacy) for Kafka broker metadata and controller election (replaced by KRaft).
ZooKeeper for HBase region server coordination and master election.
ZooKeeper for HDFS NameNode HA fencing and YARN ResourceManager HA.
ZooKeeper for Storm Nimbus coordination and worker heartbeat tracking.
ZooKeeper for SolrCloud cluster coordination, configuration, and leader election.
High-level ZooKeeper client with recipes for common distributed patterns.