Docker has released a new swarm,machine,compose.
This is the main explanation for swarm.
Previously, the user needed to operate on each Docker engine (sending rest messages or performing Docker commands).
Swarm manages a set of Docker Enginge as a cluster and provides the ability to lablel,schedule,filter.
Swarm maintains compatibility with the original Docker API, and we can manage a Docker engine cluster as if it were a single Docker engine.
Swarm can also check the health status of nodes in the cluster, and the container for HA failed nodes.
Where the scheduling section allows users to customize their own scheduling policies.
Cluster Management:
Create a cluster: $ swarm Create adds a node to the cluster: $ swarm join--token=<token>--addr=<node ip> lists the nodes in the cluster: $ swarm list--token=< Token> start swarm:$ swarm manage--token=<token>--addr=<swarm ip>
Resource management:
constraints:
How to set a constraint: Docker run-e "Constraint:operationsystem=fedora" Docker run-e "Constraint:storagedriver=aufs" filters nodes via constraints: Docker -D "Region=us-east" Docker run-e "Constraint:region=us-east" can also be more complex in the future, such as anti-affinity
support for container rescheduling:
Operations similar to--start
container scheduling process:
Similar to openstgack:1. The filter node is based on Port,label,health2. Weight node, select the optimal node support bin packing and the random connection.
Reference:
Https://speakerdeck.com/vieux/docker-swarm
[Preliminary discussion on Docker]swarm