liveBook · Manning

Migration mode

As explained in Apache Kafka in Action

Migration mode is a Kafka configuration state that enables the transition of cluster metadata management from ZooKeeper to KRaft.

Migration mode is Kafka’s transitional configuration state for moving cluster metadata management from ZooKeeper to KRaft. It lets new KRaft controllers replicate metadata while existing brokers continue operating with ZooKeeper, creating a reversible testing stage before the final cutover. section 7.3 section 7.5

A controlled migration typically follows these stages:

  • Provision three or five additional KRaft controllers using the same cluster ID as the ZooKeeper cluster. section 7.3
  • Enable zookeeper.metadata.migration.enable=true on the controllers and existing brokers, and configure ZooKeeper connectivity plus the new controller connections. section 7.3
  • Wait for the controllers to replicate ZooKeeper metadata, then verify that the brokers report successful migration. section 7.3
  • Move ordinary brokers to KRaft by removing migration mode and ZooKeeper connectivity and setting process.roles=broker. section 7.3
  • Run the mixed state for a week or two to test stability; disabling migration mode on controllers and removing ZooKeeper connectivity completes the irreversible cutover. section 7.3

Staged controller migration

An existing ZooKeeper cluster adds three or five KRaft controllers with an identical cluster ID. Operators enable zookeeper.metadata.migration.enable=true, supply ZooKeeper and controller connection details, verify replication, and leave the cluster in the intermediate state before committing to KRaft. section 7.3 section 7.5

Completed migration of metadata from ZooKeeper to KRaft

Use the completed-migration listing to review the target state after metadata has moved fully from ZooKeeper to KRaft. section 7.3

How Apache Kafka in Action covers it

How deep it goes
Explains the migration sequence and rollback points conceptually, while deferring detailed implementation instructions to official documentation.
Examples
Uses three-or-five-controller deployments, configuration properties, metadata replication, broker logs, and a week-or-two stability period.
What it assumes
Assumes an existing ZooKeeper-based Kafka cluster and introduces KRaft controllers, migration configuration, and broker-role changes.
What you can do after
Operate/configure Kafka migration mode, validate metadata replication, preserve rollback, and recognize the final point of no return.
How it connects
Connects ZooKeeper, KRaft controllers, Kafka brokers, cluster IDs, metadata replication, and rolling restarts.

Related concepts

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