装修中...
Kafka
新建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
Zookeeper
时间: 2024-10-09 21:32:52