Docker部署系列:RocketMQ单机版

# 下载镜像
docker pull rocketmqinc/rocketmq

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

# 启动rocketmq broker
mkdir /root/rocketmq/conf
cd /root/rocketmq/conf
vi broker.conf

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

docker run -d -p 10911:10911 -p 10909:10909 -v  /root/rocketmq/data/broker/logs:/root/logs -v  /root/rocketmq/data/broker/store:/root/store -v  /root/rocketmq/conf/broker.conf:/opt/rocketmq/conf/broker.conf --name rmqbroker -e "NAMESRV_ADDR=192.168.5.11:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq sh mqbroker -c /opt/rocketmq/conf/broker.conf

# 启动rmq console界面
docker pull styletang/rocketmq-console-ng

docker run -d --name rmqconsole -p 9800:8080 -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.5.11:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -t styletang/rocketmq-console-ng

# 测试访问
http://192.168.5.11:9800/#/

你可能感兴趣的:(Docker系列,docker,java,linux)