RocketMQ Docker集群快速搭建

tech2024-06-26  60

转载https://www.cnblogs.com/qdhxhz/p/11094624.html

修改docker-compose.yml后成功启动rocketmq集群,修改后的内容如下:

version: '3.5' services: rmqnamesrv-a: image: rocketmqinc/rocketmq:4.3.0 container_name: rmqnamesrv-a ports: - 9876:9876 volumes: - /opt/rocketmq/logs/nameserver-a:/opt/logs - /opt/rocketmq/store/nameserver-a:/opt/store command: sh mqnamesrv networks: rmq: aliases: - rmqnamesrv-a rmqnamesrv-b: image: rocketmqinc/rocketmq:4.3.0 container_name: rmqnamesrv-b ports: - 9877:9877 volumes: - /opt/rocketmq/logs/nameserver-b:/opt/logs - /opt/rocketmq/store/nameserver-b:/opt/store command: sh mqnamesrv networks: rmq: aliases: - rmqnamesrv-b rmqbroker-a: image: rocketmqinc/rocketmq:4.3.0 container_name: rmqbroker-a ports: - 10911:10911 volumes: - /opt/rocketmq/logs/broker-a:/opt/logs - /opt/rocketmq/store/broker-a:/opt/store - /home/rocketmq/broker-a/broker-a.conf:/opt/rocketmq-4.3.0/conf/broker-a.conf environment: TZ: Asia/Shanghai NAMESRV_ADDR: "rmqnamesrv-a:9876" JAVA_OPTS: " -Duser.home=/opt" JAVA_OPT_EXT: "-server -Xms256m -Xmx256m -Xmn128m" command: sh mqbroker -c /opt/rocketmq-4.3.0/conf/broker-a.conf autoCreateTopicEnable=true & links: - rmqnamesrv-a:rmqnamesrv-a - rmqnamesrv-b:rmqnamesrv-b networks: rmq: aliases: - rmqbroker-a rmqbroker-b: image: rocketmqinc/rocketmq:4.3.0 container_name: rmqbroker-b ports: - 10909:10909 volumes: - /opt/rocketmq/logs/broker-b:/opt/logs - /opt/rocketmq/store/broker-b:/opt/store - /home/rocketmq/broker-b/broker-b.conf:/opt/rocketmq-4.3.0/conf/broker-b.conf environment: TZ: Asia/Shanghai NAMESRV_ADDR: "rmqnamesrv-b:9877" JAVA_OPTS: " -Duser.home=/opt" JAVA_OPT_EXT: "-server -Xms256m -Xmx256m -Xmn128m" command: sh mqbroker -c /opt/rocketmq-4.3.0/conf/broker-b.conf autoCreateTopicEnable=true & links: - rmqnamesrv-a:rmqnamesrv-a - rmqnamesrv-b:rmqnamesrv-b networks: rmq: aliases: - rmqbroker-b rmqconsole: image: styletang/rocketmq-console-ng container_name: rmqconsole ports: - 9001:8080 environment: JAVA_OPTS: -Drocketmq.namesrv.addr=rmqnamesrv-a:9876;rmqnamesrv-b:9877 -Dcom.rocketmq.sendMessageWithVIPChannel=false networks: rmq: aliases: - rmqconsole networks: rmq: name: rmq driver: bridge

访问rocketmqconsole的地址

最新回复(0)