开发者社区 > 云原生 > 云消息队列 > 正文

RocketMQ这个报错看起来是连接broker的地址不对?

89a877a8dfa0b4de05cec601fc824bed.png
通过docker-compose部署的最新版本的RocketMQ,然后也用docker部署了dashboard,但是发现dashboard无法正常连接到RocketMQ,有这样的log
文档上通过docker部署Dashboard只是提供了可以修改namesvr的地址,但这个报错看起来是连接broker的地址不对?

展开
收起
嘟嘟嘟嘟嘟嘟 2024-07-10 12:26:17 128 0
1 条回答
写回答
取消 提交回答
  • 可以试试这个
    services:
    nameserver:
    image: apache/rocketmq:5.2.0
    container_name: rmqnamesrv
    ports:

      - 9876:9876
    restart: always
    volumes:
      - /data/rocketmq-5.x/logs:/home/rocketmq/logs
      - /data/rocketmq-5.x/store:/home/rocketmq/store
    environment:
      JAVA_OPT_EXT: "-Duser.home=/home/rocketmq -Xms256M -Xmx256M -Xmn128m"
    command: ["sh","mqnamesrv"]
    

    broker:
    image: apache/rocketmq:5.2.0
    container_name: rmqbroker
    ports:

      - 10909:10909
      - 10911:10911
    restart: always
    volumes:
      - /data/rocketmq-5.x/broker-a/logs:/home/rocketmq/logs
      - /data/rocketmq-5.x/broker-a/store:/home/rocketmq/store
      - /data/rocketmq-5.x/broker-a/conf/broker.conf:/home/rocketmq/broker.conf
    links:
     - nameserver:namesrv
    depends_on:
      - 'nameserver'
    environment:
      NAMESRV_ADDR: nameserver:9876
      JAVA_OPT_EXT: "-Duser.home=/home/rocketmq -Xms256M -Xmx512M -Xmn128m"
    command: ["sh","mqbroker","-c","/home/rocketmq/broker.conf","autoCreateTopicEnable=true"]
    

    rmqdashboard:
    image: apacherocketmq/rocketmq-dashboard:latest
    container_name: rocketmq-dashboard
    ports:

      - 9999:8080
    restart: always
    volumes:
      # 数据目录映射, users.properties需要放在data目录下
      - /data/rocketmq-dashboard/data:/tmp/rocketmq-console/data 
    environment:
      JAVA_OPTS: "-Drocketmq.namesrv.addr=192.168.31.170:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false -Drocketmq.config.loginRequired=true -Drocketmq.config.accessKey=rocketmq2 -Drocketmq.config.secretKey=12345678"
    

    此回答整理自钉群“群2-Apache RocketMQ 中国开发者钉钉群”

    2024-07-10 13:03:54
    赞同 11 展开评论 打赏

涵盖 RocketMQ、Kafka、RabbitMQ、MQTT、轻量消息队列(原MNS) 的消息队列产品体系,全系产品 Serverless 化。RocketMQ 一站式学习:https://rocketmq.io/

相关产品

  • 云消息队列 MQ
  • 相关电子书

    更多
    RocketMQ Client-GO 介绍 立即下载
    RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载
    基于 RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载