文章目录
- 一:相关镜像准备:RocketNameServer
- 1.1:查看相关镜像和版本
- 1.2:拉取镜像
- 1.3:配置和运行RocketNameServer容器
- 二:相关镜像准备:RocketBroker
- 2.1:创建配置目录和broker配置文件
- 2.2:运行rocketBroker容器
- 三:准备rocketmq控制台
- 3.1:拉取镜像运行容器
- 3.2:打开控制台
一:相关镜像准备:RocketNameServer
1.1:查看相关镜像和版本
[root@sv-slaver-one ~]# docker search apache/rocketmq
NAME DESCRIPTION STARS OFFICIAL
apache/rocketmq 115
apache/rocketmq-ci 0
apache/rocketmq-operator Apache RocketMQ Operator 0
apache/rocketmq-exporter Apache RocketMQ Exporter 0
[root@sv-slaver-one ~]# docker images apache/rocketmq
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@sv-slaver-one ~]# docker search rocketmq
NAME DESCRIPTION STARS OFFICIAL
apache/rocketmq 115
apache/rocketmq-ci 0
apache/rocketmq-operator Apache RocketMQ Operator 0
apache/rocketmq-exporter Apache RocketMQ Exporter 0
vulhub/rocketmq 0
rocketmqinc/rocketmq-broker Customized RocketMQ Broker Image for RocketM… 14
rocketmqinc/rocketmq Image repository for Apache RocketMQ 58
rocketmqinc/rocketmq-namesrv Customized RocketMQ Name Server Image for Ro… 9
xuchengen/rocketmq 单机版Apache RocketMQ方便开发者一键部署开发… 58
apacherocketmq/rocketmq-broker Apache RocketMQ docker image for broker. 12
foxiswho/rocketmq rocketmq 94
styletang/rocketmq-console-ng rocketmq-console-ng 45
apacherocketmq/rocketmq-operator RocketMQ Operator is to manage RocketMQ serv… 3
rocketmqinc/rocketmq-operator The Kubernetes operator for RocketMQ 0
apacherocketmq/rocketmq-nameserver Apache RocketMQ docker image for name server. 6
apacherocketmq/rocketmq Docker Image for Apache RocketMQ 23
apacherocketmq/rocketmq-dashboard Docker Image for Apache RocketMQ Dashboard 21
pureinsights/rocketmq-broker 0
apacherocketmq/rocketmq-console This repo has moved to rocketmq-dashboard, w… 10
king019/rocketmq rocketmq 10
pangliang/rocketmq-console-ng Deprecated use apacherocketmq/rocketmq-dash… 4
aaronai/rocketmq-proxy-it 0
dyrnq/rocketmq This is a rocketmq docker image based AdoptO… 3
aiyowei/rocketmq-exporter 0
slpcat/rocketmq-exporter https://github.com/slpcat/docker-images/tree… 1
1.2:拉取镜像
[root@sv-slaver-one ~]# docker pull rocketmqinc/rocketmq
Using default tag: latest
latest: Pulling from rocketmqinc/rocketmq
1.3:配置和运行RocketNameServer容器
准备本地挂载目录配置:
mkdir -p /usr/local/docker/local/rocket/data/conf
mkdir -p /usr/local/docker/local/rocket/data/store
mkdir -p /usr/local/docker/local/rocket/data/logs
运行容器
docker run -d \
--name rmqnamesrv \
-p 9876:9876 \
-v /usr/local/docker/local/rocket/data/conf:/root/conf \
-v /usr/local/docker/local/rocket/data/store:/root/store \
-v /usr/local/docker/local/rocket/data/logs:/root/logs \
-e "MAX_POSSIBLE_HEAP=100000000" \
rocketmqinc/rocketmq \
sh mqnamesrv
-e 最大堆内存
[root@sv-slaver-one data]# docker run -d \
> --name rmqnamesrv \
> -p 9876:9876 \
> -v /usr/local/docker/local/rocket/data/conf:/root/conf \
> -v /usr/local/docker/local/rocket/data/store:/root/store \
> -v /usr/local/docker/local/rocket/data/logs:/root/logs \
> -e "MAX_POSSIBLE_HEAP=100000000" \
> rocketmqinc/rocketmq \
> sh mqnamesrv
e6723d36085821b81ce9718159c67560cc2744e92c9e153eb3dbb93d9d02ea08
[root@sv-slaver-one data]# docker ps |grep "rocket"
e6723d360858 rocketmqinc/rocketmq
二:相关镜像准备:RocketBroker
2.1:创建配置目录和broker配置文件
准备broket本地挂载目录和配置
mkdir -p /usr/local/docker/local/rocketbroker/conf
vi /usr/local/docker/local/rocketbroker/conf/broker.conf
mkdir -p /usr/local/docker/local/rocketbroker/logs
mkdir -p /usr/local/docker/local/rocketbroker/store
配置文件broker.conf内容
brokerClusterName = DefaultCluster
brokerName = rocket-broker-master-one
brokerClusterName = DefaultCluster
brokerName = rocket-broker-master-one
# Master=0,slave > 0
brokerId = 0
# 表示几点做消息删除动作,默认是凌晨4点
deleteWhen = 04
# 在磁盘上保留消息的时长,单位是小时
fileReservedTime = 48
# 有三个值:SYNC_MASTER,ASYNC_MASTER,SLAVE;同步和异步表示Master和Slave之间同步数据的机制;
brokerRole = ASYNC_MASTER
# 刷盘策略,取值为:ASYNC_FLUSH,SYNC_FLUSH表示同步刷盘和异步刷盘;SYNC_FLUSH消息写入磁盘后才返回成功状态,ASYNC_FLUSH不需要;
flushDiskType = ASYNC_FLUSH
# 设置broker节点所在服务器的ip地址
brokerIP1 = 192.168.56.8
2.2:运行rocketBroker容器
docker run -d \
--name rocketbroker \
--link rmqnamesrv:namesrv \
-p 10911:10911 \
-p 10909:10909 \
-v /usr/local/docker/local/rocketbroker/logs:/root/logs \
-v /usr/local/docker/local/rocketbroker/store:/root/store \
-v /usr/local/docker/local/rocketbroker/conf/broker.conf:/opt/rocketmq/conf/broker.conf \
-e "NAMESRV_ADDR=namesrv:9876" \
-e "MAX_POSSIBLE_HEAP=200000000" \
rocketmqinc/rocketmq \
sh mqbroker -c /opt/rocketmq/conf/broker.conf
[root@sv-slaver-one conf]# docker run -d --name rocketbroker --link rmqnamesrv:namesrv -p 10911:10911 -p 10909:10909 -v /usr/local/docker/local/rocketbroker/logs:/root/logs -v /usr/local/docker/local/rocketbroker/store:/root/store -v /usr/local/docker/local/rocketbroker/conf/broker.conf:/opt/rocketmq/conf/broker.conf -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq sh mqbroker -c /opt/rocketmq/conf/broker.conf
722e6b6fc41682c4fd0bd4cc7cb273011cc6cda3fece9fa5219d8d19328c1e11
[root@sv-slaver-one conf]# docker ps -a |grep "rocket"
722e6b6fc416 rocketmqinc/rocketmq "sh mqbroker -c /opt…" 5 seconds ago Up 4 seconds 0.0.0.0:10909->10909/tcp, :::10909->10909/tcp, 9876/tcp, 0.0.0.0:10911->10911/tcp, :::10911->10911/tcp rocketbroker
e6723d360858 rocketmqinc/rocketmq "sh mqnamesrv" 56 minutes ago Up 56 minutes 10909/tcp, 0.0.0.0:9876->9876/tcp, :::9876->9876/tcp, 10911/tcp rmqnamesrv
[root@sv-slaver-one conf]# docker ps -a |grep "rocket"
三:准备rocketmq控制台
3.1:拉取镜像运行容器
docker pull pangliang/rocketmq-console-ng
[root@sv-slaver-one conf]# docker pull pangliang/rocketmq-console-ng
Using default tag: latest
latest: Pulling from pangliang/rocketmq-console-ng
docker run -d
–name rmqadmin
-e “JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.56.8:9876
-Dcom.rocketmq.sendMessageWithVIPChannel=false”
-p 9999:8080
pangliang/rocketmq-console-ng
-> 宿主机端口9999映射到容器内8080端口
[root@sv-slaver-one conf]# docker run -d \
> --name rmqadmin \
> -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.56.8:9876 \
> -Dcom.rocketmq.sendMessageWithVIPChannel=false" \
> -p 9999:8080 \
> pangliang/rocketmq-console-ng
446c1f4b273745cf50d8e9802c81b260a73051a4dd732f5d00fe15a91c086650
3.2:打开控制台
http://192.168.56.8:9999/