druid/docs/dependencies/zookeeper.md
Xavier Léauté b517c3339b
remove ZooKeeper 3.4 support + pass tests with Java 15 (#11073)
With this change, Druid will only support ZooKeeper 3.5.x and later.

In order to support Java 15 we need to switch to ZK 3.5.x client libraries and drop support for ZK 3.4.x
(see #10780 for the detailed reasons) 

* remove ZooKeeper 3.4.x compatibility
* exclude additional ZK 3.5.x netty dependencies to ensure we use our version
* keep ZooKeeper version used for integration tests in sync with client library version
* remove the need to specify ZK version at runtime for docker
* add support to run integration tests with JDK 15
* build and run unit tests with Java 15 in travis
2021-05-25 12:49:49 -07:00

3.2 KiB

id title
zookeeper ZooKeeper

Apache Druid uses Apache ZooKeeper (ZK) for management of current cluster state.

Minimum ZooKeeper versions

Apache Druid supports ZooKeeper versions 3.5.x and above.

Note: Starting with Apache Druid 0.22.0, support for ZooKeeper 3.4.x has been removed

ZooKeeper Operations

The operations that happen over ZK are

  1. Coordinator leader election
  2. Segment "publishing" protocol from Historical
  3. Segment load/drop protocol between Coordinator and Historical
  4. Overlord leader election
  5. Overlord and MiddleManager task management

Coordinator Leader Election

We use the Curator LeadershipLatch recipe to do leader election at path

${druid.zk.paths.coordinatorPath}/_COORDINATOR

Segment "publishing" protocol from Historical and Realtime

The announcementsPath and servedSegmentsPath are used for this.

All Historical processes publish themselves on the announcementsPath, specifically, they will create an ephemeral znode at

${druid.zk.paths.announcementsPath}/${druid.host}

Which signifies that they exist. They will also subsequently create a permanent znode at

${druid.zk.paths.servedSegmentsPath}/${druid.host}

And as they load up segments, they will attach ephemeral znodes that look like

${druid.zk.paths.servedSegmentsPath}/${druid.host}/_segment_identifier_

Processes like the Coordinator and Broker can then watch these paths to see which processes are currently serving which segments.

Segment load/drop protocol between Coordinator and Historical

The loadQueuePath is used for this.

When the Coordinator decides that a Historical process should load or drop a segment, it writes an ephemeral znode to

${druid.zk.paths.loadQueuePath}/_host_of_historical_process/_segment_identifier

This znode will contain a payload that indicates to the Historical process what it should do with the given segment. When the Historical process is done with the work, it will delete the znode in order to signify to the Coordinator that it is complete.