(03)kafka多机多Broker(集群)的基本配置
本文记录一下kafka多机多Broker(集群)的基本配置,在上篇的基础上进行,上篇配置在192.168.7.151上,本篇在152上。
一、在服务器192.168.7.152上配置两个Broker
1、将151上的kafka远程拷贝到152上
[ local]# scp -r kafka_2.9.2-0.8.1.1/ :/usr/local
2、删除掉logs中的旧文件broker0、broker1,并且新建broker2、broker3
[ logs]# rm -rf broker0 broker1 [ logs]# mkdir broker2 broker3
3、修改config中server.properties和server1.properties为server2.properties和server3.properties
[ config]# mv server.properties server2.properties [ config]# mv server1.properties server3.properties
4、修改server2.properties和server3.properties的配置信息
[ config]# vim server2.properties
broker.id=2 log.dirs=/usr/local/kafka_2.9.2-0.8.1.1/logs/broker2
[ config]# vim server3.properties
broker.id=3 log.dirs=/usr/local/kafka_2.9.2-0.8.1.1/logs/broker3
5、启动两个broker
[ kafka_2.9.2-0.8.1.1]# bin/kafka-server-start.sh config/server2.properties & [ kafka_2.9.2-0.8.1.1]# bin/kafka-server-start.sh config/server3.properties &
6、用jps命令查看,已经启动成功!
二、查看集群是否已经注册到zookeeper中
1、连接zookeeper的任意客户端
[ kafka_2.9.2-0.8.1.1]# zkCli.sh
2、查看到成功注册了4个broker,id分别是0、1、2、3
相关推荐
Kafka 2020-09-18
guicaizhou 2020-09-15
jiangkai00 2020-07-18
CobingLiu 2020-06-16
yangyutong00 2020-06-12
sweetgirl0 2020-06-09
yanghuashuiyue 2020-11-14
liuxingen 2020-11-13
wangying 2020-11-13
王谦 2020-11-03
huangwei00 2020-10-14
shenzhenzsw 2020-10-09
guicaizhou 2020-09-30
jiaomrswang 2020-09-23
jyj0 2020-09-21
hannuotayouxi 2020-08-20
amwayy 2020-08-03
yangyutong00 2020-08-01