kafka单机多Broker的基本配置

本文记录一下kafka单机多Broker的基本配置步骤

参考资料:安装单机版kafka

1、复制出一份单机配置好的kafka目录

[root@localhost myroom]# cp -r kafka_2.11-2.1.1/ kafka_2.11-2.1.1_mutibroker/

2、复制出配置文件server1.properties、server2.properties(不再使用server.properties)

[root@localhost config]# cp server.properties server1.properties
[root@localhost config]# cp server.properties server2.properties
[root@localhost config]# rm -rf server.properties

3、修改两个配置文件的信息

  1)创建日志存放目录

[root@localhost logs]# mkdir /usr/local/myroom/kafka_2.11-2.1.1_mutibroker/logs/broker1
[root@localhost logs]# mkdir /usr/local/myroom/kafka_2.11-2.1.1_mutibroker/logs/broker2

  2)修改配置文件server1.properties

[root@localhost config]# vi /usr/local/myroom/kafka_2.11-2.1.1_mutibroker/config/server1.properties
broker.id=1
listeners=PLAINTEXT://192.168.23.111:9093
advertised.listeners=PLAINTEXT://192.168.23.111:9093
log.dirs=/usr/local/myroom/kafka_2.11-2.1.1_mutibroker/logs/broker1

  3)修改配置文件server2.properties

[root@localhost config]# vi /usr/local/myroom/kafka_2.11-2.1.1_mutibroker/config/server2.properties
broker.id=2
listeners=PLAINTEXT://192.168.23.111:9094
advertised.listeners=PLAINTEXT://192.168.23.111:9094
log.dirs=/usr/local/myroom/kafka_2.11-2.1.1_mutibroker/logs/broker2

4、启动服务


[root@localhost kafka_2.11-2.1.1_mutibroker]# bin/kafka-server-start.sh config/server1.properties &

[root@localhost kafka_2.11-2.1.1_mutibroker]# bin/kafka-server-start.sh config/server2.properties &

5、用jps命令查看启动成功!

 

posted @ 2020-01-12 15:44  雷雨客  阅读(689)  评论(0编辑  收藏  举报