- A Cloud Guru
Using Spread Job Placement for a Nomad Job in a Cluster
In this lab, we will be creating a job in Nomad that runs 10 allocations. We will set this up in such a way that 70% of the allocations will go to one location and 30% of allocations will go to another. To accomplish this, we will use spread job placement to spread the jobs around our cluster.
Table of Contents
Log in to the Provided Nomad Server
Log into the server as "cloud_user" with the provided password to perform the tasks.
Create a Job and Add a Weighting of 70% for dc1
You will create a Nomad job called spread-test.nomad. As part of the job creation, you will set it to start 10 allocations. This job will make use of a Nomad stanza to spread the allocations between two data centers, dc1 and dc2, with 70% of the allocations going to dc1.
Submit the Job to Run in the Cluster
Submit the job you created to run in the cluster. The job should start 10 copies of the job.
Check How Many Jobs are Running in Which Datacenters
When you check the number of running jobs, 7 should be in dc1 and 3 should be in dc2.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.