Docker 1.12在“群组模式”提供“单个虚拟Docker主机”? [英] Can Docker 1.12 in "swarm mode" provide "a single, virtual Docker host"?

查看:104
本文介绍了Docker 1.12在“群组模式”提供“单个虚拟Docker主机”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

原始 Docker Swarm 的漂亮功能之一是:

One of the nifty features of the original "Docker Swarm" was that it:


将Docker主机池转换为单个虚拟Docker主机

turns a pool of Docker hosts into a single, virtual Docker host

允许工具(例如 docker CLI和 docker-compose )不知道他们是否针对Docker Engine的单一实例或Swarm群集。

allowing tools (such as the docker CLI, and docker-compose) to be agnostic about whether they were operating against a single instance of Docker Engine, or a Swarm cluster.

Docker 1.12带来了一个集成的群组模式,这对Docker的编排很有吸引力。但是,我们在进程中是否丢失了集群为虚拟Docker主机功能?对群集模式主机使用 docker运行似乎只是在主节点本身启动容器。 docker ps 现在不返回任何容器运行的机器。确实,现在必须使用集群特定的子命令,如 docker service docker deploy 在集群中执行任务?

Docker 1.12 brings an integrated "swarm mode", which is an exciting new take on Docker orchestration. But, have we lost the "cluster as virtual Docker host" feature in the process? Using docker run against a swarm-mode master only ever seems to start containers on the master node itself. docker ps now returns no hint of which machine each container is running on. It it true that one must now use cluster-specific subcommands like docker service and docker deploy to do things across the cluster?

推荐答案

这是一个正确的解释。您将像使用单个引擎一样管理Swarm,Swarm中管理和调度的命令正在改变。使用 docker运行 docker-compose 将定位到单个主机。需要使用 docker服务来安排群集。这个组合正在转移到您的 docker deploy 并使用 docker stack 进行管理。我想说,当您管理群组与单个节点时,不会忘记新设计的一大难点,因为您没有检查 $ DOCKER_HOST 的设置。

That's a correct interpretation. You will longer manage a Swarm as you have done with a single engine, the commands to manage and schedule in the Swarm are changing. Using docker run and docker-compose will target a single host. Using docker service is needed to schedule on the swarm. The compose is moving to bundles that you docker deploy and manage with docker stack. I'd say one huge plus of the new design is not forgetting when you're managing the swarm vs a single node because you didn't check your setting of $DOCKER_HOST.

已经使用 docker-compose bundle 考虑了迁移,没有任何东西阻止您运行旧的群集容器实现在1.12平台上,随时访问它。你不会得到1.12 Swarm的编排好处。

Migration has been considered with docker-compose bundle, and there's nothing preventing you from running the old swarm container implementation on the 1.12 platform and accessing it as you always have. You just won't get the orchestration benefits of the 1.12 Swarm.

这篇关于Docker 1.12在“群组模式”提供“单个虚拟Docker主机”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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