记录一次虚拟机部署RocketMQ服务后,使用SpringBoot一直报错RocketmqRemoting closeChannel: close the connection to remote address[] result: true的问题
问题描述
根据RocketMQ官网页面的操作启动nameserve和broker后,在springcloud的yml配置文件修改nameserve的ip地址为虚拟机的ip
stream:
rocketmq:
#binder配置
binder:
#注册中心地址
name-server: 192.168.139.101:9876
bindings:
input:
consumer:
#开启
enable: true
#初始重试的时间
backOffInitialInterval: 500
#重试增加的倍数
backOffMultiplier: 3
#最大初始的时间
backOffMaxInterval: 8000
#启动的消费者线程数
concurrency: 3
#过滤tag
#tags: testTag
#是否顺序消费 false为并发消费
#orderly: false
#是否广播
#broadcasting: false
output:
producer:
#开启
enable: true
#是否是事务消息
transactional: false
#同步 or 异步
sync: true
bindings:
#消费者
input:
#topic
destination: test-topic
#消费者组
group: test-group
content-type: application/json
#生产者
output:
#topic
destination: test-topic
content-type: application/json
但是启动后,控制台一直打印
RocketmqRemoting closeChannel: close the connection to remote address[] result: true
查看nameserve和broker的日志也都启动成功了
问题解决
这是一个比较粗心的问题,因为是照着官网的步骤启动的,所以copy后没有将broker的ip
地址改过来,停掉broker的服务
sh bin/mqshutdown broker
在broker的配置文件中加入下列配置
vim broker.conf
我这里是配置的虚拟机ip
brokerIP1=X.X.X.X(虚拟机公网IP)
重新启动broker
nohup sh bin/mqbroker -n 192.168.XX.XX:9876 -c conf/broker.conf autoCreateTopicEnable=true &
配置好后重启rocketmq模块,报错消失。