kafka shell命令

1、查看主题命令

./kafka-topics.sh --list --zookeeper  bigdata1:2181,bigdata2:2181,bigdata3:2181

2、模拟生产者生产消息

./kafka-console-producer.sh --broker-list bigdata1:6667,bigdata2:6667,bigdata3:6667 --topic alert

3、模拟消费者消费消息

./kafka-console-consumer.sh --from-beginning --topic alert  --zookeeper bigdata1:2181,bigdata2:2181,bigdata3:2181

原文地址:https://www.cnblogs.com/lansetuerqi/p/13448230.html