「谁在用 ZooKeeper」常被讲成一份名单,但名单很容易过时。这篇不列印象,而是查数据:拿 14 个常见项目最新正式版的 Maven 依赖图,看它们声明了哪个版本的 ZooKeeper,再看 Kafka 从 2.8 到 4.1 的依赖是怎么变的。它只能说明「声明了什么」,不能说明「怎么用」;怎么用的部分,本系列后面几篇会逐个实验。
项目 最新版 ZooKeeper 依赖 Curator org.apache.kafka:kafka_2.13 4.2.2 (无) - org.apache.hbase:hbase-client 3.0.0 3.8.6 DIRECT client 5.2.0, framework 5.2.0, recipes 5.2.0 org.apache.hadoop:hadoop-common 3.5.0 3.8.6 DIRECT client 5.2.0, framework 5.2.0, recipes 5.2.0 org.apache.solr:solr-solrj-zookeeper 10.0.0 3.9.4 DIRECT client 5.9.0, framework 5.9.0 org.apache.flink:flink-runtime 2.3.0 (无) - org.apache.storm:storm-client 3.1.0 (无) - org.apache.pulsar:pulsar-metadata 4.0.13 (无) - org.apache.bookkeeper:bookkeeper-server 4.18.1 3.9.5 DIRECT - org.apache.accumulo:accumulo-core 2.1.6 3.9.5 DIRECT - org.apache.curator:curator-framework 5.9.0 3.9.3 INDIRECT client 5.9.0, framework 5.9.0 org.apache.dubbo:dubbo 3.2.20 (无) - org.apache.druid:druid-processing 查询失败 HTTP Error 404: Not Found org.apache.hive:hive-metastore 4.2.1 3.8.4 INDIRECT client 5.7.1, framework 5.7.1, recipes 5.7.1 org.springframework.cloud:spring-cloud-zookeeper-core5.0.2 (无) -
数据是 deps.dev 解析 Maven Central 的依赖图得到的;「DIRECT」是 pom 里直接写的,「INDIRECT」是通过别的库带进来的(比如通过 Curator)。
kafka_2.13 2.8.2 → ZooKeeper 3.5.9 (DIRECT) kafka_2.13 3.0.2 → ZooKeeper 3.6.3 (DIRECT) kafka_2.13 3.3.2 → ZooKeeper 3.6.3 (DIRECT) kafka_2.13 3.6.2 → ZooKeeper 3.8.4 (DIRECT) kafka_2.13 3.7.2 → ZooKeeper 3.8.4 (DIRECT) kafka_2.13 3.8.1 → ZooKeeper 3.8.4 (DIRECT) kafka_2.13 3.9.2 → ZooKeeper 3.8.4 (DIRECT) kafka_2.13 4.0.2 → ZooKeeper 无 kafka_2.13 4.1.2 → ZooKeeper 无
这只是依赖图上的变化。Kafka 4.0 具体怎么运行、从 ZooKeeper 迁移到 KRaft 的过程见第 103、104 篇。
3.7 / 3.8 / 3.9 系列最近的 8 个版本: ['3.9.2 (2024-02-12)', '3.9.3 (2024-10-17)', '3.9.4 (2025-08-19)', '3.8.5 (2025-09-03)', '3.8.6 (2026-01-28)', '3.9.5 (2026-02-11)', '3.8.7 (2026-09-03)', '3.9.6 (2026-09-03)']