简体   繁体   中英

How to find out maximum offset value for a particular kafka topic in CDH kerborised cluster

I have a CDH cluster of 41 nodes using Kerberos, 28 of which have Kafka installed.

I want to find out the maximum offset value for a particular Kafka Topic.

I am using the below command, but it is not working. (Note: the option to use kafka-run-class.sh is not working for CDH)

./kafka-consumer-groups.sh  \ 
--command-config /home/username/client.properties \
--group examplehost1:9092,examplehost2:9092,<many more>, examplehost41:9092 \
--topic roc-parse-7485 \
--zookeeper examplezookeperhost1:2181,examplezookeperhost2:2181,examplezookeperhost3:2181

Your problem is probably because you configured your brokers in the group parameter. --group should be the group name you wish to track.

Nevertheless, you can use GetOffsetShell - it gives you the latest offset for each topic partition.
You can find more info here: GetOffsetShell
You should use it like this:

bin/kafka-run-class.sh kafka.tools.GetOffsetShell  --broker-list BROKER_LISTS --partitions 
 PARTITIONS_LIST --topic TOPIC_NAME

In your case:

bin/kafka-run-class.sh kafka.tools.GetOffsetShell  --broker-list rahdpapp00.tt-tim.tr:9092,rahdpapp01.tt-tim.tr:9092,rahdpapp02.tt-tim.tr:9092,rahdpapp03.tt-tim.tr:9092,rahdpapp04.tt-tim.tr:9092,rahdpapp05.tt-tim.tr:9092,rahdpapp06.tt-tim.tr:9092,rahdpapp07.tt-tim.tr:9092,rahdpdtp00.tt-tim.tr:9092,rahdpdtp01.tt-tim.tr:9092,rahdpdtp02.tt-tim.tr:9092,rahdpdtp03.tt-tim.tr:9092,rahdpdtp04.tt-tim.tr:9092,rahdpdtp05.tt-tim.tr:9092,rahdpdtp06.tt-tim.tr:9092,rahdpdtp07.tt-tim.tr:9092,rahdpdtp08.tt-tim.tr:9092,rahdpdtp09.tt-tim.tr:9092,rahdpdtp10.tt-tim.tr:9092,rahdpdtp11.tt-tim.tr:9092,rahdpdtp12.tt-tim.tr:9092,rahdpdtp13.tt-tim.tr:9092,rahdpmp00.tt-tim.tr:9092,rahdpmp01.tt-tim.tr:9092,rahdpmp02.tt-tim.tr:9092,rahdppmp00.tt-tim.tr:9092,rahdppmp01.tt-tim.tr:9092, rahdppmp02.tt-tim.tr:9092
 --partitions 2,1,0 --topic roc-parse-7485

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM