Different Kafka brokers in the same cluster produce different JMX metrics

Viewed 10

I want to use JMX metrics to collect stats on topic size from my 6 broker Kafka cluster.

I have created a test topic and sent 1000 test messages to it.

Now I am using the JMX to to look at the topic.

Broker 6 shows all the partitions and the 1000 messages, broker 4 only shows partition 2!!

$ kubectl exec -it kafka-broker4-0 -c kafka-broker -- bash -c "/kafka_2.13-2.8.1/bin/kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://localhost:9581/jmxrmi --one-time true --report-format tsv" | grep greg-test | grep Offset
kafka.cluster:type=Partition,name=LastStableOffsetLag,topic=greg-test,partition=2:Value 0
kafka.log:type=Log,name=LogEndOffset,topic=greg-test,partition=2:Value  341
kafka.log:type=Log,name=LogStartOffset,topic=greg-test,partition=2:Value        0

$ kubectl exec -it kafka-broker6-0 -c kafka-broker -- bash -c "/kafka_2.13-2.8.1/bin/kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://localhost:9581/jmxrmi --one-time true --report-format tsv" | grep greg-test | grep Offset
kafka.cluster:type=Partition,name=LastStableOffsetLag,topic=greg-test,partition=0:Value 0
kafka.cluster:type=Partition,name=LastStableOffsetLag,topic=greg-test,partition=1:Value 0
kafka.cluster:type=Partition,name=LastStableOffsetLag,topic=greg-test,partition=2:Value 0
kafka.log:type=Log,name=LogEndOffset,topic=greg-test,partition=0:Value  348
kafka.log:type=Log,name=LogEndOffset,topic=greg-test,partition=1:Value  311
kafka.log:type=Log,name=LogEndOffset,topic=greg-test,partition=2:Value  341
kafka.log:type=Log,name=LogStartOffset,topic=greg-test,partition=0:Value        0
kafka.log:type=Log,name=LogStartOffset,topic=greg-test,partition=1:Value        0
kafka.log:type=Log,name=LogStartOffset,topic=greg-test,partition=2:Value        0
0 Answers
Related