一、拉取docker镜像
docker pull foxiswho/rocketmq:server
docker pull foxiswho/rocketmq:broker
二、启动 server
docker run -d -p 9876:9876 --name rmq-server foxiswho/rocketmq:server
三、启动 broker
docker run -d -p 10911:10911 -p 10909:10909 --name rmq-broker --link rmq-server:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt" -e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" -v f:/Repository-Docker/rmq/conf/broker.conf:/etc/rocketmq/broker.conf foxiswho/rocketmq:broker
docker run -d -p 10911:10911 -p 10909:10909 --name rmq-broker --link rmq-server:namesrv \
-e "NAMESRV_ADDR=namesrv:9876" \
-e "JAVA_OPTS=-Duser.home=/opt" \
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m -Xmn128m" \
-v f:/Repository-Docker/rmq/conf/broker.conf:/etc/rocketmq/broker.conf \
foxiswho/rocketmq:broker
broker.conf
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
# 指定启动ip,代码连接mq时候使用 本机IP
brokerIP1 = 172.20.111.110
四、启动 console
docker run --name rmq-console --link rmq-server:namesrv -e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8180:8080 -t styletang/rocketmq-console-ng
说明