rocketmq热迁移步骤

rocketmq迁移步骤(从centos主机192.168.100.111 192.168.100.115迁移到openeuler主机192.168.110.14 192.168.110.15)

1、停掉192.168.100.111上的broker-a,命令:cd /home/test/rocketmq/bin ; sh mqshutdown broker

2、将broker-a的logs目录store目录(家目录下以及rocketmq目录下)拷贝到192.168.110.14,在152.14上启动新的nameserver以及broker-a(配置4个nameserver地址),端口与原机器保持一致

命令:在192.168.110.14执行rsync -avP test@192.168.100.111:/home/test/store .

cd rocketmq rsync -avP test@192.168.100.111:/home/test/rocketmq/store .

修改broker-a.properties的nameserver地址为192.168.100.111:30011;192.168.100.115:30011;192.168.110.14:30011;192.168.110.15:30011;

启动nameserver以及broker-a

命令:cd rocketmq/bin && sh nohup sh mqnamesrv -c …/conf/mqnamesrv.properties >./nohup-mqnamesrv.log 2>&1 &

nohup sh mqbroker -c …/conf/2m-noslave/broker-b.properties >nohup-mqbroker.log 2>&1 &

3、检查新的broker是否加入集群,以及broker地址是否正确,是否有请过到该broker

命令:sh bin/mqadmin clusterList -n 192.168.100.111:30011

在192.168.110.14 执行netstat -antp |grep 30014 (30014为broker地址)

4、停掉192.168.100.115上的broker-b,命令:cd /home/test/rocketmq/bin ; sh mqshutdown broker

5、将broker-b的logs目录store目录(家目录下以及rocketmq目录下)拷贝到192.168.110.15,在152.15上启动新的nameserver以及broker-a(配置4个nameserver地址),端口与原机器保持一致

命令:在192.168.110.15执行rsync -avP test@192.168.100.115:/home/test/store .

cd rocketmq rsync -avP test@192.168.100.115:/home/test/rocketmq/store .

修改broker-a.properties的nameserver地址为192.168.100.111:30011;192.168.100.115:30011;192.168.110.14:30011;192.168.110.15:30011;

启动nameserver以及broker-b

命令:cd rocketmq/bin && sh nohup sh mqnamesrv -c …/conf/mqnamesrv.properties >./nohup-mqnamesrv.log 2>&1 &

nohup sh mqbroker -c …/conf/2m-noslave/broker-b.properties >nohup-mqbroker.log 2>&1 &

6、检查新的broker是否加入集群,以及broker地址是否正确,是否有请过到该broker

命令:sh bin/mqadmin clusterList -n 192.168.100.111:30011

在192.168.110.15 执行netstat -antp |grep 30014 (30014为broker地址)

7、修改DNS中roceetmq指向为192.168.110.14 192.168.110.15

8、逐个重启192.168.100.111 192.168.100.115的nameserver,然后用netstat命令查看是否有请求连接到该nameserver

sh bin/mqadmin clusterList -n 192.168.100.160:28881

sh bin/mqadmin consumerProgress -n 192.168.100.160:28881 -g CONSUMER_TEST_GROUP