bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test6 --from-beginning
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic6 my-replicated-topic
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic6
①创建主题
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test6
②查看 主题列表
bin/kafka-topics.sh --list --zookeeper localhost:2181
③发送消息
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test6
④消费消息
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test6 --from-beginning