Nomad
Stop Nomad and clean up
In this tutorial, you will clean up the Nomad jobs that are running in the cluster and stop or destroy the cluster.
Clean up the application
Stop and clean up the employee job. You can remove the -purge
flag from the following commands if you want to keep the job data around for debugging or further investigation.
$ nomad job stop -purge pytechco-employee
Then, do the same with the webapp job.
$ nomad job stop -purge pytechco-web
==> 2023-03-10T12:24:45-05:00: Monitoring evaluation "d4079a21"
2023-03-10T12:24:45-05:00: Evaluation triggered by job "pytechco-web"
2023-03-10T12:24:45-05:00: Evaluation within deployment: "cdb7d282"
2023-03-10T12:24:45-05:00: Evaluation status changed: "pending" -> "complete"
==> 2023-03-10T12:24:45-05:00: Evaluation "d4079a21" finished with status "complete"
==> 2023-03-10T12:24:45-05:00: Monitoring deployment "cdb7d282"
✓ Deployment "cdb7d282" successful
2023-03-10T12:24:45-05:00
ID = cdb7d282
Job ID = pytechco-web
Job Version = 0
Status = successful
Description = Deployment completed successfully
Deployed
Task Group Desired Placed Healthy Unhealthy Progress Deadline
ptc-web 1 1 1 0 2023-03-10T17:26:57Z
Then, the database job.
$ nomad job stop -purge pytechco-redis
==> 2023-03-10T12:25:00-05:00: Monitoring evaluation "25608f76"
2023-03-10T12:25:00-05:00: Evaluation triggered by job "pytechco-redis"
2023-03-10T12:25:00-05:00: Evaluation within deployment: "0ea05651"
2023-03-10T12:25:00-05:00: Evaluation status changed: "pending" -> "complete"
==> 2023-03-10T12:25:00-05:00: Evaluation "25608f76" finished with status "complete"
==> 2023-03-10T12:25:00-05:00: Monitoring deployment "0ea05651"
✓ Deployment "0ea05651" successful
2023-03-10T12:25:00-05:00
ID = 0ea05651
Job ID = pytechco-redis
Job Version = 0
Status = successful
Description = Deployment completed successfully
Deployed
Task Group Desired Placed Healthy Unhealthy Progress Deadline
ptc-redis 1 1 1 0 2023-03-10T17:26:23Z
Finally, stop and clean up the setup job.
$ nomad job stop -purge pytechco-setup
Clean up the cluster
Clean up the resources in use by stopping Nomad if you are running a local cluster or by destroying the cloud infrastructure with Terraform.
Open the terminal tab running the Nomad dev agent and press CTRL+C
to stop it.
Next steps
In this collection, you learned about Nomad, installed the Nomad CLI, created a cluster locally and in the cloud, and deployed and updated Nomad jobs.
There are many directions you can go next to continue your learning so check out some of the tutorials and documentation below.