Kafka KRaft mode eliminates ZooKeeper dependency using an internal Raft consensus protocol. Understanding controller quorums, metadata logs, and cluster formation is essential for modern Kafka operations.
0 / 5 completed
1 / 5
In Kafka's KRaft mode, what replaces Apache ZooKeeper for cluster metadata management?
KRaft replaces ZooKeeper with an internal Raft consensus protocol running on a quorum of Kafka controller nodes. Cluster metadata (topics, partitions, ACLs, configs) is stored in a dedicated @metadata internal Kafka topic. This eliminates ZooKeeper as an operational dependency and enables faster metadata propagation.
2 / 5
What is the role of the Controller Quorum in Kafka KRaft mode?
The Controller Quorum is a set of Kafka brokers (or dedicated controller nodes) that participate in Raft consensus to maintain authoritative cluster metadata. The active controller (Raft leader) processes metadata changes; followers replicate the log. All brokers subscribe to metadata updates from the quorum via the MetadataFetch RPC.
3 / 5
A Kafka admin runs kafka-storage.sh format --config kraft.properties --cluster-id $(kafka-storage.sh random-uuid). When is this command required?
The kafka-storage.sh format command initializes the metadata log directory with a unique cluster ID before the first startup of a KRaft cluster. This is a one-time operation. The cluster ID must be the same on all nodes in the quorum; it uniquely identifies the cluster and is embedded in all metadata records.
4 / 5
What does the process.roles configuration in KRaft mode control?
process.roles defines a node's role: broker (handles client I/O), controller (participates in Raft quorum), or broker,controller (combined mode for smaller clusters). In production, separating roles onto dedicated nodes is recommended so controller failures don't impact data plane availability.
5 / 5
During migration from ZooKeeper mode to KRaft mode, Kafka provides a migration tool. What is the epoch concept important for in KRaft?
In Raft-based systems, the epoch (or term) is a monotonically increasing number incremented on each leader election. Kafka's KRaft uses epochs to prevent split-brain: a controller with a lower epoch is rejected by followers who have seen a newer epoch, ensuring only the current legitimate leader can commit metadata changes.