Kafka 的主要工具类如下(包路径为: kafka.tool.*):
大家更加版本,可自行查看:
https://github.com/apache/kafka/tree/trunk/core/src/main/scala/kafka/tools
- 获取当前消费进度
bin/kafka-run-class.sh kafka.tools.GetOffsetShell –broker-list ryan-s03:9092,ryan-s01:9092,ryan-s02:9092 –topic test –time -1
bin/kafka-run-class.sh kafka.tools.GetOffsetShell –broker-list ryan-s03:9092,ryan-s01:9092,ryan-s02:9092 –topic test –time -2
- 查看 Log 文件
bin/kafka-run-class.sh kafka.tools.DumpLogSegments
- 查看 Topic 详情
bin/kafka-topics.sh –describe –topic test –zookeeper ryan-s01:2181,ryan-s02:2181,ryan-s03:2181
- 查看消费者组当前消费进度
bin/kafka-consumer-offset-checker.sh –topic test –zookeeper ryan-s01:2181,ryan-s02:2181,ryan-s03:2181 –group test
- 检查消费者offset
bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker
- Dump Jmx 标准输出
bin/kafka-run-class.sh kafka.tools.JmxTool
- Kafka 生产者性能
bin/kafka-run-class.sh kafka.tools.ProducerPerformance
- 更新 Offset
bin/kafka-run-class.sh kafka.tools.UpdateOffsetsInZK
- 手动 rebalance
bin/kafka-run-class.sh kafka.tools.VerifyConsumerRebalance –group test –zookeeper ryan-s01:2181,ryan-s02:2181,ryan-s03:2181