docker-compose安裝rocketmq雙主叢集
簡介
使用docker-compose搭建rocketmq雙主叢集,之所以使用docker-compose是因為啟動部署都比較簡單,不用每次啟動容器傳入引數,可以統一管理等等。這裡使用兩臺伺服器(前提需要安裝docker,安裝docker-compose),一臺101伺服器是放nameserver,一臺102伺服器是放broker以及控制檯,因為只是開發使用,所以broker並未放在兩臺伺服器上
部署nameserver
- 101伺服器新建一個/docker/rocketmq-cluster-docker目錄,在裡面新建logs目錄以及store目錄
- 新建一個docker-compose.yaml檔案
- docker-compose檔案
version: '3.5'
services:
rmqnamesrv-a:
image: foxiswho/rocketmq:server-4.5.2
restart: always
container_name: rmqnamesrv-a
ports:
- 9876:9876
volumes:
- ./logs/nameserver-a:/opt/logs
- ./store/nameserver-a:/opt/store
environment:
JAVA_OPT_EXT: "-Duser.home=/opt -Xms512m -Xmx512m -Xmn150m"
rmqnamesrv-b:
image: foxiswho/rocketmq:server-4.5.2
restart: always
container_name: rmqnamesrv-b
ports:
- 9877:9876
volumes:
- ./logs/nameserver-b:/opt/logs
- ./store/nameserver-b:/opt/store
environment:
JAVA_OPT_EXT: "-Duser.home=/opt -Xms512m -Xmx512m -Xmn150m"
- 啟動nameserver並檢視是否啟動成功
注意啟動命令要在docker-compose.yaml檔案同級目錄
docker-compose up -d
啟動成功
部署broker以及console
- 101伺服器新建一個/docker/rocketmq-cluster-docker目錄,在裡面新建logs目錄以及store目錄
- 新建一個docker-compose.yaml檔案
- docker-compose.yaml檔案內容
version: '3.5'
services:
rmqbroker-a:
image: foxiswho/rocketmq:broker-4.5.2
container_name: rmqbroker-a
restart: always
ports:
- 10909:10909
- 10911:10911
volumes:
- ./logs/broker-a:/opt/logs
- ./store/broker-a:/opt/store
- ./broker-a/broker-a.conf:/etc/rocketmq/broker.conf
environment:
TZ: Asia/Shanghai
JAVA_OPTS: " -Duser.home=/opt"
JAVA_OPT_EXT: "-server -Xms512m -Xmx512m -Xmn150m"
command: sh mqbroker -c /etc/rocketmq/broker.conf autoCreateTopicEnable=true &
rmqbroker-b:
image: foxiswho/rocketmq:broker-4.5.2
container_name: rmqbroker-b
restart: always
ports:
- 10916:10909
- 10915:10915
volumes:
- ./logs/broker-b:/opt/logs
- ./store/broker-b:/opt/store
- ./broker-b/broker-b.conf:/etc/rocketmq/broker.conf
environment:
TZ: Asia/Shanghai
JAVA_OPTS: " -Duser.home=/opt"
JAVA_OPT_EXT: "-server -Xms512m -Xmx512m -Xmn150m"
command: sh mqbroker -c /etc/rocketmq/broker.conf autoCreateTopicEnable=true &
rmqconsole:
image: styletang/rocketmq-console-ng
container_name: rmqconsole
restart: always
ports:
- 9001:8080
environment:
JAVA_OPTS: -Drocketmq.namesrv.addr=192.168.10.101:9876;192.168.10.101:9877 -Dcom.rocketmq.sendMessageWithVIPChannel=false
注意配置改成自己的
4. 啟動broker以及console並檢視是否啟動成功
啟動成功
然後訪問console目錄:192.168.10.102:9001,叢集已經存在!部署成功
相關文章
- RocketMQ雙主雙從叢集搭建MQ
- RocketMQ4.7.1雙主雙從叢集搭建MQ
- repmgr 叢集雙主問題處理
- 安裝Kafka叢集Kafka
- 安裝Consul叢集
- redis安裝,主從複製,哨兵機制,叢集Redis
- MySQL叢集搭建(6)-雙主+keepalived高可用MySql
- 完整安裝always on叢集
- 快速安裝 kafka 叢集Kafka
- rocketMq叢集master模式搭建MQAST模式
- rocketMq之叢集搭建(三)MQ
- 在Docker下進行MyCAT管理雙主雙從MySQL叢集DockerMySql
- rocketMq之雙主雙從同步模式搭建MQ模式
- redis-3.0.6 安裝叢集Redis
- redis 5.0 叢集的安裝Redis
- 安裝Zookeeper和Kafka叢集Kafka
- 【環境搭建】RocketMQ叢集搭建MQ
- docker-compose安裝redis一主二從三哨兵DockerRedis
- 使用docker-compose構建elasticsearch叢集DockerElasticsearch
- Docker部署系列之Docker Compose安裝Redis三主三從叢集DockerRedis
- 安裝RocketmqMQ
- RocketMQ 安裝MQ
- Zookeeper3.4.14(單叢集)、Kafka_2.12-2.2.2(叢集)安裝Kafka
- docker-compose 安裝Docker
- docker-compose安裝Docker
- Ubuntu上kubeadm安裝Kubernetes叢集Ubuntu
- Redis安裝+叢集+效能監控Redis
- CDH安裝大資料叢集大資料
- CentOS7 安裝PG叢集CentOS
- Cloudera Manager安裝 & 搭建CDH叢集Cloud
- 安裝Greenplum 5.2 叢集實戰
- ARM架構安裝Kubernetes叢集架構
- 用 docker-compose 搭建一個 rabbitmq 叢集DockerMQ
- Centos6.9下RocketMQ3.4.6高可用叢集部署記錄(雙主雙從+Nameserver+Console)CentOSMQServer
- Mysql雙主雙從高可用叢集的搭建且與MyCat進行整合MySql
- 在Ubuntu 18.04.1上安裝Hadoop叢集UbuntuHadoop
- Zookeeper-3.4.10 叢集的安裝配置
- Cassandra安裝及分散式叢集搭建分散式