Docker安装RocketMQ + RocketMQ-Console
查看可用的 RocketMQ & RocketMQ-Console版本
RocketMQ
RocketMQ 镜像库地址:https://hub.docker.com/r/rocketmqinc/rocketmq/tags
可以通过 Sort by 查看其他版本的 RocketMQ,默认是最新版本 rocketmqinc/rocketmq:latest。
还可以用 docker search rocketmq 命令来查看可用版本。
RocketMQ-Console
RocketMQ-Console 镜像库地址:https://hub.docker.com/r/styletang/rocketmq-console-ng/tags
可以通过 Sort by 查看其他版本的 RocketMQ-Console,默认是最新版本 styletang/rocketmq-console-ng:latest。
还可以用 docker search rocketmq-console 命令来查看可用版本。
RocketMQ安装:
拉取镜像
# 拉取官方最新镜像
docker pull rocketmqinc/rocketmq:latest
# 查看镜像
docker images
namesrv环境准备
mkdir -p /usr/local/docker/rocketmq/namesrv/logs
mkdir -p /usr/local/docker/rocketmq/namesrv/store
启动namesrv服务
docker run -d -p 9876:9876 -v /usr/local/docker/rocketmq/namesrv/logs:/root/logs -v /usr/local/docker/rocketmq/namesrv/store:/root/store –name rmqnamesrv -e “MAX_POSSIBLE_HEAP=100000000” rocketmqinc/rocketmq sh mqnamesrv
# 自启动
docker update rmqnamesrv –restart=always
broker环境准备
mkdir -p /usr/local/docker/rocketmq/broker/logs
mkdir -p /usr/local/docker/rocketmq/broker/store
mkdir -p /usr/local/docker/rocketmq/broker
borker配置文件
创建broker配置文件
vi /usr/local/docker/rocketmq/broker/broker.conf
配置文件内容
1 | brokerClusterName = DefaultCluster |
启动broker服务
docker run -d -p 10911:10911 -p 10909:10909 -v /usr/local/docker/rocketmq/broker/logs:/root/logs -v /usr/local/docker/rocketmq/broker/store:/root/store -v /usr/local/docker/rocketmq/broker/broker.conf:/opt/rocketmq/conf/broker.conf –name rmqbroker –link rmqnamesrv:namesrv -e “NAMESRV_ADDR=namesrv:9876” -e “MAX_POSSIBLE_HEAP=200000000” rocketmqinc/rocketmq sh mqbroker -c /opt/rocketmq/conf/broker.conf
# 自启动
docker update rmqbroker –restart=always
RocketMQ安装控制台
拉取镜像
# 拉取官方最新镜像
docker pull styletang/rocketmq-console-ng:latest
# 查看镜像
docker images
启动rocketmq-console-ng容器
docker run -d -p 8083:8080 -e “JAVA_OPTS=-Drocketmq.config.namesrvAddr=192.168.198.200:9876 -Drocketmq.config.isVIPChannel=false” –name rocketmq-console-ng styletang/rocketmq-console-ng
# 自启动
docker update rocketmq-console-ng –restart=always
访问控制台
url:http://{Docker宿主机IP}:8083/,即http://192.168.198.200:8083/