美文网首页
Mac安装测试kafka

Mac安装测试kafka

作者: 0_cc | 来源:发表于2017-08-03 18:14 被阅读0次

1、安装kafka

brew install kafka

2、启动zookeeper

zkServer start

3、启动kafka

brew services restart kafka

4、创建topic

kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testTopic

5、产生数据

kafka-console-producer.sh --broker-list localhost:9092 --topic testTopic

输入数据:

hello

aaaaaaa

test

!!!!!

6、消费数据

新建一个终端:

kafka-console-consumer.sh --zookeeper localhost:2181 --topic testTopic --from-beginning

相关文章

网友评论

      本文标题:Mac安装测试kafka

      本文链接:https://www.haomeiwen.com/subject/geaplxtx.html