Seven, docker installation rocketmq mount directory?

1. Search Mirror

docker search rocketmq

2, pulling a mirroring

docker pull rocketmqinc/rocketmq:4.4.0

3, to view mirror

docker images

4, create a directory mapping NameSrv
mkdir -p / data / rocketmq_9876 / namesrv / {logs, store}

5 ,. run NameSrv new container

docker run -d -p 9876:9876 --name rmqserver rocketmqinc/rocketmq:4.4.0  sh mqnamesrv

6, create a directory mapping broker
mkdir -p / data / rocketmq_9876 / broker / {logs, store, conf}

7, edit the configuration file

vim /data/rocketmq_9876/broker/conf/broker.conf
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH

brokerIP1 = 192.168.25.111

8 - Start broker

docker run -d -p 10911:10911 -p 10909:10909 -v  /data/rocketmq_9876/broker/conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf --name=rmqbroker  --link rmqserver:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e "MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq:4.4.0 sh mqbroker -c /opt/rocketmq-4.4.0/conf/broker.conf

8, pulling console mirroring

docker pull pangliang/rocketmq-console-ng

10, operation console container

docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.25.111:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 9877:8080 -di --name=rocketmq-console-ng  pangliang/rocketmq-console-ng

11, visit: 192.168.25.111: 9877
Here Insert Picture Description

The above steps, start no problem, no problem running, but! ! ! No mount the file, the mount command could have been started, but do not know why the mount is unsuccessful, use

docker exec -it  容器ID   /bin/bash

See into the container, can see and generates a corresponding log Store,
Here Insert Picture Description

I do not know if the owner of the problem, or because the path or in the / home can not map? ? ? ? ?

Great God who answers to the following,
with reference to a lot of blog is not right,

I gave what they mount logs and store startup mode

- Mount the log server start
docker run -d -p 9876: 9876 -v / data / rocketmq_9876 / namesrv / logs: / root / rocketmq / logs --name = rocketmq-namesrv -e "MAX_POSSIBLE_HEAP = 100000000" rocketmqinc / rocketmq : 4.4.0 sh mqnamesrv

–挂载log和store的broker启动
docker run -d -p 10911:10911 -p 10909:10909 -v /data/rocketmq_9876/broker/logs:/root/rocketmq/logs -v /data/rocketmq_9876/broker/store:/root/rocketmq/store -v /data/rocketmq_9876/broker/conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf --name=rokcetmq-broker --link rmqserver:namesrv -e “NAMESRV_ADDR=namesrv:9876” -e “MAX_POSSIBLE_HEAP=200000000” rocketmqinc/rocketmq:4.4.0 sh mqbroker -c /opt/rocketmq-4.4.0/conf/broker.conf

Reference links:
https://www.cnblogs.com/liconglong/p/11791869.html
https://blog.csdn.net/fenglibing/article/details/92378090

In this way, if the feeling is the root of the container starts, it may be no problem, but I was rocketmq, of course I have tried to replace the / root is / home, but there are still problems ~

Please inform the god who look.

It is not, I can only try to change the log path to map to see is not resolved. . . .

In addition, building codes presented a springboot address rocketmq the cloud: https: //gitee.com/fred4j/rocketmq-test.git
according to my demo plus installation, should be able to function properly, pay attention to their own console to console add topic ~

Published 14 original articles · won praise 2 · Views 164

Guess you like

Origin blog.csdn.net/weixin_41402056/article/details/105228948