Migrating Kafka from ZooKeeper to KRaft
Learn about migrating an existing Zookeeper-based Kafka cluster to KRaft. Migration is performed in Cloudera Management Console, using the migration action available under the Cloudera Data Hub cluster management. Additionally, migration is done in a rolling fashion requiring no downtime.
Apache Kafka Raft (KRaft) is a consensus protocol used for metadata management that was developed as a replacement for Apache ZooKeeper. Using KRaft for managing Kafka metadata instead of ZooKeeper offers various benefits including a simplified architecture and a reduced operational footprint.
Migration at glance
Migration is completed in two steps, start and finalize, with the option to roll back at any time before finalization. You manage a migration (start, finalize, or rollback) using the migration action available under the Cloudera Data Hub cluster management in Cloudera Management Console. Configuration changes needed for the migration are automated by the migration actions.
-
Migrate Kafka to KRaft – Starts migration of Kafka brokers from ZooKeeper to KRaft for the specified Kafka service. Migrates the cluster up to a sate where rollback is still possible.
When this action finishes, brokers will run in KRaft mode and will be disconnected from ZooKeeper. KRaft controllers will still be connected to ZooKeeper and will continue to write metadata to ZooKeeper, but are ready to disconnect (dual-write mode).
-
Finalize KRaft Migration – Finalizes migration by disconnecting KRaft controllers from ZooKeeper. Reverting to ZooKeeper is not possible once this action starts.
-
Rolling back KRaft Migration – Reverts migration of Kafka brokers from ZooKeeper to KRaft for the specified Kafka service using rolling restarts.
You can only start these actions if your cluster meets the required prerequisites. If prerequisites are not met, the actions will be disabled.
Migrating a Cloudera Streams Messaging cluster to KRaft
You migrate an existing ZooKeeper-based Cloudera Streams Messaging cluster to KRaft by using the migration feature available in Cloudera Management Console.
-
Migrating an existing ZooKeeper-based Cloudera Streams Messaging cluster KRaft is only available if you are on Cloudera Manager 7.13.2 or later and Cloudera Runtime 7.3.2.
Migration is only possible with this combination of versions. This is because:-
Earlier Cloudera Manager versions do not include the necessary Kafka service actions.
-
Cloudera Runtime 7.3.2 is the only version where migration is possible. Neither previous or future major, minor, and maintenance versions support migration.
-
-
The Kafka service must run with inter-broker protocol version 3.9.
Verify the version by checking the value of the Kafka Inter-Broker Protocol Version property in . The value of the property must be
3.9or empty. An empty value means that version is set to the default, which is 3.9 in Cloudera Runtime 7.3.2.
