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

 

posted @ 2020-08-19 15:09  lappple  阅读(5778)  评论(1编辑  收藏  举报