记录一次虚拟机部署RocketMQ服务后,Rocket模块启动后broker报错的问题

在SpringBoot应用中集成RocketMQ时遇到连接关闭的错误,问题源于Broker配置的IP未正确设置。通过检查并修改Broker配置文件中的IP为虚拟机公网IP,重启服务后,问题得到解决。确保所有配置文件中的IP地址与实际服务运行的地址一致是避免此类问题的关键。
摘要由CSDN通过智能技术生成

记录一次虚拟机部署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模块,报错消失。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值