赞
踩
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端口,项目运行在服务器不会出现上述问题。
未完待续…
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。