采用的是2m-2s-async模式

1.  修改每台机器的/etc/hosts  文件,增加如下内容

192.168.1.100 nameserver1
192.168.1.102 nameserver2
192.168.1.103 nameserver3
192.168.1.104 nameserver4
192.168.1.100 master1
192.168.1.101 master2
192.168.1.102 slave1
192.168.1.103 slave2

2. 下载bin压缩包: http://mirrors.tuna.tsinghua.edu.cn/apache/rocketmq/4.2.0/rocketmq-all-4.2.0-bin-release.zip

然后解压到某个目录, 比如: /data/rocketmq-4.2.0/

2.1 修改 192.168.1.100(master1)下的文件:/data/rocketmq-4.2.0/conf/2m-2s-async/broker-a.properties

vim /data/rocketmq-4.2.0/conf/2m-2s-async/broker-a.properties

增加如下内容:

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
brokerClusterName=EaglehornCluster
brokerName=broker-a
brokerId=0
namesrvAddr=nameserver1:9876;nameserver2:9876;nameserver3:9876;nameserver4:9876
autoCreateTopicEnable=true
autoCreateSubscriptionGroup=true
listenPort=10911
deleteWhen=04
fileReservedTime=48
brokerRole=ASYNC_MASTER
flushDiskType=ASYNC_FLUSH
storePathRootDir=/data/rocketmq-4.2.0/store
storePathCommitLog=/data/rocketmq-4.2.0/store/commitlog
#消费队列存储路径存储路径
storePathConsumeQueue=/data/rocketmq-4.2.0/store/consumequeue
#消息索引存储路径
storePathIndex=/data/rocketmq-4.2.0/store/index

2.2  修改 192.168.1.101(master2)下的文件:/data/rocketmq-4.2.0/conf/2m-2s-async/broker-b.properties

内容同2.1,只是

brokerName=broker-b

2.3 修改 192.168.1.102(slave1)下的文件:/data/rocketmq-4.2.0/conf/2m-2s-async/broker-a-s.properties

内容同2.1,只是

brokerId=1

2.4 修改 192.168.1.103(slave2)下的文件:/data/rocketmq-4.2.0/conf/2m-2s-async/broker-b-s.properties

内容同2.3,只是

brokerId=1

3. 启动nameserver

登录四台服务器,执行如下启动命令

cd /data/rocketmq-4.2.0/bin

nohup sh mqnamesrv &

4. 启动broker

最新文章

  1. Linux下的几个好用的命令与参数
  2. Amazon EC2免费VPS防止超额被扣钱三大方法:流量 硬盘读写 运行时长
  3. ae开发基础功能
  4. Android jni开发中的常见错误
  5. Java for LeetCode 169 Majority Element
  6. HashMap的原理与实 无锁队列的实现Java HashMap的死循环 red black tree
  7. Python脚本控制的WebDriver 常用操作 <九> 定位一组对象
  8. ORACLE常用脚本示例
  9. system2之:4-LVM逻辑卷管理
  10. [Oracle] 参数修改小结
  11. MongoDB 集合间关联查询后通过$filter进行筛选
  12. Java中使用到的锁
  13. Webpack代理proxy配置,解决本地跨域调试问题,同时允许绑定host域名调试
  14. python中的关键字符
  15. POJ 3384 Feng Shui (半平面交)
  16. c++多线程在异常环境下的等待
  17. C++工程文件夹中的bin和obj文件夹有何用处?(补充多文件结构)
  18. taotao用户登录(及登录成功后的回调url处理)
  19. KeyStore相关
  20. struts2.Action中的method属性配置

热门文章

  1. React-propsType和defaultProps
  2. vuex的使用步骤
  3. centos7之zabbix3.2搭建
  4. SpringMVC DispatcherServlet在配置Rest url-pattern的一点技巧
  5. LIS的O(nlogn)算法
  6. java垃圾回收GC
  7. Civil 3D .NET二次开发第11章代码升级至2018版注意事项
  8. java 将保单数据 生成图片
  9. I2C 总线原理与架构
  10. codeforces-1141 (div3)