docker安装RocketMq

一、docker下载rocketMq镜像

sudo docker pull rocketmqinc/rocketmq

二、创建存储日志和数据的文件夹

mkdir -p /docker/rocketmq/nameserver/logs /docker/rocketmq/nameserver/store

三、启动namesrv服务

docker run -d --restart=always --name rmqnamesrv --privileged=true -p 9876:9876  -v /docker/rocketmq/nameserver/logs:/root/logs -v /docker/rocketmq/nameserver/store:/root/store -e "MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq sh mqnamesrv

四、启动broker服务
创建broker.conf配置文件,目录是/opt/docker/rocketmq/broker.conf,文件内容如下

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER`在这里插入代码片`
flushDiskType = ASYNC_FLUSH
brokerIP1 = 主机的IP
docker run -d --restart=always --name rmqbroker --link rmqnamesrv:namesrv -p 10911:10911 -p 10909:10909 --privileged=true -v /docker/rocketmq/data/broker/logs:/root/logs -v /docker/rocketmq/data/broker/store:/root/store -v /docker/rocketmq/conf/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

五、安装控制台

docker pull pangliang/rocketmq-console-ng
在这里插入代码片docker run -d --restart=always --name rmqadmin -e "JAVA_OPTS=-Drocketmq.namesrv.addr=主机的ip:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8080:8080 pangliang/rocketmq-console-ng

你可能感兴趣的:(开发环境安装,docker,java-rocketmq,rocketmq)