mirror of https://github.com/docker/docs.git
swarm: Add note about placement preferences
Docker 1.14 is adding a new feature called "placement preferences". This adds a note about them, and a pointer to the "service create" reference that explains them in detail. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
parent
5d225d3c63
commit
a73be0d5a6
|
@ -289,7 +289,18 @@ $ docker service create \
|
|||
Service constraints let you set criteria for a node to meet before the scheduler
|
||||
deploys a service to the node. You can apply constraints to the
|
||||
service based upon node attributes and metadata or engine metadata. For more
|
||||
information on constraints, refer to the `docker service create` [CLI reference](/engine/reference/commandline/service_create.md).
|
||||
information on constraints, refer to the `docker service create`
|
||||
[CLI reference](/engine/reference/commandline/service_create.md).
|
||||
|
||||
Use placement preferences to divide tasks evenly over different categories of
|
||||
nodes. An example of where this may be useful is balancing tasks between
|
||||
multiple datacenters or availability zones. In this case, you can use a
|
||||
placement preference to spread out tasks to multiple datacenters and make the
|
||||
service more resilient in the face of a localized outage. You can use
|
||||
additional placement preferences to further divide tasks over groups of nodes.
|
||||
For example, you can balance them over multiple racks within each datacenter.
|
||||
For more information on constraints, refer to the `docker service create`
|
||||
[CLI reference](/engine/reference/commandline/service_create.md).
|
||||
|
||||
### Reserving memory or number of CPUs for a service
|
||||
|
||||
|
@ -553,15 +564,14 @@ $ docker service create \
|
|||
--name myservice \
|
||||
<IMAGE>
|
||||
```
|
||||
|
||||
|
||||
> **Important:** If your volume driver accepts a comma-separated list as an option,
|
||||
> you must escape the value from the outer CSV parser. To escape a `volume-opt`,
|
||||
> surround it with double quotes (`"`) and surround the entire mount parameter
|
||||
> with single quotes (`'`).
|
||||
>
|
||||
>
|
||||
> For example, the `local` driver accepts mount options as a comma-separated
|
||||
> list in the `o` parameter. This example shows the correctly to escape the list.
|
||||
>
|
||||
> $ docker service create \
|
||||
> --mount 'type=volume,src=<VOLUME-NAME>,dst=<CONTAINER-PATH>,volume-driver=local,volume-opt=type=nfs,volume-opt=device=<nfs-server>:<nfs-path>,"volume-opt=o=addr=<nfs-address>,vers=4,soft,timeo=180,bg,tcp,rw"'
|
||||
> --name myservice \
|
||||
|
|
Loading…
Reference in New Issue