Windows 安装 kafka


1.kafka下载地址:http://kafka.apache.org/downloads

解压:kafka_2.12-2.6.0.tgz

2.配置zookeeper

进入config目录找到文件zookeeper.properties

 

3.配置kafka ,修改日志路径为本地路径

进入config目录找到文件server.properties

 

 4.启动zookeep

D:\kafka_2.12-2.6.0\bin\windows>zookeeper-server-start.bat ..\..\config\zookeeper.properties

 

 5.启动kafka

D:\kafka_2.12-2.6.0\bin\windows>kafka-server-start.bat ..\..\config\server.properties

 

 6.创建Topic

D:\kafka_2.12-2.6.0\bin\windows>kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
Created topic test.

7.查看Topic

D:\kafka_2.12-2.6.0\bin\windows>kafka-topics.bat --list --bootstrap-server localhost:9092

8.启动生产者 producer

D:\kafka_2.12-2.6.0\bin\windows>kafka-console-producer.bat --broker-list localhost:9092 --topic test

9.启动消费者 customer

D:\kafka_2.12-2.6.0\bin\windows>kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-beginning

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM