Nomad
Run Nomad jobs
This section provides guidance for running Nomad jobs. Inspect job, access logs for troubleshooting, collect resource utilization metrics, and create job versions.
The following list is the general flow for operating a job in Nomad:
- Declare the job according to the job specification.
- Plan and review the changes with a Nomad server.
- Submit the job file to a Nomad server.
- (Optional) Review job status and logs.
Refer to Create and submit a job to learn how to create a job specification, review the job plan, and submit the job.
Run a job
Execute the nomad job run command to run your job.
Now that the job is scheduled, it may or may not be running. You need to inspect the allocation status and logs to make sure the job started correctly. Refer to the section on inspecting state details ways to examine this job's state.
Update a running job
When updating a job, there are a number of built-in update strategies which may be defined in the job file. The general flow for updating an existing job in Nomad is:
- Modify the existing job file with the desired changes.
- Plan and review the changes with a Nomad server.
- Submit the job file to a Nomad server.
- (Optional) Review job status and logs.
Because the job specification defines the deployment strategy, the workflow remains the same regardless of whether this is an initial deployment or a long-running job.
Run a job in the web UI
- From the Jobs page in the web UI, click on the Run Job button in the top right of the page.
- Enter the job definition in HCL into the Job Definition field, upload a jobspec file with the Upload file button, or choose from a set of templated jobspecs with the Choose from template button.
- Click on the Plan button at the bottom of the page. Nomad plans the job and displays the scheduler dry-run results.
- Click on the Run button at the bottom of the page.
View a running job in the web UI
Nomad serves the web UI alongside the API. You can open the web UI in a web
browser with the nomad ui command or you can use the
cluster address and navigate to the /ui path.
$ nomad ui
Opening URL "https://127.0.0.1:4646"
When accessing the web UI, the first page you see is a listing of all the jobs for the default namespace. Clicking on a job takes you to the Job details page.
View a job from the CLI
You can open the details page for a job by providing the job name to the
nomad ui command.
$ nomad ui example-job-name
Opening URL "https://127.0.0.1:4646/ui/jobs/example-job-name"
View an allocation from the CLI
You can open the details page for an allocation by providing the allocation ID
to the nomad ui command.
$ nomad ui 7dc9f2d6
Opening URL "https://127.0.0.1:4646/ui/allocations/7dc9f2d6-15fc-7c39-4692-70fe653d960e"