Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove dead jobs from nomad status

Tags:

nomad

I was running a cron (periodic) job through nomad which ran every 30 sec, the job does nothing but just

echo "some string"

and hence ends immediately

when I do

nomad status

I get all the dead jobs also-- the jobs that have finished executing, which are useless to me. Is there some way to remove the dead jobs?

PS: one obvious solution is to grep out the dead jobs, any solution provided by nomad?

like image 310
coda Avatar asked Apr 10 '18 05:04

coda


People also ask

How do I stop a Nomad server?

In the shell session running your dev agent, use Ctrl-C , the interrupt signal, to stop the agent. By gracefully leaving, Nomad servers notify their peers they intend to leave.


1 Answers

Dead/Completed jobs are cleaned up in accordance to the garbage collection interval.

You can force garbage collection using the System API endpoint which will run the global garbage collector. The CURL command would look like:

$ curl -X PUT http://localhost:4646/v1/system/gc

If you wish to lower the GC interval permanently for jobs, you can use the job_gc_threshold configuration parameter within the server config stanza.

like image 171
James Rasell Avatar answered Oct 09 '22 19:10

James Rasell