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