查看偏移量,报 WARN WARNING: ConsumerOffsetChecker is deprecated and will be dropped in releases following 0.9.0. Use ConsumerGroupCommand instead.
我用命令查看偏移量时候,报以下错误
[root@linux21-58 kafka_2.11-0.10.0.0]# bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zkconnect localhost:2181 --group test [2016-06-13 09:44:22,921] WARN WARNING: ConsumerOffsetChecker is deprecated and will be dropped in releases following 0.9.0. Use ConsumerGroupCommand instead. (kafka.tools.ConsumerOffsetChecker$) Exception in thread "main" joptsimple.UnrecognizedOptionException: 'zkconnect' is not a recognized option at joptsimple.OptionException.unrecognizedOption(OptionException.java:93) at joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:402) at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:55) at joptsimple.OptionParser.parse(OptionParser.java:392) at kafka.tools.ConsumerOffsetChecker$.main(ConsumerOffsetChecker.scala:133) at kafka.tools.ConsumerOffsetChecker.main(ConsumerOffsetChecker.scala)这是什么原因啊?
0.9版本以后,偏移量命令ConsumerOffsetChecker已弃用,用新的命令来查。
// 列表
bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --list
// 偏移量描述
bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --describe --group test-consumer-group
厉害啊!
bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --describe --group myself
你的答案