Kafka
Version Control
Remote Access
Software Management
Information Technology

How to check the Kafka version remotely

Codemia Knowledge Hub ·

To find the Kafka version on a remote broker, run kafka-broker-api-versions.sh --bootstrap-server <broker_host:port> from a Kafka installation, ask a client library such as kafka-python for the broker version, or read the version over JMX. Knowing the version matters when troubleshooting, upgrading or checking compatibility with clients and other components.

kafka-broker-api-versions.sh

Kafka ships this tool in its installation directory:

bash
./kafka-broker-api-versions.sh --bootstrap-server <broker_host:port>

It connects to the broker and prints the API versions the broker supports, which indirectly tells you the Kafka version.

From a client library

For automated monitoring or integration, query the broker through a Kafka client library. Libraries exist for Java, Python (confluent-kafka or kafka-python), Node.js and others. With kafka-python:

python
1from kafka import KafkaClient
2
3client = KafkaClient(bootstrap_servers='<broker_host:port>')
4client.check_version()   # This returns the version of the Kafka broker

Over JMX

Kafka exposes metrics and runtime information, including its version, over JMX. The JMX port has to be open and reachable remotely. It is set with the JMX_PORT environment variable when the broker starts:

 
JMX_PORT=<jmx_port>

Then use a JMX tool such as jconsole, visualvm or jmxterm. With jmxterm:

bash
echo "get -b kafka.server:type=app-info,id=<broker_id> Version" | java -jar jmxterm.jar -l <broker_host>:<jmx_port>

The MBean name includes the broker's broker.id (for example id=0). This returns the version of the Kafka instance on that broker.

Security and access considerations

  • Network security: make sure Kafka and its ports are reachable only by authorized clients.
  • Broker configuration: access can depend on the broker's security settings, such as SASL/SSL.
  • Compatibility: Kafka clients and tools vary in how well they work with different Kafka versions.
MethodTool/ApproachRemarks
Command Linekafka-broker-api-versions.shDirect and requires CLI access to server.
ProgrammaticallyKafka Client LibrariesFlexible and integrates into applications.
Java Management Extensions (JMX)jmxterm, jconsoleRequires JMX to be enabled on the broker.

Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design