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