Hashicorp Nomad commands

Show consul agents (for dynamic clusters)

consul members

Show servers

nomad server-members

Show nodes

nomad node-status
nomad node-status -stats <node_id>

Show running jobs

nomad status
nomad status example

Show logs of an allocation

nomad logs -f -tail -n 10 <alloc_id>
nomad logs -f -tail -n 10 -stderr <alloc_id>

Show allocations

curl -XGET
curl -XGET "<prefix>"
curl -XGET<id>

Extract all current allocations in a file

curl -s -XGET | python -mjson.tool > extract.json
# inside vim, to know the nb of allocs in a state: :%s/ClientStatus": "running//gn
# or, if you want to list all current states : cat extract.json | grep '"State'

Trigger garbage collector

curl -XPUT
  • nomad.txt
  • Last modified: 2019/06/02 17:48
  • by jdx