kafka cmd首个单机例子配置 - Go语言中文社区

kafka cmd首个单机例子配置


下载地址:http://kafka.apache.org/downloads       http://mirror.bit.edu.cn/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz

 

zookeeper.properties修改dataDir

dataDir=G:zookeeper-3.5.5data
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=0

server.properties修改log.dirs

############################# Log Basics #############################

# A comma separated list of directories under which to store log files
log.dirs=G:kafkalogs

 

运行zookeeper命令

zkserver

 

进入cd G:kafkabinwindows

 

启动服务:

kafka-server-start.bat ../../config/server.properties

创建实例

kafka-topics.bat --create --zookeeper localhost:2181 --repl
ication-factor 1 --partitions 1 --topic testDemo

 

生产者

kafka-console-producer.bat --broker-list localhost:9092 --t
opic testDemo

 

 

消费者

kafka-console-consumer.bat --bootstrap-server localhost:909
2 --topic testDemo --from-beginning

 

在生产者里输入内容,消费者就打印出相应内容

版权声明:本文来源博客园,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://www.cnblogs.com/tk55/p/11409038.html
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2019-11-16 22:53:01
  • 阅读 ( 1760 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢