Kafka upgrade path form 0.10.0.1 to 2.5.0 - apache-kafka

I have 5 kafka clusters and one of them runs kafkamirror to consume from the other 4 kakfa and produce for the main kafka cluster.
I've tried the latest version of kafka separately and my apps seems to work fine with the newest version. The upgrade process, as described in the Kafka upgrade https://kafka.apache.org/documentation/#upgrade is a rolling update, first going to 2.5.0 and maintaining the broker protocol with 0.10.0 and then a rolling restart with the newer protocol
The problem is the mirrormaker and have no downtime in the upgrade process to avoid loss of messages. I've read that consumers should be upgraded first, in this case mirrormaker is producer and consumer at the same time, so I tryed to upgrade my main kafka cluster first and now is running with 2.5.0 with 2.5.0 protocol and the other cluster of my tests it's still on 0.10.0. When I try to initiate the mirror I am getting some warnings/errors because I am still using old deprecated configs:
Which path should I follow to do the upgrade?

Related

upgrade Apache kafka from 2.7 version to 3.X without zookeeper on production kafka cluster

we have production Kafka cluster with 2.7 version , 5 Kafka brokers on RHEL 7.9 version
we want to upgrade the Kafka version to 3.X version
3.X version not include zookeeper , so we are wondering if we can do upgrade without any data loss
regarding to kafka 2.7 version , Kafka storing the metadata on zookeeper servers ( as brokers ids , topics names etc )
but is it possible to perform rolling upgrade from 2.7 to 3.x version without any data loss?
The upgrade guide should contain all infos you need.
While KRaft mode (without ZooKeeper) is production ready since 3.3, they still keep ZooKeeper around for compatibility until the 4.0 release.
Furthermore If I understand correctly, it is currently only possible to set up a fresh cluster in KRaft mode, but not to migrate an existing one with ZooKeeper. Kafka 3.5 will be a migration version they intend you to migrate from ZooKeeper to KRaft.
This is explained quite nicely in the release notes from Kafka, especially for Kafka 3.3 and the release video
As long as your Kafka brokers are not running with Java 8 still, you can simply do a rolling upgrade from 2.7 to 3.X like you are used to.

zookeeper-server-start.sh actually uses zookeeper jar from /kafka/libs not /zookeeper/lib. How to upgrade zookeeper?

We have installed zookeeper 3.6.2 and Kafka 2.13-2.6.0
Recently I noticed that zookeeper-server-start.sh is actually using the zookeeper jar file from /kafka/libs/ which is zookeeper-3.5.8.jar.
How do I upgrade zookeeper to 3.6.2. Do I have to find a version of kafka that has it bundled in the tar?
Why do they ask you to download and install zookeeper if the jar is already bundled in kafka and that is the one that kafka uses?
You will need to separately install (and start) a Zookeeper cluster outside of the versions and scripts provided by Kafka if you want to upgrade it, but there are risks involved.
Kafka does come bundled with Zookeeper and is tested against specific versions, but it is not upgraded as frequently as Zookeeper project does releases. You should follow the Kafka upgrade notes before blindly upgrading dependency components; there are some notes around version 2.6 that mentions situations where Zookeeper upgrades can fail and what settings need to be added to fix it. And unless you can guarantee a Zookeeper server upgrade will be backwards compatible, Kafka still has a version-specific Zookeeper client for network communications.
Worth pointing out that Kafka KRaft (Zookeeper-less mode) is already in preview release phase with newest 3.x releases, and is scheduled to be closer to production-ready by the end of the year, so I would hold off on upgrading Zookeeper unless you actually need if for something else.

Not able to upgrade Kafka cluster from 1.0.0 to 2.0

I am trying to upgrade my Kafka cluster from Kafka 1.0.0 to Kafka 2.0 I stopped all the instances in the cluster and updated the server.properties file with -
inter.broker.protocol.version=1.0
I am upgrading from 1.0.0 and have not overridden the message format, so inter.broker.protocol.version is the only parameter that I have to update.
I restarted Kafka but nothing happens when I do
grep "Kafka version" /usr/local/kafka/logs/*
or go inside libs folder I see 1.0.0, not 2.0 which suggests Kafka is still running on 1.0.0 can somebody please guide me what I am doing wrong?
Note: I am following the up gradation procedure from here
https://kafka.apache.org/documentation/#upgrade

Can Kafka consumer on newer version consume message from Kafka producer on older version?

I have a kafka producer that is using 0.80 Kafka version on one machine (eg. ip is 1.2.3.4), can I use kafka consumer that is using 0.10 Kafka version on another machine to consume the message?
I tried to write a consumer on the newer version which listen to 1.2.3.4:9092. But it says kafka.errors.NoBrokersAvailable: NoBrokersAvailable. Is that not allowed? Or did I set something wrong?
Thanks.
Version 0.10.2 clients can talk to version 0.10.0 or newer brokers. However, if your brokers are older than 0.10.0, you must upgrade all the brokers in the Kafka cluster before upgrading your clients. Version 0.10.2 brokers support 0.8.x and newer clients.
https://kafka.apache.org/documentation/#upgrade_10_2_0

Flink Kafka connector

I am using the KafkaConsumer82 and connector jar version is 0.10.2 and kafka version is 0.9.1 and flink version is 1.0.0.
The Java consumer works fine when I run it from with in an IDE as a standalone main program. But when I run it from flink run, then I don't see the messages being consumed and don't see any log in stdout of the JobManager in 1ocalhost:8081. Please let me know what might be the issue.
As a first step I would suggest getting the versions in sync. If you're using Kafka 0.9 and Flink 1.0.0 I would suggest using flink-connector-kafka-0.9 version 1.0.0 which contains FlinkKafkaConsumer09.