brew install kafka
注意:
Homebrew 源没有修改的可以先跳过
control + c
vi /usr/local/etc/kafka/server.properties
listeners=PLAINTEXT://localhost:9092
brew services start zookeeper
brew services start kafka
使用单个分区和只有一个副本的方式来创建一个名为“test”的topic
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
kafka-topics --list --zookeeper localhost:2181
通过控制台向“test”topic添加消息
kafka-console-producer --broker-list localhost:9092 --topic test
通过控制台消费“test”topic中的消息
kafka-console-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。