liveBook · Manning

Controller quorum

As explained in Kafka for Architects

A controller quorum is the group of Kafka controllers that coordinates metadata management and reaches consensus in KRaft mode.

A Kafka deployment needs more than brokers. Topics, configurations, partition details, and other operational metadata must be coordinated. In KRaft mode, a controller quorum handles that work: controllers replicate a metadata log and use majority decisions to keep cluster coordination fault-tolerant. Controller capacity and placement therefore belong in production planning, not just broker sizing. section 9.0 section 9.1.3

Controllers and brokers can have separate roles. In a three-controller static quorum, each controller has a unique node.id, process.roles=controller, a shared controller.quorum.voters list, and a listener for controller communication. A broker uses process.roles=broker and the voter list to find controllers, while also defining listeners for broker and client traffic. section 9.1.2

Listing 9.1 An example of a KRaft controller’s configuration (static quorum)
node.id=1  #1
process.roles=controller  #2
controller.quorum.voters=1@node1:9093,2@node2:9093,3@node3:9093  #3
controller.listener.names=CNTRL  #4
listeners=CNTRL://node1:9093  #5
  listener.security.protocol.map=CNTRL:PLAINTEXT  #6

The configuration shows how one controller identifies itself, names all three voters, and exposes its controller listener; each other controller needs a different node.id. section 9.1.2

If the leader controller stops responding, followers detect the timeout through their metadata fetch requests and may stand for election. A candidate requests votes with information about its metadata log; a majority elects a new leader. Before serving brokers, that leader verifies it has the previously committed entries. Brokers use their configured controller list to locate it and refresh their metadata state. section 9.1.3

The quorum has consequences beyond initial configuration:

  • Plan controller placement for failure domains. A stretched cluster needs a majority of controllers operational; the three-data-center example places one controller in each location. section 11.4.1
  • After safely migrating a broker’s leadership and replicas and shutting it down, remove its metadata from the controller quorum. section 11.1.2
  • Treat a move from ZooKeeper to KRaft as an operational architecture decision: metadata coordination and controller configuration must be planned alongside deployment and incident response. section 9.0

How Kafka for Architects covers it

How deep it goes
Works through static configuration and leader failover, while leaving additional configuration properties to official documentation.
Examples
Uses three-controller configuration listings, a leader-failure sequence, and a stretched cluster across three data centers.
What it assumes
Assumes familiarity with Kafka brokers and deployment, but explains why metadata requires a separate controller role.
What you can do after
Operate/configure it using controller and broker settings, then reason about leader failover and majority-dependent placement.
How it connects
Connects KRaft, metadata logs, leader election, broker discovery, ZooKeeper migration, and disaster recovery planning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka for Architects. The section links point to the parts of the book it draws on.