你能解释一下 swarm machine 的作用吗?

Can you explain roles of swarm machine?

http://docs.docker.com/swarm/install-w-machine/

有四台机器:

  1. 本地,swarm create 将运行
  2. 群主
  3. swarm-agent-00
  4. swarm-agent-01

我的理解是swarm-master会控制agent,但是Local是用来做什么的?

它用于使用 Docker Swarm 镜像生成发现令牌。
该令牌在创建 swarm master 时使用。

This discovery service associates a token with instances of the Docker Daemon running on each node. Other discovery service backends such as etcd, consul, and zookeeper are available.

所以 "local" 机器在那里确保集群管理器发现节点。它的功能是:

  • register: 注册一个新节点
  • watch: 群管理器的回调方法
  • fetch: 获取条目列表

参见this introduction