LinuxCommandLibrary

nomad

Manage and schedule applications across distributed machines

TLDR

Show the status of nodes in the cluster

$ nomad node status
copy

Validate a job file
$ nomad job validate [path/to/file.nomad]
copy

Plan a job for execution on the cluster
$ nomad job plan [path/to/file.nomad]
copy

Run a job on the cluster
$ nomad job run [path/to/file.nomad]
copy

Show the status of jobs currently running on the cluster
$ nomad job status
copy

Show the detailed status information about a specific job
$ nomad job status [job_name]
copy

Follow the logs of a specific allocation
$ nomad alloc logs [alloc_id]
copy

Show the status of storage volumes
$ nomad volume status
copy

SYNOPSIS

nomad [global options] <command> [subcommand options] [arguments]

Common commands include:
  nomad agent [options]
  nomad job <subcommand> [options] [args]
  nomad status [options] [<job-id>]
  nomad alloc <subcommand> [options] [args]
  nomad node <subcommand> [options] [args]

PARAMETERS

-address=<addr>
    Address of the Nomad server to connect to (e.g., http://127.0.0.1:4646).

-region=<region>
    The region of the Nomad servers to make API requests against.

-namespace=<namespace>
    The target namespace for the command (default: 'default').

-log-level=<level>
    Sets the Nomad agent's log level (e.g., info, debug, trace).

-config=<path>
    Path to a configuration file or directory for the Nomad agent.

-version
    Prints the Nomad version and exits.

-non-interactive
    Disables interactive mode for commands that might prompt for user input.

(Subcommand-specific options)
    Many Nomad subcommands (e.g., nomad agent, nomad job run) have their own extensive sets of options. Examples include -dev for starting a development agent, -server to enable server mode, or -data-dir for specifying data storage paths.

DESCRIPTION

HashiCorp Nomad is a flexible and efficient workload orchestrator that enables organizations to deploy, manage, and scale applications across diverse infrastructures. It supports various workload types, including containerized (Docker, Podman), virtualized (QEMU, Firecracker), and raw executables, making it highly adaptable to different environments. Nomad simplifies infrastructure management by providing a single workflow for scheduling applications on bare metal, virtual machines, or cloud instances. It integrates seamlessly with other HashiCorp tools like Consul for service discovery and Vault for secrets management. Its lightweight design and single binary make it easy to operate, while its powerful scheduling capabilities ensure optimal resource utilization and high availability for services. Nomad focuses on operational simplicity and a broad range of workload compatibility, providing a robust alternative to more complex orchestrators.

CAVEATS

Nomad requires a running agent (server or client) to function, either locally or remotely. Job definitions are typically written in HashiCorp Configuration Language (HCL), which requires familiarity with its syntax. Proper understanding of its architecture and integration with other tools (like Consul and Vault) is crucial for secure and efficient production deployments. Resource management and task scheduling in large-scale deployments often require careful tuning for optimal performance.

<I>ARCHITECTURE</I>

Nomad operates with a client-server architecture. Servers manage the cluster state, handle job submissions, and make scheduling decisions, utilizing a consensus protocol (Raft) for high availability. Clients register with servers, provide available resources, and execute tasks based on server instructions. Communication occurs over RPC.

<I>WORKLOAD DRIVERS</I>

Nomad supports various workload types through its extensible driver system. This includes Docker containers, QEMU virtual machines, Java Jar files, raw executables, and more. This flexibility allows a single Nomad cluster to schedule diverse applications, optimizing resource utilization across different technology stacks.

HISTORY

Nomad was open-sourced by HashiCorp in September 2015, building on their experience with Vagrant, Consul, and Vault. It was conceived as a lightweight, flexible, and highly available scheduler capable of orchestrating a wide range of workloads, not limited to just containers. This broad applicability differentiated it from other orchestrators emerging at the time. Since its initial release, Nomad has continuously evolved, adding support for more workload drivers (e.g., Podman, Firecracker), advanced scheduling features, and enterprise capabilities, while maintaining its core tenets of operational simplicity and comprehensive workload compatibility.

SEE ALSO

docker(1), kubernetes(1), consul(1), vault(1), terraform(1), systemd(1)

Copied to clipboard