1、下载docker镜像
docker pull rocketmqinc/rocketmq
2、启动nameServer
docker run -d --restart=always --name rmqnamesrv --privileged=true -p 9876:9876 -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq sh mqnamesrv
3、配置启动breaker
新建breaker文件
vi /usr/etc/rocketmq/broker.conf
配置内容
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 192.168.124.16 #本机id
启动breaker
docker run -d --restart=always --name rmqbroker --link rmqnamesrv:namesrv -p 10911:10911 -p 10909:10909 --privileged=true -v /usr/etc/rocketmq/broker.conf:/opt/docker/rocketmq/broker.conf -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq sh mqbroker -c /opt/docker/rocketmq/broker.conf
4、安装控制台
拉取镜像
docker pull pangliang/rocketmq-console-ng
启动控制台
docker run -d --restart=always --name rmqadmin -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.124.16:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8080:8080 pangliang/rocketmq-console-ng
访问ip:8080(http://192.168.124.16:8080/#/)进入控制台