# Docker 三剑客

为了把容器化技术的优点发挥到极致，docker公司先后推出了三大技术:`docker-machine`,`docker-compose`,`docker-swarm`，可以说是几乎实现了容器化技术中所有可能需要的底层技术手段。

![](/files/-LfnTJbWOFsnw9_6uQ3t)

* docker-machine - 提供容器服务
* docker-compose - 提供脚本执行服务，不用在像以前把容器的启动命令写的非常的长，用compose编写脚本就能简化容器的启动
* 几条简单指令就可以创建一个docker集群，最终实现分布式的服务

## 去中心化的设计

docker-swarm是去中心化的设计，思想与redis cluster集群，pcx集群很像

![](/files/-LfnTJbY2luqAp8sGhuf)

docker-swarm节点：

* Manager 节点：管理swarm集群等其他事情。
* Worker节点：工作节点，运行容器部署项目的。

不管是Manager 节点，还是Worker节点都可以部署多节点。一个Manage节点down机，那么剩余的节点会选举一个新的Manager节点来管理swarm集群，Worker节点同理。

参考资料：

[Docker三剑客实践之部署集群](https://www.jianshu.com/p/0e231a928ee6)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docker.shujuwajue.com/docker-ji-qun.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
