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