线上场景一之RocketMQ消费异常

回放

RocketMQ配置方式为2m-noslave模式,当$宕机后,导致消息虽然发送至MQ内,就是不能够消费。

替代变量

MQ节点一地址:${Mq_Addr_1}  
MQ节点二地址:${Mq_Addr_2}
MQ集群名称:${Mq_Cluster_Name}

broker-a.properties

namesrvAddr=${Mq_Addr_1}:9876;${Mq_Addr_2}:9876
brokerIP1=${Mq_Addr_1}
brokerName=${Mq_Addr_1}
brokerClusterName=${Mq_Cluster_Name}
brokerId=0
autoCreateTopicEnable=false
autoCreateSubscriptionGroup=true
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
storePathRootDir=/usr/local/alibaba-rocketmq/store
storePathCommitLog=/usr/local/alibaba-rocketmq/store/commitlog
flushIntervalCommitLog=1000
flushCommitLogTimed=false
deleteWhen=04
fileReservedTime=72
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
messageIndexSafe=false
haMasterAddress=
brokerRole=ASYNC_MASTER
flushDiskType=ASYNC_FLUSH
cleanFileForciblyEnable=true

broker-b.properties

namesrvAddr=${Mq_Addr_1}:9876;${Mq_Addr_2}:9876
brokerIP1=${Mq_Addr_2}
brokerName=${Mq_Addr_2}
brokerClusterName=${Mq_Cluster_Name}
brokerId=0
autoCreateTopicEnable=true
autoCreateSubscriptionGroup=true
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
storePathRootDir=/usr/local/alibaba-rocketmq/store
storePathCommitLog=/usr/local/alibaba-rocketmq/store/commitlog
flushIntervalCommitLog=1000
flushCommitLogTimed=false
deleteWhen=04
fileReservedTime=72
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
messageIndexSafe=false
haMasterAddress=
brokerRole=ASYNC_MASTER
flushDiskType=ASYNC_FLUSH
cleanFileForciblyEnable=true

启动方式

# 共用命令
/usr/local/alibaba-rocketmq/bin/mqnamesrv &> /usr/local/alibaba-rocketmq/store/mqnamesrv.log &

# 节点a 启动
/usr/local/alibaba-rocketmq/bin/mqbroker -c /usr/local/alibaba-rocketmq/conf/2m-noslave/broker-a.properties &

# 节点b 启动
/usr/local/alibaba-rocketmq/bin/mqbroker -c /usr/local/alibaba-rocketmq/conf/2m-noslave/broker-b.properties &

解决方案

更换b节点;或者下掉b节点,从配置文件中删除相关节点配置,重启mq即可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

凌 烨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值