Docker安装RocketMQ

原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/17296603.html

 

拉取rocketmq镜像

docker pull apache/rocketmq:4.9.4

 

运行rmqnamesrv

docker run -d --restart=always --name rmqnamesrv -p 9876:9876 -v D:/app/rocketmq/data/namesrv/logs:/home/rocketmq/logs -e "MAX_POSSIBLE_HEAP=100000000" apache/rocketmq:4.9.4 sh mqnamesrv

 

创建文件夹

mkdir -p D:/app/rocketmq/data/broker/logs
mkdir -p D:/app/rocketmq/data/broker/store
mkdir -p D:/app/rocketmq/data/broker/conf

 

拷贝配置文件

docker cp rmqnamesrv:/home/rocketmq/rocketmq-4.9.4/conf D:/app/rocketmq/data/broker

 

编辑配置文件 D:/app/rocketmq/data/broker/broker.conf

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH

namesrvAddr=192.168.22.24:9876
brokerIP1=192.168.22.24
defaultTopicQueueNums=4
autoCreateTopicEnable=true
autoCreateSubscriptionGroup=true
listenPort=10911

Note:namesrvAddr和brokerIP1必须是具体的IP地址

 

运行rmqbroker

docker run -d --restart=always --name rmqbroker --link rmqnamesrv:namesrv -p 10909:10909 -p 10911:10911 -p 10912:10912 -v D:/app/rocketmq/data/broker/logs:/home/rocketmq/logs -v D:/app/rocketmq/data/broker/store:/home/rocketmq/store -v D:/app/rocketmq/data/broker/conf/broker.conf:/home/rocketmq/rocketmq-4.9.4/conf/broker.conf -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" apache/rocketmq:4.9.4 sh mqbroker -c /home/rocketmq/rocketmq-4.9.4/conf/broker.conf

 

拉取rocketmq-dashboard镜像

docker pull apacherocketmq/rocketmq-dashboard:1.0.0

 

运行rocketmq-dashboard

docker run -d --restart=always --name rocketmq-dashboard -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.22.24:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 9999:8080 apacherocketmq/rocketmq-dashboard:1.0.0

 

登录 http://localhost:9999/#/cluster

 

posted @ 2023-04-07 16:24  李白与酒  阅读(556)  评论(0编辑  收藏  举报