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.5\data
# 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:\kafka\logs

 

运行zookeeper命令

zkserver

 

进入cd G:\kafka\bin\windows

 

启动服务:

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

 

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

posted on   Honey_Badger  阅读(335)  评论(0编辑  收藏  举报

编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
github
点击右上角即可分享
微信分享提示