Docker数据卷容器 - 可以跨群体共享 [英] Docker Data Volume Container - Can I share across swarm

查看:162
本文介绍了Docker数据卷容器 - 可以跨群体共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用--volumes从多个其他容器创建和装载数据卷容器,但是我有一些关于它的用法和限制的问题:



情况:我正在寻找使用数据卷容器将用户上传的图像存储在我的Web应用程序中。该数据卷容器将被许多运行Web前端的其他容器使用/安装。



问题:


  1. 可以将数据卷容器用于/装载在驻留在码头组群内的其他主机上的容器中吗?


  2. 性能?是否建议以这种方式构建这些东西?


  3. 有没有更好的方法来处理跨容器和主机(如NFS)的持久资源共享?



解决方案


可以将数据卷容器用于/安装在容器中驻留在码头组群内的其他主机上?


Docker本身不提供迁移数据或在集群中的主机。


性能如何?是否建议以这种方式构建这些东西?


Docker卷通常会施加很少的性能开销,因为它们只是绑定挂载。


有没有更好的方法来处理跨容器和主机(如NFS)的持久资源共享?


NFS或任何集群文件系统(例如)可用于创建数据集群中所有主机都可用的卷。


I know how to create and mount a data volume container to multiple other containers using --volumes-from, but I do have a few questions regarding it's usage and limitations:

Situation: I am looking to use a data volume container to store user uploaded images in for my web application. This data volume container will be used/mounted by many other containers running the web frontend.

Questions:

  1. Can data volume containers be used/mounted in containers residing on other hosts within a docker swarm?

  2. How is the performance? is it recommended to structure things this way?

  3. Is there a better way to handle sharing of persistent resources across containers and hosts such as NFS?

解决方案

Can data volume containers be used/mounted in containers residing on other hosts within a docker swarm?

Docker, by itself, does not provide any facility for either migrating data or sharing data between hosts in a cluster.

How is the performance? is it recommended to structure things this way?

Docker volumes impose very little performance overhead in general, because they're just bind mounts.

Is there a better way to handle sharing of persistent resources across containers and hosts such as NFS?

NFS or any cluster filesystem, such as gluster, can be used to create data volumes that are available to all hosts in a cluster.

这篇关于Docker数据卷容器 - 可以跨群体共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆