linux - Docker 卷不存储整个数据

标签 linux docker

我在 Docker 中运行 activeMQ 并使用以下命令持久化数据。但是数据并没有完全保存在一个目录中

[root@kubernetes-4 activemq]# docker run -it --rm -v /MyPath:/data webcenter/activemq:5.14.3
2019-08-24 03:56:42,388 CRIT Supervisor running as root (no user in config file)
2019-08-24 03:56:42,388 WARN Included extra file "/etc/supervisor/conf.d/activemq.conf" during parsing
2019-08-24 03:56:42,388 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
2019-08-24 03:56:42,400 INFO RPC interface 'supervisor' initialized
2019-08-24 03:56:42,400 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-08-24 03:56:42,400 INFO supervisord started with pid 1
2019-08-24 03:56:43,403 INFO spawned: 'cron' with pid 16
2019-08-24 03:56:43,405 INFO spawned: 'activemq' with pid 17
2019-08-24 03:56:44,969 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-24 03:56:44,969 INFO success: activemq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

我路径中的数据

cd /MyPath/
[root@kubernetes-4 MyPath]# ls
activemq
[root@kubernetes-4 MyPath]# cd activemq/
[root@kubernetes-4 activemq]# ls
[root@kubernetes-4 activemq]# 

容器中的数据

root@kubernetes-4 activemq]# docker exec -it 630a3fe743e2 bash
root@630a3fe743e2:/opt/activemq# ls
LICENSE  README.txt               bin   conf.tmp  docs      lib  webapps
NOTICE   activemq-all-5.14.3.jar  conf  data      examples  tmp  webapps-demo
root@630a3fe743e2:/opt/activemq# cd data
root@630a3fe743e2:/opt/activemq/data# ls
activemq.log
root@630a3fe743e2:/opt/activemq/data# cd ..
root@630a3fe743e2:/opt/activemq# cd /data/
root@630a3fe743e2:/data# ls
activemq
root@630a3fe743e2:/data# cd activemq/
root@630a3fe743e2:/data/activemq# ls
activemq.pid  kahadb  localhost
root@630a3fe743e2:/data/activemq# 

最佳答案

安装确切的 activemq direcotry你会看到一切正常。

docker run -dit --rm -v /MyPath:/data/activemq webcenter/activemq:5.14.3

第二,您没有挂载 /opt/activemq/data,因此无法在主机上访问。

出于日志目的,您可以挂载 v/var/log/activemq:/var/log/activemq

关于linux - Docker 卷不存储整个数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57634988/

相关文章:

linux - 使用 grep 命令匹配特定列

集中数据访问或变量

c - 如何使 scanf 读取超过 4095 个字符作为输入?

python - 运行 docker 时没有此类文件或目录

docker - Spring Boot应用程序无法在Docker中链接领事

maven - 如何安装Eclipse Ditto

Docker : Get https://registry-1. docker.io/v2/: x509: 由未知授权机构签署的证书

linux - 在 epoll 被阻塞时添加/删除 fd

linux - 随机运行 Bash 脚本

python - 哪个生产服务器用于 Cloud Run 中的 Python 应用程序?