RockerMq docekr-compose安装方法

编辑 docker-compose.yaml

version: '3.8'

services:
  namesrv:
    image: apache/rocketmq:4.8.0
    container_name: rmqnamesrv
    ports:
      - 9876:9876
    networks:
      - rocketmq
    command: sh mqnamesrv

  broker:
    image: apache/rocketmq:4.8.0
    container_name: rmqbroker
    ports:
      - 10909:10909
      - 10911:10911
      - 10912:10912
    environment:
      - NAMESRV_ADDR=rmqnamesrv:9876
    volumes:
      - ./broker.conf:/home/rocketmq/rocketmq-4.8.0/conf/broker.conf
    depends_on:
      - namesrv
    networks:
      - rocketmq
    command: sh mqbroker -c /home/rocketmq/rocketmq-4.8.0/conf/broker.conf

  rocketmq-dashboard:
    image: apacherocketmq/rocketmq-dashboard
    container_name: rocketmq-dashboard
    ports:
      - 8087:8080
    networks:
      - rocketmq
    environment:
      - JAVA_OPTS=-Drocketmq.namesrv.addr=rmqnamesrv:9876
    depends_on:
      - namesrv
      - broker

networks:
  rocketmq:
    driver: bridg

测试发送消息

$ docker exec -it rmqbroker bash

$ sh tools.sh org.apache.rocketmq.example.quickstart.Producer
 SendResult [sendStatus=SEND_OK, msgId= ...

$ sh tools.sh org.apache.rocketmq.example.quickstart.Consumer
 ConsumeMessageThread_%d Receive New Messages: [MessageExt...

查看dashboard

访问 http://127.0.0.1:8087

相关推荐
旦沐已成舟4 小时前
K8S-Pod的环境变量,重启策略,数据持久化,资源限制
java·docker·kubernetes
milk_yan8 小时前
Docker集成onlyoffice实现预览功能
前端·笔记·docker
encoding-console12 小时前
docker安装consul并启动的详细步骤
docker·容器·consul
m0_7482299912 小时前
从零到上线:Node.js 项目的完整部署流程(包含 Docker 和 CICD)
docker·容器·node.js
shelby_loo13 小时前
Azure学生订阅上手实操:快速搭建Docker+WordPress环境
microsoft·docker·azure
小诺大人14 小时前
Docker 安装 elk(elasticsearch、logstash、kibana)、ES安装ik分词器
elk·elasticsearch·docker
_Eden_17 小时前
Docker入门学习
学习·docker·容器
张3蜂17 小时前
.NET 8 项目 Docker 方式部署到 Linux 系统详细操作步骤
linux·docker·.net
东阳马生架构1 天前
RocketMQ原理—2.源码设计简单分析上
rocketmq
哭哭啼1 天前
rocketmq dashboard 安装
java·rocketmq·java-rocketmq