其他分享
首页 > 其他分享> > Docker安装RocketMQ

Docker安装RocketMQ

作者:互联网

 Docker安装RocketMQ

1.0 背景

由于自己的电脑vnp不能连公司的vpn,所以在家运行项目不方便,打算给自己的linux安装RocketMQ。

2.0 拉取镜像

docker pull rocketmqinc/rocketmq:latest

2.1 创建目录

/usr/local/docker/rocketmq/data/namesrv/logs

/usr/local/docker/rocketmq/data/namesrv/store

 

2.2 安装namesrv

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

2.3 安装broker

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = XX.XX.XX.XX
docker run -d -p 10911:10911 -p 10909:10909 -v  /usr/local/docker/rocketmq/data/broker/logs:/root/logs -v  /usr/local/docker/rocketmq/data/broker/store:/root/store -v  /usr/local/docker/rocketmq/conf/broker.conf:/opt/rocketmq-latest/conf/broker.conf --name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq:latest sh mqbroker -c /opt/rocketmq-latest/conf/broker.conf

2.4 安装 rocketmq 控制台

docker run -d -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.8.128:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 18080:8080 -t pangliang/rocketmq-console-ng

2.5 查看

docker ps -a

 检验成果

打开浏览器访问ip:18080 注意访问你linux的ip和上面rocketmq控制台映射的18080端口

 

标签:local,broker,RocketMQ,conf,namesrv,docker,安装,Docker,rocketmq
来源: https://blog.csdn.net/cf082430/article/details/118946497