1:下载zookeeper-3.3.6.tar.gz
2: 解压压缩文件到D:\zookeeper\zookeeper-3.3.6
3: 在D:\zookeeper\zookeeper-3.3.6的文件夹下创建data目录
4:更改D:\zookeeper\zookeeper-3.3.6\conf下的cfg文件名为zoo.cfg
5:打开zoo.cfg文件,修改datadir路径为dataDir=D:\zookeeper\zookeeper-3.3.6\data(记得一定要时\哟,否则会报错的)用于存放日志
6:进入到D:\zookeeper\zookeeper-3.3.6\bin目录下双击zkServer.cmd启动zookeeper服务
7:在D:\zookeeper\zookeeper-3.3.6\bin目录下双击zkCli.md启动zookeeper客户端
(如果看到localhost:2181代表启动成功)
8:下载kafka_2.10-0.8.2.0.tar.gz
9:解压缩到D:\kafka\kafka_2.10-0.8.2.0
10:创建tmp文件夹
11:进入到D:\kafka\kafka_2.10-0.8.2.0\config里面修改server.properties里datadir目录
为log.dirs=D:\kafka\kafka_2.10-0.8.2.0\tmp\kafka-logs(一定要为\斜杠哟)
12:使用cmd命令进入到D:\kafka\kafka_2.10-0.8.2.0下输入.\bin\windows\kafka-server-start.sh .\config\server.properties启动kafka
13:使用cmd命令进入到D:\kafka\kafka_2.10-0.8.2.0下输入.\bin\windows\kafka-topics.bat –create –zookeeper localhost:2181 –replication-factor 1 –partitions 1 –topic test
创建topic
14:再开一个cmd窗口,创建生产者,进入到D:\kafka\kafka_2.10-0.8.2.0下输入.\bin\windows\kafka-console-producer.bat –broker-list localhost:9092 –topic test
15:再开一个cmd窗口,创建生产者,进入到D:\kafka\kafka_2.10-0.8.2.0下输入.\bin\windows\kafka-console-consumer.bat –zookeeper localhost:2181 –topic test
16:生产者发送消息,消费者接收到消息
windows下的Kafka的安装及测试
最新推荐文章于 2024-09-18 10:31:28 发布