"我通过docker-compose搭建的rocketmq,启动是正常的,通过Java连接报错,错误信息如下
我的配置如下:
docker -compose配置如下:version: '3.8'services: rmqnamesrv: image: apache/rocketmq:5.1.0 container_name: rmqnamesrv ports: - 9876:9876 restart: always privileged: true volumes: - ./rocketmq/nameServer/store:/home/rocketmq/store - ./rocketmq/nameServer/logs:/home/rocketmq/logs #- ./rocketmq/nameServer/bin/runserver.sh:/home/rocketmq/rocketmq-5.1.0/bin/runserver.sh environment: - MAX_HEAP_SIZE=256M - HEAP_NEWSIZE=128M command: [""sh"",""mqnamesrv""] broker: image: apache/rocketmq:5.1.0 container_name: rmqbroker ports: - 10909:10909 - 10911:10911 restart: always privileged: true volumes: - ./rocketmq/broker/logs:/home/rocketmq/logs - ./rocketmq/broker/store:/home/rocketmq/store - ./rocketmq/broker/conf/broker.conf:/home/rocketmq/rocketmq-5.1.0/conf/broker.conf # - /usr/local/rocketmq/broker/bin/runbroker.sh:/home/rocketmq/rocketmq-5.1.0/bin/runbroker.sh depends_on: - 'rmqnamesrv' environment: - NAMESRV_ADDR=rmqnamesrv:9876 - MAX_HEAP_SIZE=512M - HEAP_NEWSIZE=256M command: [""sh"",""mqbroker"",""-c"",""/home/rocketmq/rocketmq-5.1.0/conf/broker.conf""] rmqdashboard: image: apacherocketmq/rocketmq-dashboard:latest container_name: rocketmq-dashboard ports: - 8080:8080 restart: always privileged: true depends_on: - 'rmqnamesrv' environment: - JAVA_OPTS= -Xmx256M -Xms256M -Xmn128M -Drocketmq.namesrv.addr=rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false
我用的版本是5.1.0这个应该如何修改下,我在网上找了好久,没有一个正确答案的。"
"直接用命令可以。参考demo:docker run -d --net mq-net -p 9876:9876 --restart=always --name rmqnamesrv --privileged=true -e ""MAX_POSSIBLE_HEAP=100000000"" -e ""JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m"" apache/rocketmq sh mqnamesrv
docker run -d --net mq-net -p 10911:10911 -p 10909:10909 -p 10912:10912 -p 8081:8081 --restart=always --name rmqbroker --link rmqnamesrv:namesrv -e ""NAMESRV_ADDR=namesrv:9876"" -e ""MAX_POSSIBLE_HEAP=200000000"" -e ""JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m"" apache/rocketmq sh mqbroker -n 172.19.0.2:9876 -c /home/rocketmq/rocketmq-5.1.3/conf/broker.conf
我直接拉最新的镜像,所以是5.1.3。
docker run -d --net mq-net --name rocketmq-dashboard -e ""JAVA_OPTS=-Drocketmq.namesrv.addr=172.19.0.2:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false"" -p 8080:8080 -t apacherocketmq/rocketmq-dashboard:latest此回答整理至钉群“群2-Apache RocketMQ 中国开发者钉钉群”。"
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
涵盖 RocketMQ、Kafka、RabbitMQ、MQTT、轻量消息队列(原MNS) 的消息队列产品体系,全系产品 Serverless 化。RocketMQ 一站式学习:https://rocketmq.io/