Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy rocketmq Cluster in docker

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to deploy rocketmq cluster in docker, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

Broker-a.conf

BrokerClusterName = rocketmq-clusterbrokerName = broker-abrokerId = "the host public network configured here IPbrokerIP1 = 192.168.1.254deleteWhen = 04fileReservedTime = 48brokerRole = ASYNC_MASTERflushDiskType = ASYNC_FLUSH# public network IPnamesrvAddr=192.168.1.254:9876 The listening port of 192.168.1.254:9877autoCreateTopicEnable=true#Broker external service must be consistent with the container mapping port listenPort = 10911#Broker role #-ASYNC_MASTER asynchronous replication Master#- SYNC_MASTER synchronous double write Master#- SLAVEbrokerRole=ASYNC_MASTER# flushing mode #-ASYNC_FLUSH asynchronous flushing #-SYNC_FLUSH synchronous flushing flushDiskType=ASYNC_FLUSH

Broker-b.conf

BrokerClusterName = rocketmq-clusterbrokerName = broker-bbrokerId = host public network IPbrokerIP1 = 192.168.1.254deleteWhen = 04fileReservedTime = 48brokerRole = ASYNC_MASTERflushDiskType = ASYNC_FLUSH# public network address namesrvAddr = 192.168.1.254VR 9876 The listening port of 192.168.1.254:9877autoCreateTopicEnable=true#Broker external service must be consistent with the container mapping port listenPort = 11911#Broker role #-ASYNC_MASTER asynchronous replication Master#- SYNC_MASTER synchronous double write Master#- SLAVEbrokerRole=ASYNC_MASTER# flushing mode #-ASYNC_FLUSH asynchronous flushing #-SYNC_FLUSH synchronous flushing flushDiskType=ASYNC_FLUSH

Docker-compose.xml

Version: '3.5'services: rmqnamesrv-a: image: rocketmqinc/rocketmq:4.5.0 container_name: rmqnamesrv-a ports:-9876 aliases 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.5.0 container_name: rmqnamesrv-b ports:-9877 rmqnamesrv-b rmqbroker-a 9876 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.5.0 container_name: rmqbroker-a ports:-10909-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.5.0/conf/broker.conf environment: TZ: Asia/Shanghai NAMESRV_ADDR: "rmqnamesrv-a:9876" JAVA_OPTS: "- Duser.home=/opt" JAVA_OPT_EXT: "- server-Xms256m-Xmx256m-Xmn256m" command: sh mqbroker-c / opt/rocketmq-4.5.0/conf/broker.conf autoCreateTopicEnable=true & links:-rmqnamesrv-a:rmqnamesrv-a-rmqnamesrv-b:rmqnamesrv-b networks: rmq: Aliases:-rmqbroker-a rmqbroker-b: image: rocketmqinc/rocketmq:4.5.0 container_name: rmqbroker-b ports:-11909 image-11911 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.5.0/conf/broker.conf environment: TZ: Asia/Shanghai NAMESRV_ADDR: "rmqnamesrv-b:9876" JAVA_OPTS: "- Duser.home=/opt" JAVA_OPT_EXT: "- server-Xms256m-Xmx256m-Xmn256m" command: sh mqbroker-c / opt/rocketmq-4.5.0/conf/broker.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 aliases 8080 environment: JAVA_OPTS:-Drocketmq.namesrv.addr=rmqnamesrv-a:9876 Rmqnamesrv-b:9876-Dcom.rocketmq.sendMessageWithVIPChannel=false networks: rmq: aliases:-rmqconsolenetworks: rmq: name: rmq driver: bridge

The container port mapping configured here must be consistent with the port configured in the configuration file, because the broker address taken by the client from nameserver is the brokerIP1:listenPort configured in the configuration file, so the port mapping initiated by the container must be consistent, otherwise the connect timeout cannot be accessed and an error will be reported.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report