标签:
装修中...
新建Topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic my-topic
查看已存在Topic列表
bin/kafka-topics.sh --list --zookeeper localhost:2181
查看指定Topic状态
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic my-topic
启动Consumer读取消息并输出到标准输出
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic my-topic --from-beginning
运行Producer并将Terminal输入的消息发送到服务端
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic my-topic << This is a messageThis is another message
标签:
原文地址:http://www.cnblogs.com/rilley/p/5438188.html