diff --git a/engine/swarm/services.md b/engine/swarm/services.md index a7a90fc98ad..2f561ec7095 100644 --- a/engine/swarm/services.md +++ b/engine/swarm/services.md @@ -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 \ ``` - + > **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=,dst=,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:,"volume-opt=o=addr=,vers=4,soft,timeo=180,bg,tcp,rw"' > --name myservice \