Command: node status
The node status
command is used to display information about client nodes. A
node must first be registered with the servers before it will be visible in this
output.
Usage
If no node ID is passed, then the command will enter "list mode" and dump a high-level list of all known nodes. This list output contains less information but is a good way to get a bird's-eye view of things.
If there is an exact match based on the provided node ID or prefix, then that
particular node will be queried, and detailed information will be displayed,
including resource usage statistics. Otherwise, a list of matching nodes and
information will be displayed. If running the command on a Nomad Client, the
-self
flag is useful to quickly access the status of the local node.
General Options
-address=<addr>
: The address of the Nomad server. Overrides theNOMAD_ADDR
environment variable if set. Defaults tohttp://127.0.0.1:4646
.-region=<region>
: The region of the Nomad server to forward commands to. Overrides theNOMAD_REGION
environment variable if set. Defaults to the Agent's local region.-no-color
: Disables colored command output. Alternatively,NOMAD_CLI_NO_COLOR
may be set.-ca-cert=<path>
: Path to a PEM encoded CA cert file to use to verify the Nomad server SSL certificate. Overrides theNOMAD_CACERT
environment variable if set.-ca-path=<path>
: Path to a directory of PEM encoded CA cert files to verify the Nomad server SSL certificate. If both-ca-cert
and-ca-path
are specified,-ca-cert
is used. Overrides theNOMAD_CAPATH
environment variable if set.-client-cert=<path>
: Path to a PEM encoded client certificate for TLS authentication to the Nomad server. Must also specify-client-key
. Overrides theNOMAD_CLIENT_CERT
environment variable if set.-client-key=<path>
: Path to an unencrypted PEM encoded private key matching the client certificate from-client-cert
. Overrides theNOMAD_CLIENT_KEY
environment variable if set.-tls-server-name=<value>
: The server name to use as the SNI host when connecting via TLS. Overrides theNOMAD_TLS_SERVER_NAME
environment variable if set.-tls-skip-verify
: Do not verify TLS certificate. This is highly not recommended. Verification will also be skipped ifNOMAD_SKIP_VERIFY
is set.-token
: The SecretID of an ACL token to use to authenticate API requests with. Overrides theNOMAD_TOKEN
environment variable if set.
Status Options
-self
: Query the status of the local node.-stats
: Display detailed resource usage statistics.-allocs
: When a specific node is not being queried, shows the number of running allocations per node.-short
: Display short output. Used only when querying a single node.-verbose
: Show full information.-json
: Output the node in its JSON format.-t
: Format and display node using a Go template.
Examples
List view:
List view, with running allocations:
Single-node view in short mode:
Full output for a single node:
Using -self
when on a Nomad Client:
You will note that in the above examples, the Allocations output contains columns labeled Desired Status and Client status.
Desired Status represents the goal of the scheduler on the allocation with the following valid statuses:
- run: The allocation should run
- stop: The allocation should stop
Client Status represents the emergent state of the allocation and include the following:
pending: The allocation is pending and will be running
running: The allocation is currently running
complete: The allocation was running and completed successfully
failed: The allocation was running and completed with a non-zero exit code
lost: The node that was running the allocation has failed or has been partitioned
Using -stats
to see detailed to resource usage information on the node:
To view verbose information about the node: