Running Jobs in Remote Regions

As described in fault domain awareness and capacity extension for services, DC/OS supports fault domain awareness. If your cluster is configured over multiple regions or zones, it is possible to schedule your Metronome job to run in a remote region, or a specific zone.

Local and remote regions

  • The local region is the region running the Mesos master nodes.
  • A remote region contains only Mesos agent nodes.

Use

Placement constraint guidelines

  • If no region is specified in your job, jobs will be scheduled to run only in the local region. No job run will ever be scheduled for an agent outside of the local region unless you explicitly specify that it should be launched in a remote region.

  • If you specify a region without a specific zone, jobs will run on any agent in the given region.

  • If you specify both region and zone, jobs are run on any agent in the given region and zone, and not in any other region or zone.

Examples

See “Installation” in fault domain awareness and capacity extension for services for instructions on how to configure a fault-domain aware cluster.

Suppose you have a Mesos cluster that spans 3 regions: aws-us-east1, aws-us-east2, and local. Each region has zones a,b,c,d.

Run a job in a remote region and a specific zone

The following job uses Metronome Constraints to specify that a job should run in region aws-us-east1, zone b

  1. {
  2. "description": "Remote Sleeper",
  3. "id": "sleeper-remote",
  4. "run": {
  5. "cmd": "sleep 60",
  6. "cpus": 0.05,
  7. "mem": 32,
  8. "docker": {"image": "alpine"},
  9. "maxLaunchDelaySeconds": 300,
  10. "placement": {
  11. "constraints": [
  12. {
  13. "attribute": "@region",
  14. "operator": "EQ",
  15. "value": "aws-us-east1"
  16. },
  17. {
  18. "attribute": "@zone",
  19. "operator": "EQ",
  20. "value": "b"
  21. },
  22. ]
  23. }
  24. }
  25. }