kafka常用shell命令
#创建topic
./kafka-topics.sh --zookeeper master:2181,slave1:2181,slave2:2181 --create --topic test-topic --partitions 3 --replication-factor 3
#查看topic详情
./kafka-topics.sh --zookeeper master:2181,slave1:2181,slave2:2181 --describe --topic test-topic
#删除topic
./kafka-topics.sh --zookeeper master:2181,slave1:2181,slave2:2181 --delete --topic test-topic
#查看topic列表
./kafka-topics.sh --zookeeper master:2181,slave1:2181,slave2:2881 --list
#生产消息到主题
./kafka-console-producer.sh --broker-list master:9092,slave1:9092,slave:9092 --topic test
#消费主题消息
./kafka-console-consumer.sh --bootstrap-server master:9092,slave1:9092,slave2:9092 --topic test --from-beginning