评论

收藏

[Linux] RocketMQ集群启停手册

服务系统 服务系统 发布于:2021-07-01 19:47 | 阅读数:374 | 评论:0

  
一、环境说明
ip地址主机名操作系统版本RocketMQ版本JDK版本maven版本备注172.16.7.91nameserver01centos 7.64.8.01.8.0_2913.6Name Server集群172.16.7.92nameserver03centos 7.64.8.01.8.0_2913.6Name Server集群172.16.7.93master01centos 7.64.8.01.8.0_2913.6Broker集群1172.16.7.94slave01centos 7.64.8.01.8.0_2913.6Broker集群1172.16.7.95master02centos 7.64.8.01.8.0_2913.6Broker集群2172.16.7.96slave02centos 7.64.8.01.8.0_2913.6Broker集群2
二、部署概况
DSC0000.png

三、启动集群
1.启动NameServer
[root@nameserver01 bin]# nohup sh mqnamesrv &
DSC0001.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 &
DSC0002.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 &
DSC0003.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 &
DSC0004.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 &
DSC0005.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
DSC0006.png
4.登陆console
访问地址:http://172.16.7.91:57690
DSC0007.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 brokerThe mqbroker(9760) is running...Send shutdown request to mqbroker(9760) OK
DSC0008.png
停止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 rockroot      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
DSC0009.png
 
 
单机版RocketMQ搭建详见:Centos7.6搭建RocketMQ4.8全纪录
集群版RocketMQ搭建详见:RocketMQ4.8集群搭建全纪录
 
 

  
关注下面的标签,发现更多相似文章