docker+linux+rocketmq启动报错记录

docker rocketmq FileNotFoundException: /etc/rocketmq/broker.conf (权限被拒)

执行命令:

docker run -d  \
--name rmqbroker \
--link rmqnamesrv:namesrv \
-p 10911:10911 \
-p 10909:10909 \
-v  /docker/rocketmq/data/broker/logs:/root/logs \
-v  /docker/rocketmq/data/broker/store:/root/store \
-v /docker/rocketmq/conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf \
-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 

日志:


java.io.FileNotFoundException: /opt/rocketmq-4.4.0/conf/broker.conf (Permission denied)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at org.apache.rocketmq.broker.BrokerStartup.createBrokerController(BrokerStartup.java:128)
        at org.apache.rocketmq.broker.BrokerStartup.main(BrokerStartup.java:58)

原因:selinux限制了权限

解决办法:关闭selinux

setenforce 0

你可能感兴趣的:(linux,java-rocketmq,docker)