当前位置 : 主页 > 操作系统 > centos >

RocketMQ集群启停手册

来源:互联网 收集:自由互联 发布时间:2022-06-20
一、环境说明 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

二、部署概况

RocketMQ集群启停手册_broker

三、启动集群

1.启动NameServer

[root@nameserver01 bin]# nohup sh mqnamesrv &

RocketMQ集群启停手册_rocketmq_02

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 &

RocketMQ集群启停手册_broker_03

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 &

RocketMQ集群启停手册_broker_04

slave01启动成功

2.3启动master02

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

RocketMQ集群启停手册_rocketmq_05

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 &

RocketMQ集群启停手册_nameserver_06

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

RocketMQ集群启停手册_rocketmq_07

4.登陆console

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

RocketMQ集群启停手册_rocketmq_08

 

集群启动正常

四、关闭集群

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

RocketMQ集群启停手册_broker_09

停止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

RocketMQ集群启停手册_rocketmq_10

 

 

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

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

 

 

网友评论