【kafka】【zookeeper】【windows】简单环境搭建及启动
本文环境kafka_2.11-2.1.1、zookeeper-3.4.6、jdk8
1、下载zookeeper官网下载:https://archive.apache.org/dist/zookeeper/
下载kafka官网下载:https://archive.apache.org/dist/kafka/
2、修改zookeeper配置文件,复制一份zoo_sample.cfg修改为zoo.cfg
3、启动zookeeper,运行D:\IT_Software\kafka_test\zookeeper-3.4.6\bin\zkServer.cmd
4、创建目录D:\IT_Software\kafka_test\kafka\kafka-logs,D:\IT_Software\kafka_test\kafka\kafka_2.11-2.1.1\config\server.properties的log.dirs修改为刚刚的文件夹
5、运行kafka,到D:\IT_Software\kafka_test\kafka\kafka_2.11-2.1.1目录执行命令.\bin\windows\kafka-server-start.bat .\config\server.properties
6、启动生产者,进入D:\IT_Software\kafka_test\kafka\kafka_2.11-2.1.1\bin\windows目录运行命令kafka-console-producer.bat --broker-list localhost:9092 --topic helloKafka
7、启动消费者,同样进入D:\IT_Software\kafka_test\kafka\kafka_2.11-2.1.1\bin\windows目录运行命令kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic helloKafka
8、生成者生产消息,消费者消费信息
参考文章:https://blog.csdn.net/zhangbeizhen18/article/details/101323691
https://blog.csdn.net/yuzhiqiang_1/article/details/101783754