Kafka migration to KRaft
Overview
By default, in ADCM for an ADS cluster, metadata management of the Kafka service is performed via the ZooKeeper service, which provides quorum operation based on the ZAB consensus algorithm.
For clusters where Kafka service is already used together with ZooKeeper, migration to KRaft mode can be performed.
CAUTION
|
The migration process is semi-automated and divided into steps:
Enabling and disabling migration mode is performed using the Kafka service actions in the ADCM interface, the start time of each of them is determined by the user.
Prepare for migration
Check a cluster status
Before enabling migration, check the values of the Kafka quorum solution and KRaft migration mode parameters on the Kafka service configuration page.

Below are instructions for actions with different parameter values.
Kafka quorum solution | KRaft migration mode | Directions for action |
---|---|---|
KRaft |
false |
The cluster is already in KRaft quorum mode. No further action is required |
ZooKeeper |
false |
The cluster is in ZooKeeper quorum mode. The cluster is allowed to enable KRaft migration mode. Before enabling migration mode, install the Kafka Controller component |
ZooKeeper |
true |
Migration mode is already enabled. Check data migration and proceed to disabling migration mode |
Install Kafka controllers
To switch to KRaft mode in a cluster, a new component must be installed for the Kafka service — Kafka Controller. The recommended number of Kafka Controller component instances per cluster is 3.
To add instances of a new Kafka service component in the ADCM interface, run the Add/Remove components action by clicking
in the Actions column.

Next, in the action confirmation form, select the parameter values and hosts for installing instances of the new component.

After the action is successfully completed, the new component is displayed on the component configuration page.

Enable migration mode
To enable migration mode, ensure the following conditions are met:
-
State of the Kafka service parameters:
-
Kafka quorum solution value is
ZooKeeper
; -
KRaft migration mode value is
false
.
-
-
The Kafka service has the Kafka Controller component installed as described above.
To start migration mode for the Kafka service in the ADCM interface, run the KRaft migration stage 1 action by clicking
in the Actions column.

The process of enabling migration mode automatically starts, including the following:
-
configuring Kafka controllers to enable and perform metadata migration from ZooKeeper;
-
configuring Kafka brokers to enable migration mode and interact with the KRaft quorum (while the brokers are still configured to work with ZooKeeper);
-
restarting Kafka brokers;
-
migrating cluster metadata from ZooKeeper to the Kafka controller.
CAUTION
|
Below is the state of the parameters after successfully enabling migration mode:
-
Kafka quorum solution value is
ZooKeeper
; -
KRaft migration mode value is
true
.
Check data migration
The Kafka controller log will show the corresponding messages during the metadata migration.
All messages can be viewed by accessing the /var/log/kafka-controller/server.log file on the host where the Kafka Controller component is located.
Data migration is complete when the following entry appears in the log:
Completed migration of metadata from ZooKeeper to KRaft.
Only if this message appears, it is permissible to proceed to disabling migration mode.
Disable migration mode and set KRaft mode for Kafka
To disable migration mode, ensure the following conditions are met:
-
The Kafka service parameters state:
-
Kafka quorum solution value is
ZooKeeper
; -
KRaft migration mode value is
true
.
-
-
The Kafka controller log contains a message of completion of data migration from ZooKeeper to KRaft, as described above.
To disable migration mode for the Kafka service, in the ADCM interface, run the KRaft migration stage 2 action by clicking
in the Actions column.

The process of disabling migration mode automatically starts, including the following:
-
configuring Kafka controllers to remove all ZooKeeper related properties and complete the migration;
-
configuring Kafka brokers to point directly to the KRaft quorum instead of the ZooKeeper quorum, removing all ZooKeeper related properties, and completing the migration;
-
restarting Kafka brokers and controllers.
Below is the state of the parameters after successfully disabling migration mode:
-
Kafka quorum solution value is
KRaft
; -
KRaft migration mode value is
false
.