通过docker-compose部署的最新版本的RocketMQ,然后也用docker部署了dashboard,但是发现dashboard无法正常连接到RocketMQ,有这样的log
文档上通过docker部署Dashboard只是提供了可以修改namesvr的地址,但这个报错看起来是连接broker的地址不对?
可以试试这个
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 中国开发者钉钉群”
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
涵盖 RocketMQ、Kafka、RabbitMQ、MQTT、轻量消息队列(原MNS) 的消息队列产品体系,全系产品 Serverless 化。RocketMQ 一站式学习:https://rocketmq.io/