一、环境说明 ip地址 主机名 操作系统版本 RocketMQ版本 JDK版本 maven版本 备注 172.16.7.91 nameserver01 centos 7.6 4.8.0 1.8.0_291 3.6 Name Server集群 172.16.7.92 nameserver03 centos 7.6 4.8.0 1.8.0_291 3.6 Name Serv
一、环境说明
ip地址 主机名 操作系统版本 RocketMQ版本 JDK版本 maven版本 备注 172.16.7.91 nameserver01 centos 7.6 4.8.0 1.8.0_291 3.6 Name Server集群 172.16.7.92 nameserver03 centos 7.6 4.8.0 1.8.0_291 3.6 Name Server集群 172.16.7.93 master01 centos 7.6 4.8.0 1.8.0_291 3.6 Broker集群1 172.16.7.94 slave01 centos 7.6 4.8.0 1.8.0_291 3.6 Broker集群1 172.16.7.95 master02 centos 7.6 4.8.0 1.8.0_291 3.6 Broker集群2 172.16.7.96 slave02 centos 7.6 4.8.0 1.8.0_291 3.6 Broker集群2二、部署概况
三、启动集群
1.启动NameServer
[root@nameserver01 bin]# nohup sh mqnamesrv &
2.启动broker
2.1启动master01
[root@master01 rocketmq]# pwd/rocketmq
[root@master01 rocketmq]# nohup sh bin/mqbroker -c conf/2m-2s-sync/broker-a.properties &
master01节点启动成功
2.2启动slave01
[root@slave01 rocketmq]# pwd/rocketmq
[root@slave01 rocketmq]# nohup sh bin/mqbroker -c conf/2m-2s-sync/broker-a-s.properties &
slave01启动成功
2.3启动master02
[root@master02 rocketmq]# pwd/rocketmq
[root@master02 rocketmq]# nohup sh bin/mqbroker -c conf/2m-2s-sync/broker-b.properties &
master02启动成功
2.4启动slave02
[root@slave02 rocketmq]# pwd/rocketmq
[root@slave02 rocketmq]# nohup sh bin/mqbroker -c conf/2m-2s-sync/broker-b-s.properties &
slave02启动成功
3.启动console
[root@nameserver01 rocketmq-console]# pwd/root/rocketmq-externals-master/rocketmq-console
[root@nameserver01 rocketmq-console]# cd target/
[root@nameserver01 target]# java -jar rocketmq-console-ng-1.0.1.jar
4.登陆console
访问地址:http://172.16.7.91:57690
集群启动正常
四、关闭集群
1.停止console
[root@nameserver01 ~]# ps -ef|grep jar|grep -v grep|awk '{print $2}'|xargs kill -92.停止broker
停止master01
[root@master01 rocketmq]# sh bin/mqshutdown brokerThe mqbroker(9760) is running...
Send shutdown request to mqbroker(9760) OK
停止slave02
[root@slave01 rocketmq]# sh bin/mqshutdown brokerThe mqbroker(9739) is running...
Send shutdown request to mqbroker(9739) OK
[root@slave01 rocketmq]# ps -ef|grep rock
root 11577 9656 0 10:53 pts/0 00:00:00 grep --color=auto rock
[1]+ 退出 143 nohup sh bin/mqbroker -c conf/2m-2s-sync/broker-a-s.properties
master02和slave02的停止方式同上。
3.停止nameserver
[root@nameserver01 rocketmq]# sh bin/mqshutdown namesrvThe mqnamesrv(9746) is running...
Send shutdown request to mqnamesrv(9746) OK
单机版RocketMQ搭建详见:Centos7.6搭建RocketMQ4.8全纪录
集群版RocketMQ搭建详见:RocketMQ4.8集群搭建全纪录