rocketmq docker 镜像地址:
https://hub.docker.com/r/apache/rocketmq/tags
获取rocketmq镜像(内置:mqbroker、mqnamesrv)
docker pull apache/rocketmq:5.1.0
web管理镜像:rocketmq-dashboard
docker pull apacherocketmq/rocketmq-dashboard:latest
docker run -d --name rocketmq-namesrv -p ip:9876:9876 -v /Users/zhaopengfei/docker/rocketmq/namesrv/logs:/root/logs -v /Users/zhaopengfei/docker/rocketmq/namesrv/store:/root/store apache/rocketmq:5.1.0 sh mqnamesrv
# 部署前配置下配置文件
docker run -d --name rocketmq-broker-a -p 10909:10909 -p 10911:10911 -v /Users/zhaopengfei/docker/rocketmq/broker/broker-a/logs:/root/logs -v /Users/zhaopengfei/docker/rocketmq/broker/broker-a/store:/root/store -v /Users/zhaopengfei/docker/rocketmq/broker/broker-a/conf:/home/rocketmq/rocketmq-5.1.0/conf apache/rocketmq:5.1.0 sh mqbroker -c /home/rocketmq/rocketmq-5.1.0/conf/broker.conf
docker run -d --name rocketmq-dashboard -e "JAVA_OPTS=-Drocketmq.namesrv.addr=ip:9876" -p 8080:8080 -t apacherocketmq/rocketmq-dashboard:latest
# 配置文件容器内地址
/home/rocketmq/rocketmq-5.1.0/conf/broker.conf
broker 配置文件:(不要使用中文会乱码)
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = SYNC_MASTER
flushDiskType = SYNC_FLUSH
brokerIP1 = ip
namesrvAddr=192.168.1.63:9876
listenPort = 10911
autoCreateTopicEnable = true
autoCreateSubscriptionGroup = true
useEpollNativeSelector = true
slaveReadEnable = true
[参考:]
https://juejin.cn/post/7092044150820438052
https://juejin.cn/post/6844904008629354504
https://github.com/apache/rocketmq-docker
https://www.cnblogs.com/MUQINGFENG123/p/17036619.html