1. 创建Topic
bin/kafka-topics.sh --create --zookeeper centos2:2181 --replication-factor 1 --partitions 1 --topic kafkademo
可以通过list命令查看创建的topic:
bin/kafka-topics.sh --list --zookeeper centos2:2181
另一个查看topic的命令(截图见集群模式)
bin/kafka-topics.sh --describe --zookeeper centos2