Springboot 与 Kafka 版本对应关系:https://spring.io/projects/spring-kafka
一、下载 kakfa 安装包
http://kafka.apache.org/downloads
二、解压安装包
cd /usr/local
tar -zxf kafka_2.12-2.5.0.tgz
三、修改配置文件
zookeeper 配置文件:
/kafka_2.12-2.5.0/config/zookeeper.properties
kafka 配置文件:
/kafka_2.12-2.5.0/config/server.properties
server.properties:
############################# Server Basics #############################
# The id of the broker. This must be set to a unique integer for each broker.
broker.id=0
# The address the socket server listens on. It will get the value returned from
# java.net.InetAddress.getCanonicalHostName() if not configured.
# FORMAT:
# listeners = listener_name://host_name:port
# EXAMPLE:
# listeners = PLAINTEXT://your.host.name:9092
listeners=PLAINTEXT://localhost:9092
四、启动 zookeeper
/usr/local/kafka_2.12-2.5.0/bin/zookeeper-server-start.sh /usr/local/kafka_2.12-2.5.0/config/zookeeper.properties
五、启动 kafka
/usr/local/kafka_2.12-2.5.0/bin/kafka-server-start.sh /usr/local/kafka_2.12-2.5.0/config/server.properties