简体   繁体   English

在CoreOS主机之间移动docker数据卷容器

[英]Move docker data volume containers between CoreOS hosts

For some scenarios a clustered file system is just too much. 对于某些情况,群集文件系统太多了。 This is, if I got it right, the use case for the data volume container pattern . 如果我做对了,那就是数据卷容器模式的用例。 But even CoreOS needs updates from time to time. 但即使是CoreOS也需要不时更新。 If I'd still like to minimise the down time of applications, I'd have to move the data volume container with the app container to an other host, while the old host is being updated. 如果我还想最大限度地减少应用程序的停机时间,我必须将带有应用程序容器的数据卷容器移动到另一台主机,同时更新旧主机。

Are there best practices existing? 是否存在最佳实践? A solution mentioned more often is the "backup" of a container with docker export on the old host and docker import on the new host. 更常提到的解决方案是在旧主机上使用docker export并在新主机上docker import docker export 的容器“备份” But this would include scp-ing of tar-files to an other host. 但这包括将tar文件scp到其他主机。 Can this be managed with fleet ? 这可以用车队管理吗?

@brejoc, I wouldn't call this a solution, but it may help: @brejoc,我不会称之为解决方案,但它可能有所帮助:

Alternative 1: Use another OS, which does have clustering, or at least - doesn't prevent it. 备选方案1:使用另一个具有群集功能的操作系统,或者至少使用 - 不会阻止它。 I am now experimenting with CentOS. 我现在正在试验CentOS。 2: I've created a couple of tools that help in some use cases. 2:我创建了一些有助于某些用例的工具。 First tool, retrieves data from S3 (usually artifacts), and is uni-directional. 第一个工具,从S3(通常是工件)检索数据,并且是单向的。 Second tool, which I call 'backup volume container', has a lot of potential in it, but requires some feedback. 第二个工具,我称之为“备份卷容器”,它有很多潜力,但需要一些反馈。 It provides a 2-way backup/restore for data, from/to many persistent data stores including S3 (but also Dropbox, which is cool). 它为数据提供了双向备份/恢复,包括S3(还有Dropbox,很酷)的许多持久性数据存储。 As it is implemented now, when you run it for the first time, it would restore to the container. 正如现在实现的那样,当您第一次运行它时,它将恢复到容器。 From that point on, it would monitor the relevant folder in the container for changes, and upon changes (and after a quiet period), it would back up to the persistent store. 从那时起,它将监视容器中的相关文件夹以进行更改,并且在更改时(以及在安静时段之后),它将备份到持久性存储。

Backup volume container: https://registry.hub.docker.com/u/yaronr/backup-volume-container/ File sync from S3: https://registry.hub.docker.com/u/yaronr/awscli/ (docker run yaronr/awscli aws s3 etc etc - read aws docs) 备份卷容器: https//registry.hub.docker.com/u/yaronr/backup-volume-container/来自S3的文件同步: https//registry.hub.docker.com/u/yaronr/awscli/ ( docker run yaronr / awscli aws s3等等 - 阅读aws文档)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM