1.问题出现
搭完mq单主单从集群之后,美滋滋想发一下message, 没想到碰到一个坑爹的问题:
com.alibaba.rocketmq.client.exception.MQBrokerException: CODE: 14 DESC: service not available now, maybe disk full, CL: 0.87 CQ: 0.87 INDEX: 0.87, maybe your broker machine memory too small.
com.alibaba.rocketmq.client.exception.MQBrokerException: CODE: 14 DESC: service not available now, maybe disk full, CL: 0.87 CQ: 0.87 INDEX: 0.87, maybe your broker machine memory too small.
For more information, please visit the url, https://github.com/alibaba/RocketMQ/issues/64
at com.alibaba.rocketmq.client.impl.MQClientAPIImpl.processSendResponse(MQClientAPIImpl.java:492)
at com.alibaba.rocketmq.client.impl.MQClientAPIImpl.sendMessageSync(MQClientAPIImpl.java:398)
at com.alibaba.rocketmq.client.impl.MQClientAPIImpl.sendMessage(MQClientAPIImpl.java:379)
at com.alibaba.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendKernelImpl(DefaultMQProducerImpl.java:698)
at com.alibaba.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendSelectImpl(DefaultMQProducerImpl.java:877)
at com.alibaba.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:851)
at com.alibaba.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:163)
at com.ruishenh.rocketmq.example.Producer.main(Producer.java:78)
2.问题分析与解决
看报错应该是磁盘空间不足的问题,然后各种百度,发现解释的都是很模糊,没有真正解决到点子上,然后看到一个帖子https://bbs.csdn.net/topics/392568834,还挺符合的,虽然给出的解决方案说的没那么详细,但是值得一试。
2.1.应该是磁盘空间的问题,先看看磁盘空间
已用95%,查阅百度之后发现rocketmq源码的DefaultMessageStore类里,默认会把剩余磁盘的比率不足75%(rocketmq版本不同这个比率好像不一样)当做磁盘空间不足处理,看来磁盘是有点不够了。
2.2.既然磁盘空间不够,那就配置一下,把默认磁盘比率放大一些
先cd到rocketmq配置文件的路径,我这里配置的是双主双从同步的模式,所以cd到配置文件(根据配置的不同文件夹的路径不一样,但都在/conf下)。
- cd rocketmq-all-4.7.0-bin-release/conf/2m-2s-sync/
- vim broker-a.properties
- 在最后加一行diskMaxUsedSpaceRatio=99(所有节点的配置文件都加一下),表示剩余磁盘比例不足99才报错
4.:wq 保存退出
5.重启mq
以上步骤操作完成后,再尝试发送消息: