其他分享
首页 > 其他分享> > RocketMQ集群启停手册

RocketMQ集群启停手册

作者:互联网

一、环境说明

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

二、部署概况

4a88e856ea4acb20eeac7604bb74ab3d.png

三、启动集群

1.启动NameServer

[root@nameserver01 bin]# nohup sh mqnamesrv &

14eb8a4f73ae81caa318d2b2477dbe22.png

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 &

86d3ea7df74292c6f8b64fde21130f6f.png

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 &

be9cb4949590282abae999941fa38412.png

slave01启动成功

2.3启动master02

[root@master02 rocketmq]# pwd
/rocketmq
[root@master02 rocketmq]# nohup sh bin/mqbroker -c conf/2m-2s-sync/broker-b.properties &

1fbcc5dd0ed198aa1b66c9f27b25c606.png

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 &

504e88bac84e602ecf13787fce28417d.png

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

f8b4e6ffa95c030e5162450d8e7fa840.png

4.登陆console

访问地址:http://172.16.7.91:57690

196e251401f92a01b194d89b373fb63f.png

 

集群启动正常

四、关闭集群

1.停止console

[root@nameserver01 ~]# ps -ef|grep jar|grep -v grep|awk '{print $2}'|xargs kill -9 

2.停止broker

停止master01

[root@master01 rocketmq]# sh bin/mqshutdown broker
The mqbroker(9760) is running...
Send shutdown request to mqbroker(9760) OK

498f452f22d077ad574537f6a5c7ac74.png

停止slave02

[root@slave01 rocketmq]# sh bin/mqshutdown broker
The 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 namesrv
The mqnamesrv(9746) is running...
Send shutdown request to mqnamesrv(9746) OK

07e4a9e0df389cd6edcc7808bf785d4d.png

 

 

单机版RocketMQ搭建详见:Centos7.6搭建RocketMQ4.8全纪录

集群版RocketMQ搭建详见:RocketMQ4.8集群搭建全纪录

 

 

标签:bin,sh,手册,启停,集群,RocketMQ,root,rocketmq,mqbroker
来源: https://blog.51cto.com/u_3241766/2965870