一、下载kafka
官网下载地址
http://kafka.apache.org/downloads
二、配置
修改/config/server.properties
listeners=PLAINTEXT://127.0.0.1:9092
advertised.listeners=PLAINTEXT://127.0.0.1:9092
修改/config/zookeeper.properties
dataDir=(实际可达路径)
clientPort=2181
三、启动Zookeeper
使用cmd,进入目录D:kafka_2.13-2.6.0binwindows
>zookeeper-server-start.bat /config/zookeeper.properties
四、启动Kafka
使用cmd,进入目录D:kafka_2.13-2.6.0binwindows
>kafka-server-start.bat /config/server.properties
五、常用命令
创建一个主题
kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions