码迷,mamicode.com
首页 > 其他好文 > 详细

kafka命令

时间:2017-08-16 17:30:40      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:broker   start   cer   cat   server   oca   start.s   other   creat   

1.启动zookeeper
bin/zookeeper-server-start.sh &

2.启动kafka
nohup bin/kafka-server-start.sh config/server.properties &
 
3.创建topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
4.查看topic
bin/kafka-topics.sh --list --zookeeper localhost:2181
test
5.发送消息
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test 
This is a messageThis is another message
6.查看消息
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
 
 

kafka命令

标签:broker   start   cer   cat   server   oca   start.s   other   creat   

原文地址:http://www.cnblogs.com/nicebaby/p/7373497.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!