【Kafka】操作命令

生产者

./kafka-console-producer.sh --broker-list 192.168.186.29:9092 --topic norm

消费者

./kafka-console-consumer.sh --zookeeper 192.168.186.29:2181 --from-beginning --topic norm 

查询topic的offset

offset最小值

bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 192.168.186.29:9092 -topic norm --time -2

offset最大值

bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list slave6:9092 -topic videoplay --time -1

可以查询出offset的范围

原文地址:https://www.cnblogs.com/Dhouse/p/7614141.html