先关闭kafka集群
/home/kafka.sh stop
kafka集群启停脚本
https://blog.csdn.net/weixin_44371237/article/details/127102413
再关闭zk集群
/home/zk.sh stop
zookeeper集群启停脚本
https://blog.csdn.net/weixin_44371237/article/details/127102471
关闭kafka-eagle
/opt/module/efak/bin/ke.sh stop
再解压一份kafka
tar -zxf kafka_2.12-3.0.0.tgz -C /opt/module/
重命名
mv kafka_2.12-3.0.0/ kafka2
vim kafka2/config/kraft/server.properties
修改
controller.quorum.voters=1@localhost:9093
为
controller.quorum.voters=1@hadoop100:9093,2@hadoop101:9093,3@hadoop102:9093
修改
advertised.listeners=PLAINTEXT://localhost:9092
为
advertised.listeners=PLAINTEXT://hadoop100:9092
修改
log.dirs=/tmp/kraft-combined-logs
为
log.dirs=/opt/module/kafka2/data
分发到其他服务器
/home/xsync /opt/module/kafka2
分发脚本 https://blog.csdn.net/weixin_44371237/article/details/127102600
进入第2台机器
vim kafka2/config/kraft/server.properties
修改node.id=1为node.id=2
修改advertised.listeners=PLAINTEXT://hadoop100:9092
为advertised.listeners=PLAINTEXT://hadoop101:9092
进入第3台机器
vim kafka2/config/kraft/server.properties
修改node.id=1为node.id=3
修改advertised.listeners=PLAINTEXT://hadoop100:9092
为advertised.listeners=PLAINTEXT://hadoop102:9092
先生成存储目录唯一 ID
bin/kafka-storage.sh random-uuid
用该 ID 格式化每一台服务器 kafka存储目录,
bin/kafka-storage.sh format -t cUqGyr2IR-ylXTFxKRYOrw -c /opt/module/kafka2/config/kraft/server.properties
bin/kafka-server-start.sh -daemon config/kraft/server.properties