Linux下centos7.6中 docker 启动 rocketmq 的 broker 时闪退?

天清地宁
  • 5
新手上路,请多包涵

问题描述

Linux下centos7.6中docker启动rocketmq的broker时闪退

问题出现的平台版本及自己尝试过哪些方法

centos7.6
Docker version 20.10.17
我是在虚拟机上安装的 centos7.6
ip 为 192.168.10.130
启动 nameserver 以及 rocketmq-console 没有问题

REPOSITORYTAGIMAGE IDCREATEDSIZE
foxiswho/rocketmqstyletang/rocketmq-console-ng98bc46e1c0c118 months ago505MB
styletang/rocketmq-console-nglatest7df83bb6e6384 years ago702MB

image.png

只要是一启动broker服务容器,就立马退出
加上 --restart=always --privileged=true 还是闪退

相关代码

#docker 拉取
docker pull foxiswho/rocketmq:4.8.0img
#启动nameserver
docker run -di -v /usr/local/rocketmq/logs:/opt/docker/rocketmq/logs \
      --name rmqnamesrv \
      -e "JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" \
      -p 9876:9876 \
      foxiswho/rocketmq:4.8.0 \
      sh mqnamesrv

#broker.conf
brokerIP1=192.168.10.130
namesrvAddr=192.168.10.130:9876
brokerName=broker_all
#启动broker
docker run -di -v /opt/docker/rocketmq/logs:/usr/local/rocketmq/logs -v /opt/docker/rocketmq/store:/usr/local/rocketmq/store \
      -v /opt/docker/rocketmq/conf:/usr/local/rocketmq/conf \
      --name rmqbroker \
      -e "NAMESRV_ADDR=192.168.10.130:9876" \
      -e "JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" \
      -p 10911:10911 -p 10912:10912 -p 10909:10909 \
      foxiswho/rocketmq:4.8.0 \
      sh mqbroker -c /usr/local/rocketmq/conf/broker.conf
#rocketmq-console-ng
docker pull styletang/rocketmq-console-ng

docker run -di --name rmqconsole --link rmqnamesrv:rmqnamesrv \
-e "JAVA_OPTS=-Drocketmq.namesrv.addr=192.168.10.130:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" \
-p 8180:8080 -t styletang/rocketmq-console-ng

20220714 9:06补充:
打印了docker 日志,说找不到java.io.FileNotFoundException: /usr/local/rocketmq/conf/broker.conf (No such file or directory)
但是我明明有这个broker.conf文件啊
8350f51841f7f3442b9d433a1c39bf0.png

回复
阅读 918
1 个回答
joyqi
  • 16.1k
✓ 已被采纳
-v /opt/docker/rocketmq/conf:/usr/local/rocketmq/conf

你得看看容器里是否有这个文件,或者在容器外的路径/opt/docker/rocketmq/conf/broker.conf是否存在

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏