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
- redhat安裝雙節點cassandra叢集Redhat
- repmgr 叢集雙主問題處理
- 安裝 REDIS 叢集Redis
- 安裝Kafka叢集Kafka
- redis安裝,主從複製,哨兵機制,叢集Redis
- rocketMq叢集master模式搭建MQAST模式
- rocketMq之叢集搭建(三)MQ
- rocketMq之雙主雙從同步模式搭建MQ模式
- 完整安裝always on叢集
- 安裝Consul叢集
- 快速安裝 kafka 叢集Kafka
- FastDFS 叢集 安裝 配置AST
- 在Docker下進行MyCAT管理雙主雙從MySQL叢集DockerMySql
- MySQL叢集搭建(6)-雙主+keepalived高可用MySql
- nginx主主叢集Nginx
- 【環境搭建】RocketMQ叢集搭建MQ
- redis-3.0.6 安裝叢集Redis
- redis 5.0 叢集的安裝Redis
- 安裝Zookeeper和Kafka叢集Kafka
- RocketMQ叢集搭建-4.2.0版本MQ
- RocketMQ 安裝MQ
- 使用docker-compose構建elasticsearch叢集DockerElasticsearch
- 安裝Greenplum 5.2 叢集實戰
- Cloudera Manager安裝 & 搭建CDH叢集Cloud
- Redis安裝+叢集+效能監控Redis
- CDH安裝大資料叢集大資料
- CentOS7 安裝PG叢集CentOS
- CentOS6.5 安裝Zookeeper叢集CentOS
- CentOS6.5安裝Twemproxy叢集CentOS
- CentOS6.5 安裝Storm叢集CentOSORM
- CentOS6.5 安裝Kafka叢集CentOSKafka
- CentOS6.5 安裝Spark叢集CentOSSpark
- Redis叢集環境安裝指南Redis
- centos安裝redis3.0.0叢集CentOSRedisS3
- docker-compose安裝redis一主二從三哨兵DockerRedis
- Mysql雙主雙從高可用叢集的搭建且與MyCat進行整合MySql