准备
- 安装JDK
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
- 下载kafka_2.12-2.1.1
http://kafka.apache.org/downloads
https://archive.apache.org/dist/kafka/2.2.1/kafka_2.12-2.2.1.tgz
- 解压kafka_2.12-2.2.1.tgz
- 设置KAFKA_HOME的路径并把它添加到PATH里
配置
- 修改KAFKA_HOME/config/server.properties
# A comma separated list of directories under which to store log files
log.dirs=D:/log/kafka
- 修改KAFKA_HOME/config/zookeeper.properties
# the directory where the snapshot is stored.
dataDir=D:/log/zookeeper
启动
- 进入KAFKA_HOME/