三台服务器分别是
192.168.126.128
192.168.126.129
192.168.126.130
然后在三台服务器分别安装kafka
下载
wget http://mirrors.hust.edu.cn/apache/kafka/2.5.0/kafka_2.13-2.5.0.tgz
解压到user/local下
mv /usr/local/kafka_2.13-2.5.0 /usr/local/kafka
修改配置文件
vim /usr/local/kafka/server.properties
配置zk地址
zookeeper.connect=192.168.126.128:2181,192.168.126.129:2181,192.168.126.130:2181
分别配置三台的broker.id
broker.id=0
broker.id=1
broker.id=2
分别配置三台的listeners
listeners=PLAINTEXT://192.168.126.128:9092
listeners=PLAINTEXT://192.168.126.129:9092
listeners=PLAINTEXT://192.168.126.130:9092
配置环境变量
vim /etc/profile
export KAFKA_HOME=/usr/local/kafka/
PATH=${KAFKA_HOME}/bin:$PATH
强制生效
source /etc/profile
启动kafka
kafka-server-start.sh -daemon /usr/local/kafka//config/server.properties
原文:https://gper.club/articles/7e7e7f7ff4g5agc1g64