rocketmq问题集合

1 本地启动项目连接不上broker

启动时,控制台不断的提示远程连接失败

RocketmqRemoting                         : closeChannel: close the connection to remote address[] result: true

发送message时报错

org.apache.rocketmq.client.exception.MQClientException: Send [3] times, still failed, cost [8232]ms, Topic: orderTopic, BrokersSent: [broker-a, broker-a, broker-a]
See http://rocketmq.apache.org/docs/faq/ for further details.
org.apache.rocketmq.client.exception.MQClientException: Send [3] times, still failed, cost [9183]ms, Topic: orderTopic, BrokersSent: [broker-a, broker-a, broker-a]
See http://rocketmq.apache.org/docs/faq/ for further details.
org.apache.rocketmq.client.exception.MQClientException: Send [3] times, still failed, cost [7219]ms, Topic: orderTopic, BrokersSent: [broker-a, broker-a, broker-a]
See http://rocketmq.apache.org/docs/faq/ for further details.
...
...
...
Caused by: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to 172.17.0.1:10911 failed
...

解决方法:

broker.conf配置文件中设置brokerIP1

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerIP1 = 47.107.37.*(公网ip)
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH

重新启动broker服务

nohup sh mqbroker -n 47.107.37.*:9876 -c ../conf/broker.conf  &

查看启动结果

cat nohup.out
The broker[broker-a, 47.107.37.*:10911] boot success. serializeType=JSON and name server is 47.107.37.*:9876

注:如果本地启动项目 ,还需要打开防火墙的10911端口,项目运行在服务器不会出现上述问题。

未完待续…

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值