Rolling Upgrade from Kafka 3 to Kafk 4

To perform a rolling upgrade from Kafka 3.7.2.3.3.6.x-x to Kafka 4.3.0.3.3.6.x-x, follow these steps.

Step 1: Update the controller and broker properties on all nodes

Edit controller.properties and broker.properties and add the following property:

inter.broker.protocol.version=3.7.2

Step 2: Upgrade brokers one at a time

On each broker, perform the following steps:

  1. Shut down the broker.

  2. Update the code by replacing the bin and libs directories with kafka_2.13-4.3.0.3.3.6.x-x.

  3. Restart the controller and broker.

Step 3: Verify cluster behavior

Once all brokers are upgraded, ensure the cluster is functioning correctly by monitoring logs and metrics. Also try to read events from the topic written in the steps above:

bin/kafka-console-producer.sh --topic Test1 --bootstrap-server localhost:9092

Example output:

This is my first event This is my second event

Step 4: Update the protocol version

Once you're satisfied with the stability, update server.properties:

inter.broker.protocol.version=4.3.0

Once the cluster's behavior and performance are verified, finalize the upgrade by running:

bin/kafka-features.sh --bootstrap-server localhost:9092 upgrade --release-version 4.3

Note After this step, downgrading to an older Kafka version is no longer possible.

Step 5: Restart brokers one after the other

Restart each broker sequentially for the new protocol version to take effect.

For more details, see Upgrading Apache Kafka.

  Last updated