服务器准备
10.96.115.40 mq-01 broker-a
10.96.83.21 mq-02 broker-b
10.96.83.21 mq-02 broker-a-s
10.96.115.40 mq-01 broker-b-s
10.96.83.21、10.96.115.40 mq-01、mq-02 nameserver、console
代码准备
采用的是源码编译,
1 | git clone https://github.com/apache/rocketmq.git |
启动nameserver
1 | nohup sh bin/mqnamesrv & |
启动borker
很贴心的为我们准备了配置的模板2m-2s-async、2m-2s-sync、2m-noslave
- 10.96.115.40是broker-a、broker-b-s
- 10.96.83.21是broker-b、broker-a-s
10.96.115.40的操作
broker-a的配置
1 | namesrvAddr=10.96.115.40:9876;10.96.83.21:9876 //所关联的namesrv地址 |
broker-b-s的配置
1 | namesrvAddr=10.96.115.40:9876;10.96.83.21:9876 |
启动broker
1 | cd {workdir}/rocketmq-4.5.2 |
10.96.83.21的操作
broker-b的配置
1 | namesrvAddr=10.96.115.40:9876;10.96.83.21:9876 |
broker-a-s的配置
1 | namesrvAddr=10.96.115.40:9876;10.96.83.21:9876 |
启动broker
1 | cd {workdir}/rocketmq-4.5.2 |
启动rocketmq-console
一个springboot工程
1 | git clone https://github.com/apache/rocketmq-externals.git |
mqadmin常用命令
1 | 查看帮助: |