docker搭建rocketmq

[root@ip-10-32-49-66 ~]# cat rocketmq.yaml 
version: '3.8'
services:
  # RocketMQ Nameserver
  namesrv:
    image: apache/rocketmq:4.7.1
    container_name: rmqnamesrv
    ports:
      - "9876:9876"
    volumes:
      - ./data/namesrv/logs:/home/rocketmq/logs
      - ./data/namesrv/store:/home/rocketmq/store
    command: sh mqnamesrv

  # RocketMQ Broker
  broker:
    image: apache/rocketmq:4.7.1
    container_name: rmqbroker
    ports:
      - "10911:10911"
      - "10909:10909"
    volumes:
      - ./mq/data/broker/logs:/home/rocketmq/logs
      - ./mq/conf:/home/rocketmq/rocketmq-4.7.1/conf
    environment:
      - "JAVA_OPTS=-Duser.home=/opt"
      - "JAVA_OPT_EXT=-server -Xms512m -Xmx512m -Xmn256m"
    command: sh mqbroker -c /home/rocketmq/rocketmq-4.7.1/conf/broker.conf

 

posted @ 2024-07-23 11:26  力王7314  阅读(7)  评论(0编辑  收藏  举报