使用docker搭建RocketMQ4.4以及可视化

事前准备

主机:172.18.44.115

环境 docker

1.拉取镜像

docker pull rocketmqinc/rocketmq:4.4.0

2.创建目录

在/mnt/docket/ 目录下建一个 rocketMQ 文件夹,并在下面创建conf文件夹,以及broker.conf文件

broker.conf 内容

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = {本地公网 IP}  #这里用的是VPN去搞的,所以填写的就是172.18.44.115

3.启动nameServer容器

docker run -d -p 9876:9876 -v /mnt/docket/data/namesrv/logs:/root/logs -v /mnt/docket/data/namesrv/store:/root/store --name rmqnamesrv -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq:4.4.0 sh mqnamesrv

4.启动broker容器

docker run -d -p 10911:10911 -p 10909:10909 -v /mnt/docket/data/broker/logs:/root/logs -v /mnt/docket/data/broker/store:/root/store -v /mnt/docket/conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf --name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq:4.4.0 sh mqbroker -c /opt/rocketmq-4.4.0/conf/broker.conf

5.安装rocketMQ_console

拉取镜像

docker pull styletang/rocketmq-console-ng

6.启动容器,这里更换下端口,改成8083 172.18.44.115:9876指明的是nameServer的地址

docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.18.44.115:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8083:8080 -t styletang/rocketmq-console-ng

7.访问 http://172.18.44.115:8083/#/

你可能感兴趣的:(使用docker搭建RocketMQ4.4以及可视化)