Skip to content

Instantly share code, notes, and snippets.

@marcomalva
Last active December 9, 2022 20:00
Show Gist options
  • Save marcomalva/3402fbd58dc4fc404bcecaa957d0cb6c to your computer and use it in GitHub Desktop.
Save marcomalva/3402fbd58dc4fc404bcecaa957d0cb6c to your computer and use it in GitHub Desktop.
[Nomad Commands]Useful nomad Commands #nomad #deploy
# various useful nomad commands
#
# listed in pseudo pet style, i.e. "<xyz>" prompts the user to supply a value for xyz
# * [GitHub - knqyf263/pet: Simple command-line snippet manager, written in Go.](https://github.com/knqyf263/pet)
# * [document cli command options](http://docopt.org/)
# * [Utility Conventions](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_01)
# list dead jobs that are not batch (periodic)
# any job listed indicates a failed deployment,
# that is a deployed job that did not remain running
nomad status | grep dead | grep -wv batch
# find a job for a specific tenant
nomad status | grep "<tenant_name>"
# list of nomad instances
nomad status
# details of specific instance
nomad status name_of_instance
# tail last N lines of deployed job
nomad logs -tail -n "<N=30>" -job "<job_name>"
# tail follow last N lines of deployed job
nomad logs -tail -f -n "<N=30>" -job "<job_name>"
# error log of specific instance
nomad log --stderr <id_of_instance>
# stdout of specific instance
nomad log <id_of_instance>
nomad log -tail -n <N=50> <id_of_instance>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment