From b9ce995ebf706d9c37530e2766efcc778373f763 Mon Sep 17 00:00:00 2001 From: Mary Anthony Date: Tue, 15 Mar 2016 14:06:01 -0700 Subject: [PATCH] Updating the documentation Signed-off-by: Mary Anthony --- docs/scheduler/index.md | 4 +-- docs/scheduler/rescheduling.md | 65 ++++++++++++++++++++++++++++++++++ docs/scheduler/strategy.md | 2 +- 3 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 docs/scheduler/rescheduling.md diff --git a/docs/scheduler/index.md b/docs/scheduler/index.md index 44bf1cae72..1cd52f0e5b 100644 --- a/docs/scheduler/index.md +++ b/docs/scheduler/index.md @@ -12,5 +12,5 @@ weight=5 ## Advanced Scheduling -To learn more about advanced scheduling, see the [strategies](strategy.md) and -[filters](filter.md) documents. +To learn more about advanced scheduling, see the [strategies](strategy.md), +[rescheduling](rescheduling.md), and [filters](filter.md) documents. diff --git a/docs/scheduler/rescheduling.md b/docs/scheduler/rescheduling.md new file mode 100644 index 0000000000..61bc380c90 --- /dev/null +++ b/docs/scheduler/rescheduling.md @@ -0,0 +1,65 @@ + + +# Swarm Rescheduling + +You can set recheduling policies with Docker Swarm. A rescheduling policy +determines what the Swarm scheduler does for containers when the nodes they are +running on fail. + +## Rescheduling policies + +You set the reschedule policy when you start a container. You can do this with +the `reschedule` environment variable or the +`com.docker.swarm.reschedule-policy` label. If you don't specify a policy, the +default rescheduling policy is `off` which means that Swarm does not restart a +container when a node fails. + +To set the `on-node-failure` policy with a `reschedule` environment variable: + +```bash +$ docker run -d -e reschedule:on-node-failure redis +``` + +To set the same policy with a `com.docker.swarm.reschedule-policy` label: + +```bash +$ docker run -d -l 'com.docker.swarm.reschedule-policy=["on-node-failure"]' redis +``` + +## Review reschedule logs + +You can use the `docker logs` command to review the rescheduled container +actions. To do this, use the following command syntax: + +``` +docker logs SWARM_MANAGER_CONTAINER_ID +``` + +When a container is successfully rescheduled, it generates a message similar to +the following: + +``` +Rescheduled container 2536adb23 from node-1 to node-2 as 2362901cb213da321 +Container 2536adb23 was running, starting container 2362901cb213da321 +``` + +If for some reason, the new container fails to start on the new node, the log +contains: + +``` +Failed to start rescheduled container 2362901cb213da321 +``` + +## Related information + +* [Apply custom metadata](https://docs.docker.com/engine/userguide/labels-custom-metadata/) +* [Environment variables with run](https://docs.docker.com/engine/reference/run/#env-environment-variables) diff --git a/docs/scheduler/strategy.md b/docs/scheduler/strategy.md index aaee80471c..29002cb284 100644 --- a/docs/scheduler/strategy.md +++ b/docs/scheduler/strategy.md @@ -5,7 +5,7 @@ description = "Swarm strategies" keywords = ["docker, swarm, clustering, strategies"] [menu.main] parent="swarm_sched" -weight=5 +weight=6 +++