Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check Kafka server status or details?

Tags:

apache-kafka

Is there a command to show the details of Kafka server or the status of Kafka server? (I am not trying to find out if the kafka server is running.)

I can only find information on topic, partition, producer, and consumer CLI commands.

like image 901
Jin Lee Avatar asked May 21 '19 08:05

Jin Lee


1 Answers

If you are looking for the Kafka cluster broker status, you can use zookeeper cli to find the details for each broker as given below:

ls /brokers/ids returns the list of active brokers IDs on the cluster.

get /brokers/ids/<id> returns the details of the broker with the given ID.

Example :

kafka_2.12-1.1.1 % ./bin/zookeeper-shell.sh localhost:2181 ls /brokers/ids
Connecting to localhost:2181

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[0]

kafka_2.12-1.1.1 % ./bin/zookeeper-shell.sh localhost:2181 get /brokers/ids/0
Connecting to localhost:2181

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
{"listener_security_protocol_map":{"PLAINTEXT":"PLAINTEXT"},"endpoints":["PLAINTEXT://localhost:9092"],"jmx_port":-1,"host":"localhost","timestamp":"1558428038778","port":9092,"version":4}
cZxid = 0x116
ctime = Tue May 21 08:40:38 UTC 2019
mZxid = 0x116
mtime = Tue May 21 08:40:38 UTC 2019
pZxid = 0x116
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x16ad9830f16000b
dataLength = 188
numChildren = 0

You can put these steps in some shell script to get the details for all brokers.

like image 77
Nishu Tayal Avatar answered Sep 28 '22 03:09

Nishu Tayal