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

相关推荐
一名路过的小码农1 小时前
ceph 18.2.4二次开发,docker镜像制作
ceph·docker·容器
xiangshangdemayi4 小时前
Windows环境GeoServer打包Docker极速入门
windows·docker·容器·geoserver·打包·数据挂载
程序员JerrySUN5 小时前
熟悉的 Docker,陌生的 Podman
linux·docker·容器·系统架构·podman
gobeyye5 小时前
Docker 用法详解
运维·docker·容器
小灰灰__6 小时前
Linux离线安装Docker命令,简单镜像操作
linux·docker·eureka
雪碧聊技术7 小时前
Docker3:docker基础1
运维·docker·容器·docker常见命令
chudaxiakkk9 小时前
记录spring-boot 3.X版本整合RocketMq
java·spring boot·rocketmq
大虾别跑10 小时前
docker安装zabbix +grafana
docker·zabbix·grafana
wsxlgg10 小时前
docker搭建jpom
docker
FLGB10 小时前
Docker 安装单机版mysql 并持久化数据
mysql·docker·容器