一、本地简单搭建kafka
1.1官网下载压缩包并解压
网址:添加链接描述
我这里下载的2.8.1版本
然后解压到指定文件夹,并创建两个文件夹以后使用
1.2修改配置文件
1.config下的zookeeper.properties,修改为刚才创建data的真实路径
2.config下的server.properties,修改为刚才创建kafka-log的真实路径
1.3启动
1.启动zookeeper
到解压文件夹下执行:不要关闭窗口
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
2.启动kafka
到解压文件夹下执行:不要关闭窗口
.\bin\windows\kafka-server-start.bat .\config\server.properties
3.创建一个为test的topic
不要关闭窗口
.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 -