Rocket 3节点集群
Rocket 3节点集群
1、组网图
2、namesrv
2.1 配置
rocketmq-4.2.0/conf , 配置namesrv.conf
listenPort= 9876
2.2 启动命令
后台启动
sh /home/middleware/rocketmq-4.2.0/bin/mqnamesrv -c /home/middleware/rocketmq-4.2.0/conf/namesrv.conf &
3、broker
3.1 配置
broker无论主从都需要配置namesrv地址
namesrvAddr = 192.168.0.101:9876;192.168.0.102:9876;192.168.0.103:9876
3.1.1 主节点单独放在/home/middleware/rocketmq-4.2.0目录 , 以broker-a为例,在 conf/broker.conf文件中
按照组网图,broker-a应该部署在192.168.0.101
brokerClusterName = Test-Cluster
brokerName = broker-a
brokerId = 0 #主节点都配置为0
deleteWhen = 04
fileReservedTime = 720
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
namesrvAddr = 192.168.0.101:9876;192.168.0.102:9876;192.168.0.103:9876
listenPort = 10911
autoCreateTopicEbable = false
storePathRootDir = /home/middleware/rocketmq-4.2.0/data
storePathCommitLog = /home/middleware/rocketmq-4.2.0/log
messageDelayLevel = 1s 5s 10s 30s 1m 2m 3m
3.1.2 从节点单独放在/home/middleware/rocketmq-4.2.0-slave目录,
按照组网图,broker-a-slave应该部署在192.168.0.102
brokerClusterName = Test-Cluster
brokerName = broker-a
brokerId = 10 #从节点要大于0
deleteWhen = 04
fileReservedTime = 720
brokerRole = SLAVE
flushDiskType = ASYNC_FLUSH
namesrvAddr = 192.168.0.101:9876;192.168.0.102:9876;192.168.0.103:9876
listenPort = 10911
autoCreateTopicEbable = false
storePathRootDir = /home/middleware/rocketmq-4.2.0-slave/data
storePathCommitLog = /home/middleware/rocketmq-4.2.0-slave/log
messageDelayLevel = 1s 5s 10s 30s 1m 2m 3m
3.2 启动命令
3.2.1 主节点启动命令(后台启动)
sh /home/middleware/rocketmq-4.2.0/bin/runbroker.sh -c /home/middleware/rocketmq-4.2.0/conf/broker.conf &
3.2.2 从节点启动命令(后台启动)
sh /home/middleware/rocketmq-4.2.0-slave/bin/runbroker.sh -c /home/middleware/rocketmq-4.2.0/conf/broker.conf &
4、Rocketmq_admin
rocketmq_admin config/application.properties文件
server.port=8080
rocketmq.config.namesrvAddr=192.168.0.101:9876;192.168.0.102:9876;192.168.0.103:9876
rocketmq.config.dataPath=/home/middleware/rocketmq_admin/data
其他默认就行了,启动就是一个tomcat的启动
/home/middleware/rocketmq_admin/bin/startup.sh
通过admin工具可以方便的管理topic,查看topic 消息等等