edit-icon download-icon

Container rescheduling

Last Updated: Feb 12, 2018

Template version

Compose V1/V2 Compose V3
The reschedule:on-node-failure environment variable or label. No additional setting is needed. The replicated service can guarantee the automatic migration of containers.

Compose V1/V2

Container Service supports rescheduling Docker containers. When a node is invalid, the container can be automatically scheduled to other available node for operation.

By default, container rescheduling is disabled. If needed, you can enable the container rescheduling.

Container Service provides a container rescheduling policy that is compatible with Docker Swarm. You can enable container rescheduling by using environment variable or label.

Environment variable:

  1. redis:
  2. image: redis
  3. environment:
  4. - reschedule:on-node-failure

Label:

  1. web:
  2. image: nginx
  3. restart: always
  4. environment:
  5. - aaaaa=aaaaa
  6. labels:
  7. aliyun.scale: "3"
  8. com.docker.swarm.reschedule-policies: "[\"on-node-failure\"]"

Note: After the container is rescheduled, use the Docker file volume that supports data migration or sharing to recover the persistent status required by the Docker container.

Thank you! We've received your feedback.