官网地址:https://kafka.apache.org/downloads
本文下载2.1.0版本:https://archive.apache.org/dist/kafka/2.1.0/kafka_2.11-2.1.0.tgz
解压到任意一个文件夹,如图
kafka 目录如下:
使用命令行工具进入该目录:
命令行工具建议使用Cmder
binwindowszookeeper-server-start.bat configzookeeper.properties
Zookeeper的默认端口是2181,如需修改端口可编辑configzookeeper.properties
请先确保Zookeeper启动成功之后,再启动Kafka
binwindowskafka-server-start.bat configserver.properties
Kafka的默认端口是,如需修改端口可编辑configserver.properties
binwindowskafka-console-producer.bat --topic test --broker-list localhost:9092消费数据
binwindowskafka-console-consumer.bat --topic test --bootstrap-server --from-beginning



