rocketmq org.apache.rocketmq.remoting.exception.RemotingConnectException:connect to failed

我在服务器上部署了RocketMQ之后,用本地的rocketmq-externals(可视化工具)去连接,然后报错了

 

这是由于跨域造成的:

修改服务器中broker的配置,添加服务器IP(公网)即可

 

vim /home/prod/rocketmq-all-4.3.0/distribution/target/apache-rocketmq/conf/broker.conf

新增一行:

brokerIP1=xx.xx.xx.xx  # 你的公网IP

然后重启 mqnamesrv,记得先杀死进程

  > nohup sh bin/mqnamesrv &
  > tail -f ~/logs/rocketmqlogs/namesrv.log
  The Name Server boot success...

然后重启Broker, 记得先杀死进程

注意,重点是: -c conf/broker.conf

  > nohup sh bin/mqbroker -n localhost:9876 -c conf/broker.conf &
  > tail -f ~/logs/rocketmqlogs/broker.log 
  The broker[%s, 172.30.30.233:10911] boot success..

完毕.

参考资料:

https://rocketmq.apache.org/docs/quick-start/

https://www.cnblogs.com/smail-bao/p/6905460.html

http://laciagin.me/2017/12/07/RocketMQ%E6%90%AD%E5%BB%BA%E5%8F%8A%E5%88%A8%E5%9D%91/

你可能感兴趣的:(RocketMQ)