Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the kafka version in linux

Tags:

apache-kafka

People also ask

How do I get kafka version in Linux?

Kafka version check can be done with confluent utility which comes by default with Confluent platform( confluent utility can be added to cluster separately as well - credits cricket_007).

How do I know kafka version?

Via command line, you can navigate to /usr/hdp/current/kafka-broker/libs and see the jar files with the versions.

What is the current kafka version?

3.2. 1 is the latest release. The current stable version is 3.2.

How can I tell if kafka is running on Linux?

Use 'systemctl status kafka' to check the status.


Not sure if there's a convenient way, but you can just inspect your kafka/libs folder. You should see files like kafka_2.10-0.8.2-beta.jar, where 2.10 is Scala version and 0.8.2-beta is Kafka version.


Kafka 2.0 have the fix(KIP-278) for it:

kafka-topics.sh --version 

Or

kafka-topics --version

Using confluent utility:

Kafka version check can be done with confluent utility which comes by default with Confluent platform(confluent utility can be added to cluster separately as well - credits cricket_007).

${confluent.home}/bin/confluent version kafka

Checking the version of other Confluent platform components like ksql schema-registry and connect

[confluent-4.1.0]$ ./bin/confluent version kafka
1.1.0-cp1

[confluent-4.1.0]$ ./bin/confluent version connect
4.1.0

[confluent-4.1.0]$ ./bin/confluent version schema-registry
4.1.0

[confluent-4.1.0]$ ./bin/confluent version ksql-server
4.1.0

There is nothing like kafka --version at this point. So you should either check the version from your kafka/libs/ folder or you can run

find ./libs/ -name \*kafka_\* | head -1 | grep -o '\kafka[^\n]*'

from your kafka folder (and it will do the same for you). It will return you something like kafka_2.9.2-0.8.1.1.jar.asc where 0.8.1.1 is your kafka version.


There are several methods to find kafka version

Method 1 simple:-

ps -ef|grep kafka

it will displays all running kafka clients in the console... Ex:- /usr/hdp/current/kafka-broker/bin/../libs/kafka-clients-0.10.0.2.5.3.0-37.jar we are using 0.10.0.2.5.3.0-37 version of kafka

Method 2:- go to

cd /usr/hdp/current/kafka-broker/libs
ll |grep kafka

Ex:- kafka_2.10-0.10.0.2.5.3.0-37.jar kafka-clients-0.10.0.2.5.3.0-37.jar

same result as method 1 we can find the version of kafka using in kafka libs.


You can grep the logs to see the version. Let's say kafka is installed under /usr/local/kafka, then:

$ grep "Kafka version" /usr/local/kafka/logs/*

/usr/local/kafka/logs/kafkaServer.out: INFO Kafka version : 0.9.0.1 (org.apache.kafka.common.utils.AppInfoParser)

will reveal the version


Simple way on macOS e.g. installed via homebrew

$ ls -l $(which kafka-topics)
/usr/local/bin/kafka-topics -> ../Cellar/kafka/0.11.0.1/bin/kafka-topics

If you want to check the version of a specific Kafka broker, run this CLI on the broker*

kafka-broker-api-versions.sh --bootstrap-server localhost:9092 --version

where localhost:9092 is the accessible <hostname|IP Address>:<port> this API will check (localhost can be used if it's the same host you're running this command on). Example of output:

2.4.0 (Commit:77a89fcf8d7fa018)

* Apache Kafka comes with a variety of console tools in the ./bin sub-directory of your Kafka download; e.g. ~/kafka/bin/