简体   繁体   English

Docker 1.12中的单机Swarm

[英]Single machine Swarm in Docker 1.12

I would like to create docker-compose file in my development environment and use it to spin up a single machine "swarm". 我想在我的开发环境中创建docker-compose文件,并使用它来启动单个机器“swarm”。 The goal would be to have the development environment be as consistent as possible with the CI, QA, and Prod environments. 目标是使开发环境尽可能与CI,QA和Prod环境保持一致

I used docker a year+ ago but a lot has changed and I'm very interested in using 1.12 as my platform. 我在一年前使用了docker但是很多都改变了,我对使用1.12作为我的平台非常感兴趣。 My questions are as follows: 我的问题如下:

  1. What is the difference between a "node" and a "physical machine"? “节点”和“物理机器”之间有什么区别? Can a single machine (aka, a developer laptop) host multiple node's? 一台机器(也就是开发商笔记本电脑)可以托管多个节点吗? My guess is that a node is virtual and that I should be able to have more than one but don't feel certain of it. 我的猜测是一个节点是虚拟的 ,我应该能够拥有多个节点,但不能确定它。
  2. Assuming answer to #1 is that it is possible ... is there any reason these various nodes can't be "swarm workers" along with a singular "manager" all running on the laptop? 假设对#1的回答是可能的......是否有任何理由这些不同的节点不能成为“群体工作者”以及笔记本电脑上运行的单个“经理”?

Note: I know it would be possible with VM's to emulate other machines -- many of the examples start off by doing this -- but I want to avoid running any VMs to lower the resource cost of running this setup 注意:我知道VM可以模拟其他机器 - 许多示例都是从这样做开始的 - 但是我想避免运行任何VM来降低运行此设置的资源成本

Are there any good examples of single-node swarms people can refer me to? 有没有人可以引用我的单节点群的好例子?

A node in the docker swarm is an instance of the docker engine configured in the swarm (with an init or join). docker swarm中的节点是在swarm中配置的docker引擎的实例(具有init或join)。 An instance of a docker engine can only join up to a single swarm (so 0 or 1), so you can't create multiple nodes on the same engine. docker引擎的实例最多只能连接一个swarm(0或1),因此您无法在同一引擎上创建多个节点。 A typical developer install to test multiple nodes in a swarm is to spin up multiple VM's, each with a docker install. 测试群中多个节点的典型开发人员安装是启动多个VM,每个VM都有一个docker安装。

You can have a swarm with a single manager which is also a worker. 您可以拥有一个拥有单个经理的群,这也是一个工人。 Tasks scheduled in a swarm may be scheduled on a manager just as they would a worker. 群组中安排的任务可以像管理员一样安排在管理员身上。 Workers have no ability to manage the swarm, but managers have all the abilities of a worker. 工人无法管理群体,但管理者拥有工人的所有能力。 If you want to simply be able to run docker service commands, you can do a docker swarm init on yourself and then define your services there. 如果你想简单地运行docker service命令,你可以自己做一个docker swarm init ,然后在那里定义你的服务。

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

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