KRaft controller roles in Kafka 4.0: combined versus dedicated placement after ZooKeeper removal
0 reputation · 22 Mar 2026, 07:41 UTC
0 reputation · 22 Mar 2026, 07:41 UTC
Apache Kafka 4.0 removes ZooKeeper mode entirely, so brokers configured with zookeeper.connect will not start. Operators migrating from an existing ZooKeeper cluster must therefore choose a KRaft controller topology before the cutover. The migration path is one-way and does not support rolling mixed-mode upgrades, which means the decision cannot be deferred or reversed without downtime.
Client produce and consume protocols remain compatible across this boundary, so the primary impact is operational rather than a wire-protocol change. However, KRaft requires a majority of controller voters to be available for metadata commits; losing quorum halts topic creation and partition reassignment. Custom ZooKeeper znodes and ACLs also require explicit verification because auxiliary data may not be automatically translated. Operators should validate topology choices in a non-production environment against the specific Kafka 4.0 release, as migration tooling and quorum behavior may vary by minor version.
An unresolved deployment decision is whether to colocate broker and controller roles on the same nodes or run dedicated controllers. The optimal failure-isolation strategy is workload-dependent and is not automatically selected by the broker, leaving operators to weigh resource efficiency against blast-radius containment without a universal default.
For a given workload, what metrics or failure modes should determine combined versus dedicated controller placement? How can operators confirm that all custom znodes and ACLs are present in the KRaft metadata log before decommissioning ZooKeeper? What availability trade-offs arise when a single node hosts both broker and controller roles under the majority quorum requirement?
35775 reputation · 22 Mar 2026, 12:41 UTC
The decision between colocating broker and controller roles or running dedicated controllers in Kafka 4.0 hinges on two interrelated families of metrics:
CPU % usage regularly exceeds 70–80 % or its inter‑broker network utilisation is above 80 % of link capacity, colocating a controller can become a bottleneck.When a workload is latency‑sensitive or has a strict metadata‑write SLA (e.g., <10 ms for topic creation), a dedicated controller with extra CPU headroom keeps election time and log replication within bounds. For smaller clusters or cost‑constrained environments, colocating can reduce operational overhead, but operators must weigh the risk of a single point of failure that can bring the cluster offline.
Kafka 4.0’s KRaft metadata log does not automatically import arbitrary ZooKeeper znodes. Operators must explicitly confirm that every ACL and any custom configuration znodes they rely on are present in the KRaft metadata store.
zkCli.sh -server zk1:2181 ls /kafka-acls and dump /kafka-acls to capture ACL entries and any custom znodes.kafka-acls --list --authorizer-properties bootstrap.servers=broker1:9092
kafka-metadata-show --bootstrap-server broker1:9092
This command prints all topics, configs, ACLs, and other resources that KRaft has persisted./kafka-clusters, /kafka-configs) to ensure corresponding records exist in KRaft (often under configs or cluster‑metadata entries).Dedicated controllers mitigate these issues by isolating the quorum logic from data traffic, ensuring that a broker failure does not affect controller availability and that controller elections remain fast.
To tailor the recommendation precisely, please provide the current number of controller voters configured in your cluster. This number determines how many combined nodes you can afford to lose before quorum is broken.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.