rocketmq(V4_5_0)同步双主双备集群部署

没有创新记录自己搭建过程遇到的问题

环境:四个节点
192.168.25.10、192.168.25.13、192.168.25.14、192.168.25.15
namesrv: 192.168.25.10、192.168.25.13同时他们也是master节点
broker : 192.168.25.10、192.168.25.13、192.168.25.14、192.168.25.15
注意事项:
1、启动先启动两台namesrv 后启动四台broker 我是按照 主 主 从 从 启动
2、`把checkpoint、abort等文件建成文件夹,导致一致部署失败,
在这里插入图片描述

最后找到原因是提前创建的文件夹导致的,因为应该是个文件,commitlog是文件夹`
rocketmq(V4_5_0)同步双主双备集群部署_第1张图片
rocketmq(V4_5_0)同步双主双备集群部署_第2张图片

3、启动命令
1、nohup sh mqnamesrv &
2、nohup sh mqbroker -c /home/czx/rocketmq/rocketmq-all-4.5.0-bin-release/conf/2m-2s-sync/broker-*.properties >/dev/null 2>&1 &( * 要替换成对应的配置文件)
4、配置(看自己机器配置)

    runserver.sh 
   JAVA_OPT="${JAVA_OPT} -server -Xms128m -Xmx256m -Xmn200m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m"
   
   runbroker.sh
   JAVA_OPT="${JAVA_OPT} -server -Xms128m -Xmx256m -Xmn200m"
   
   tools.sh
   JAVA_OPT="${JAVA_OPT} -server -Xms128m -Xmx256m -Xmn200m -XX:PermSize=128m -XX:MaxPermSize=128m"

4、控制台启动命令
java -jar rocketmq-console-ng-1.0.1.jar --server.port=12581 --rocketmq.config.namesrvAddr=192.168.25.10:9876;192.168.25.13:9876
rocketmq(V4_5_0)同步双主双备集群部署_第3张图片

eg:我的四个配置:

broker -a master

namesrvAddr = 192.168.25.10:9876;192.168.25.13:9876
#namesrvAddr = 192.168.25.10:9876
brokerClusterName=DefaultCluster
brokerName=broker-a
brokerId=0
deleteWhen=04
fileReservedTime=48
brokerRole=SYNC_MASTER
flushDiskType=ASYNC_FLUSH
storePathRootDir=/home/czx/rocketmq/store
storePathCommitLog=/home/czx/rocketmq/store/commitlog

broker -b master
namesrvAddr = 192.168.25.10:9876;192.168.25.13:9876
brokerClusterName=DefaultCluster
brokerName=broker-b
brokerId=0
deleteWhen=04
fileReservedTime=48
brokerRole=SYNC_MASTER
flushDiskType=ASYNC_FLUSH
storePathRootDir=/home/czx/rocketmq/store
storePathCommitLog=/home/czx/rocketmq/store/commitlog

broker -a slave
namesrvAddr = 192.168.25.10:9876;192.168.25.13:9876
brokerClusterName=DefaultCluster
brokerName=broker-a
brokerId=1
deleteWhen=04
fileReservedTime=48
brokerRole=SLAVE
flushDiskType=ASYNC_FLUSH
storePathRootDir=/home/czx/rocketmq/store
storePathCommitLog=/home/czx/rocketmq/store/commitlog

broker -b slave
namesrvAddr = 192.168.25.10:9876;192.168.25.13:9876
brokerClusterName=DefaultCluster
brokerName=broker-b
brokerId=1
deleteWhen=04
fileReservedTime=48
brokerRole=SLAVE
flushDiskType=ASYNC_FLUSH
storePathRootDir=/home/czx/rocketmq/store
storePathCommitLog=/home/czx/rocketmq/store/commitlog

你可能感兴趣的:(中间件)