Skip to main content
InterviewHubPRO
Section Overview
Q35

Question 35 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

70%
Apache Kafka Streaming (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

Zero-Downtime Migration from ZooKeeper to KRaft in Production.

senior LevelSystem DesignApache Kafka

In Simple Words: Migrating an existing enterprise Kafka cluster from ZooKeeper to KRaft without interrupting live producers or consumers:

  1. Deploy KRaft Controller Quorum: Spin up dedicated KRaft controller nodes running Kafka 3.6+.
  2. Enable Dual-Mode on Brokers: Update broker configurations with zookeeper.metadata.migration.enable=true. Brokers connect to both ZooKeeper and the KRaft controllers.
  3. Metadata Migration: The KRaft active controller reads cluster metadata from ZooKeeper and writes it into the @metadata KRaft partition.
  4. Switch Metadata Source: Migrate brokers to read metadata exclusively from KRaft controllers.
  5. Decommission ZooKeeper: Once all brokers are KRaft-native, remove the migration config and safely shut down the ZooKeeper cluster.