请先关注 [低调大师] 公众号 优秀的自媒体个人博客,低调大师,许军

低调大师

您现在的位置是:首页>文章详情

文章详情

RocketMQ双Master集群搭建

2018-10-10 163热度

机器准备

2台独立的linux主机, 内网IP分别为: 172.31.175.142/143

172.31.175.142 NameServer1、 Broker Master1
172.31.175.143 NameServer2、 Broker Master2

安装配置

安装

下载二进制版本解压即可

wget http://mirrors.hust.edu.cn/apache/rocketmq/4.3.0/rocketmq-all-4.3.0-bin-release.zip unzip rocketmq-all-4.3.0-bin-release.zip -d ~ cd ~ mv rocketmq-all-4.3.0-bin-release rocketmq 

启动NameServer

命令的std输出使用默认的运行日志

mkdir -p ~/logs/rocketmqlogs nohup sh bin/mqnamesrv >~/logs/rocketmqlogs/namesrv.log 2>&1 & tail -100f ~/logs/rocketmqlogs/namesrv.log

配置/启动Broker

1) master1

进入172.31.175.142, 编辑预制的配置文件conf/2m-noslave/broker-a.properties, 追加namesrv地址

namesrvAddr=172.31.175.142:9876;172.31.175.143:9876 brokerClusterName=DefaultCluster brokerName=broker-a brokerId=0 deleteWhen=04 fileReservedTime=48 brokerRole=ASYNC_MASTER flushDiskType=ASYNC_FLUSH

启动broker, 指定配置文件broker-a.properties

nohup sh bin/mqbroker -c ~/rocketmq/conf/2m-noslave/broker-a.properties >~/logs/rocketmqlogs/broker.log 2>&1 & tail -100f ~/logs/rocketmqlogs/broker.log

2) master2

进入172.31.175.143, 编辑预制的配置文件conf/2m-noslave/broker-b.properties, 追加namesrv地址

namesrvAddr=172.31.175.142:9876;172.31.175.143:9876 brokerClusterName=DefaultCluster brokerName=broker-b brokerId=0 deleteWhen=04 fileReservedTime=48 brokerRole=ASYNC_MASTER flushDiskType=ASYNC_FLUSH

启动broker, 指定配置文件broker-b.properties

nohup sh bin/mqbroker -c ~/rocketmq/conf/2m-noslave/broker-b.properties >~/logs/rocketmqlogs/broker.log 2>&1 & tail -100f ~/logs/rocketmqlogs/broker.log

查看集群状态

sh bin/mqadmin clusterlist -n 172.31.175.142:9876;172.31.175.143:9876

双master集群信息如下

#Cluster Name #Broker Name #BID #Addr #Version #InTPS(LOAD) #OutTPS(LOAD) #PCWait(ms) #Hour #SPACE DefaultCluster broker-a 0 172.31.175.142:10911 V4_3_0 0.00(0,0ms) 0.00(0,0ms) 0 427546.59 -1.0000 DefaultCluster broker-b 0 172.31.175.143:10911 V4_3_0 0.00(0,0ms) 0.00(0,0ms) 0 427546.59 -1.0000
收藏 (0)

相关文章

    文章评论

    共有0条评论来说两句吧...