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

一.事前准备

  • 主机
  • docker

二.RocketMQ 部署

2.1.拉取mq镜像

docker pull rocketmqinc/rocketmq:4.4.0

2.2.创建目录和文件

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

2.3.更改broker.conf内容

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = {本地公网 IP}

2.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

2.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

三.RocketMQ_console部署

3.1.拉取RocketMQ_console镜像

docker pull styletang/rocketmq-console-ng

3.2.启动RocketMQ_console容器

这里更换下端口,改成8083,8080应该会重复

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

3.3.访问 服务器ip:8083

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