docker简答搭建rocketMq

docker简答搭建rocketMq

关于server和broker的信息不介绍

#####利用docker-compose.yml 搭建

version: '2'
services:
  rmqserver:  #rocketmq 的服务端
    image: foxiswho/rocketmq:server-4.3.2
    environment:
      JAVA_OPT_EXT: -server -Xms128m -Xmx128m -Xmn128m
      JAVA_OPTS: -Duser.home=/opt
    stdin_open: true
    volumes:
    - /data/rmq/rmqserver/logs:/opt/logs
    - /data/rmq/rmqserver/store:/opt/store
    tty: true
    ports:
    - 9876:9876/tcp
    labels:
      io.rancher.container.pull_image: always
  rmqbroker:  #rocketmq 的broker端
    image: foxiswho/rocketmq:broker-4.3.2
    environment:
      JAVA_OPTS: -Duser.home=/opt
      JAVA_OPT_EXT: -server -Xms128m -Xmx128m -Xmn128m
    stdin_open: true
    volumes:
    - /data/rmq/rmqbroker/conf/broker.conf:/etc/rocketmq/broker.conf
    - /data/rmq/rmqbroker/logs:/opt/logs
    - /data/rmq/rmqbroker/store:/opt/store
    tty: true
    links:
    - rmqserver:rmqserver
    ports:
    - 10911:10911/tcp
    - 10909:10909/tcp
  rocketmq-console-ng: #rocketmq的客户端观察工具
    image: styletang/rocketmq-console-ng:1.0.0
    environment:
      JAVA_OPTS: -Drocketmq.namesrv.addr=rmqserver:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false
    stdin_open: true
    tty: true
    links:
    - rmqserver:rmqserver
    ports:
    - 8082:8080/tcp
    labels:
      io.rancher.container.pull_image: always

#####broker的配置文件

brokerClusterName = DefaultCluster
#指定当前节点的容器ip地址
brokerIP1=192.168.106.2
namesrvAddr=rmqserver:9876
brokerName=broker_demo1
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH

#####相关学习资料可参考

关于配置文件的含义可以参考

https://www.jianshu.com/p/6a6b89f7365a

关于docker-compose

https://blog.csdn.net/u011781521/article/details/80464826

你可能感兴趣的:(java)