how to get the group commit offset from kafka(0.10.x)

匿名 (未验证) 提交于 2019-12-03 00:57:01

问题:

The offsets informations of the group were stored in zookeeper before. Now, in the Kafka Cluster (0.10.x), the offsets informations are stored in the topic which's name is __consumer_offsets.

But how could I get the offsets information of the group which I specified?

回答1:

For active groups, invoke command below to retrieve the offsets:

bin/kafka-consumer-groups.sh --bootstrap-server broker1:9092 --describe --group test-consumer-group 

For inactive groups, first get the target offset topic partition number by calculating Math.abs(groupId.hashCode()) % 50, then invoke:

bin/kafka-simple-consumer-shell.sh --topic __consumer_offsets --partition <calculated number> --broker-list broker1:9092 --formatter "kafka.coordinator.GroupMetadataManager\$OffsetsMessageFormatter" 

to find offsets for the groups.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!