配置修改

kafka_2.13-3.4.0\config下面

zookeeper.properties

clientPort=2181
maxClientCnxns=0
admin.enableServer=true
admin.enable=true
audit.enable=true
dataDir=E:/kafka_2.13-3.4.0/zookeeper_data
dataLogDir=E:/kafka_2.13-3.4.0/zookeeper_log

server.properties

log.dirs=E:/kafka_2.13-3.4.0/logs
zookeeper.connect=localhost:2181

启动Zookeeper

.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

kafka启动_启动服务

kafka启动_bootstrap_02

启动服务

.\bin\windows\kafka-server-start.bat .\config\server.properties

kafka启动_bootstrap_03

kafka启动_bootstrap_04

启动生产者

.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic user

启动消防者监听消息

.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic user

kafka启动_bootstrap_05