Merge pull request #6532 from hashicorp/docs-fixup-command

Fixup for command section of website
This commit is contained in:
Charlie Voiselle 2019-10-30 10:32:37 -04:00 committed by GitHub
commit 946af42906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
84 changed files with 977 additions and 774 deletions

View File

@ -17,16 +17,16 @@ Usage: `nomad acl <subcommand> [options]`
Run `nomad acl <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`acl bootstrap`][bootstrap] - Bootstrap the initial ACL token
* [`acl policy apply`][policyapply] - Create or update ACL policies
* [`acl policy delete`][policydelete] - Delete an existing ACL policies
* [`acl policy info`][policyinfo] - Fetch information on an existing ACL policy
* [`acl policy list`][policylist] - List available ACL policies
* [`acl token create`][tokencreate] - Create new ACL token
* [`acl token delete`][tokendelete] - Delete an existing ACL token
* [`acl token info`][tokeninfo] - Get info on an existing ACL token
* [`acl token self`][tokenself] - Get info on self ACL token
* [`acl token update`][tokenupdate] - Update existing ACL token
- [`acl bootstrap`][bootstrap] - Bootstrap the initial ACL token
- [`acl policy apply`][policyapply] - Create or update ACL policies
- [`acl policy delete`][policydelete] - Delete an existing ACL policies
- [`acl policy info`][policyinfo] - Fetch information on an existing ACL policy
- [`acl policy list`][policylist] - List available ACL policies
- [`acl token create`][tokencreate] - Create new ACL token
- [`acl token delete`][tokendelete] - Delete an existing ACL token
- [`acl token info`][tokeninfo] - Get info on an existing ACL token
- [`acl token self`][tokenself] - Get info on self ACL token
- [`acl token update`][tokenupdate] - Update existing ACL token
[bootstrap]: /docs/commands/acl/bootstrap.html
[policyapply]: /docs/commands/acl/policy-apply.html

View File

@ -12,7 +12,7 @@ The `acl bootstrap` command is used to bootstrap the initial ACL token.
## Usage
```
```plaintext
nomad acl bootstrap [options]
```
@ -26,7 +26,7 @@ The `acl bootstrap` command requires no arguments.
Bootstrap the initial token:
```
```shell
$ nomad acl bootstrap
Accessor ID = 5b7fd453-d3f7-6814-81dc-fcfe6daedea5
Secret ID = 9184ec35-65d4-9258-61e3-0c066d0a45c5

View File

@ -12,12 +12,12 @@ The `acl policy apply` command is used to create or update ACL policies.
## Usage
```
```plaintext
nomad acl policy apply [options] <name> <path>
```
The `acl policy apply` command requires two arguments, the policy name and path to file.
The policy can be read from stdin by setting the path to "-".
The `acl policy apply` command requires two arguments, the policy name and path
to file. The policy can be read from stdin by setting the path to "-".
## General Options
@ -25,13 +25,13 @@ The policy can be read from stdin by setting the path to "-".
## Apply Options
* `-description`: Sets the human readable description for the ACL policy.
- `-description`: Sets the human readable description for the ACL policy.
## Examples
Create a new ACL Policy:
```
```shell
$ nomad acl policy apply my-policy my-policy.json
Successfully wrote 'my-policy' ACL policy!
```

View File

@ -12,7 +12,7 @@ The `acl policy delete` command is used to delete an existing ACL policies.
## Usage
```
```plaintext
nomad acl policy delete <policy_name>
```
@ -26,7 +26,7 @@ The `acl policy delete` command requires the policy name as an argument.
Delete an ACL Policy:
```
```shell
$ nomad acl policy delete my-policy
Successfully deleted 'my-policy' ACL policy!
```

View File

@ -14,7 +14,7 @@ policy.
## Usage
```
```plaintext
nomad acl policy info <name>
```
@ -28,7 +28,7 @@ The `acl policy info` command requires the policy name.
Fetch information on an existing ACL Policy:
```
```shell
$ nomad acl policy info my-policy
Name = my-policy
Description = <none>

View File

@ -12,25 +12,24 @@ The `acl policy list` command is used to list available ACL policies.
## Usage
```
```plaintext
nomad acl policy list
```
## General Options
<%= partial "docs/commands/_general_options" %>
#
## List Options
* `-json` : Output the policies in their JSON format.
* `-t` : Format and display the policies using a Go template.
- `-json` : Output the policies in their JSON format.
- `-t` : Format and display the policies using a Go template.
## Examples
List all ACL policies:
```
```shell
$ nomad acl policy list
Name Description
policy-1 The first policy

View File

@ -12,7 +12,7 @@ The `acl token create` command is used to create new ACL tokens.
## Usage
```
```plaintext
nomad acl token create [options]
```
@ -24,20 +24,22 @@ The `acl token create` command requires no arguments.
## Create Options
* `-name`: Sets the human readable name for the ACL token.
- `-name`: Sets the human readable name for the ACL token.
* `-type`: Sets the type of token. Must be one of "client" (default), or "management".
- `-type`: Sets the type of token. Must be one of "client" (default), or
"management".
* `-global`: Toggles the global mode of the token. Global tokens are replicated to all regions. Defaults false.
- `-global`: Toggles the global mode of the token. Global tokens are replicated
to all regions. Defaults false.
* `-policy`: Specifies a policy to associate with the token. Can be specified multiple times,
but only with client type tokens.
- `-policy`: Specifies a policy to associate with the token. Can be specified
multiple times, but only with client type tokens.
## Examples
Create a new ACL token:
```
```shell
$ nomad acl token create -name="my token" -policy=foo -policy=bar
Accessor ID = d532c40a-30f1-695c-19e5-c35b882b0efd
Secret ID = 85310d07-9afa-ef53-0933-0c043cd673c7

View File

@ -12,7 +12,7 @@ The `acl token delete` command is used to delete existing ACL tokens.
## Usage
```
```plaintext
nomad acl token delete <token_accessor_id>
```
@ -26,7 +26,7 @@ The `acl token delete` command requires an existing token's AccessorID.
Delete an existing ACL token:
```
```shell
$ nomad acl token delete d532c40a-30f1-695c-19e5-c35b882b0efd
Token d532c40a-30f1-695c-19e5-c35b882b0efd successfully deleted

View File

@ -12,7 +12,7 @@ The `acl token info` command is used to fetch information about an existing ACL
## Usage
```
```plaintext
nomad acl token info <token_accessor_id>
```
@ -26,7 +26,7 @@ The `acl token info` command requires an existing token's AccessorID.
Fetch information about an existing ACL token:
```
```shell
$ nomad acl token info d532c40a-30f1-695c-19e5-c35b882b0efd
Accessor ID = d532c40a-30f1-695c-19e5-c35b882b0efd
Secret ID = 85310d07-9afa-ef53-0933-0c043cd673c7

View File

@ -12,25 +12,24 @@ The `acl token list` command is used to list existing ACL tokens.
## Usage
```
```plaintext
nomad acl token list
```
## General Options
<%= partial "docs/commands/_general_options" %>
#
## List Options
* `-json` : Output the tokens in their JSON format.
* `-t` : Format and display the tokens using a Go template.
- `-json` : Output the tokens in their JSON format.
- `-t` : Format and display the tokens using a Go template.
## Examples
List all ACL tokens:
```
```shell
$ nomad acl token list
Name Type Global Accessor ID
Bootstrap Token management true 32b61154-47f1-3694-1430-a5544bafcd3e

View File

@ -9,11 +9,12 @@ description: >
# Command: acl token self
The `acl token self` command is used to fetch information about the currently set ACL token.
The `acl token self` command is used to fetch information about the currently
set ACL token.
## Usage
```
```plaintext
nomad acl token self
```
@ -25,7 +26,7 @@ nomad acl token self
Fetch information about an existing ACL token:
```
```shell
$ export NOMAD_TOKEN=d532c40a-30f1-695c-19e5-c35b882b0efd
$ nomad acl token self

View File

@ -12,7 +12,7 @@ The `acl token update` command is used to update existing ACL tokens.
## Usage
```
```plaintext
nomad acl token update [options] <token_accessor_id>
```
@ -24,20 +24,22 @@ The `acl token update` command requires an existing token's accessor ID.
## Create Options
* `-name`: Sets the human readable name for the ACL token.
- `-name`: Sets the human readable name for the ACL token.
* `-type`: Sets the type of token. Must be one of "client" (default), or "management".
- `-type`: Sets the type of token. Must be one of "client" (default), or
"management".
* `-global`: Toggles the global mode of the token. Global tokens are replicated to all regions. Defaults false.
- `-global`: Toggles the global mode of the token. Global tokens are replicated
to all regions. Defaults false.
* `-policy`: Specifies a policy to associate with the token. Can be specified multiple times,
but only with client type tokens.
- `-policy`: Specifies a policy to associate with the token. Can be specified
multiple times, but only with client type tokens.
## Examples
Update an existing ACL token:
```
```shell
$ nomad acl token update -name="my updated token" -policy=foo -policy=bar d532c40a-30f1-695c-19e5-c35b882b0efd
Accessor ID = d532c40a-30f1-695c-19e5-c35b882b0efd
Secret ID = 85310d07-9afa-ef53-0933-0c043cd673c7

View File

@ -14,7 +14,7 @@ is connected to. This is useful for troubleshooting and performance monitoring.
## Usage
```
```plaintext
nomad agent-info [options]
```
@ -27,15 +27,15 @@ nomad agent-info [options]
Depending on the agent queried, information from different subsystems is
returned. These subsystems are described below:
* client - Status of the local Nomad client
* nomad - Status of the local Nomad server
* serf - Gossip protocol metrics and information
* raft - Status information about the Raft consensus protocol
* runtime - Various metrics from the runtime environment
- client - Status of the local Nomad client
- nomad - Status of the local Nomad server
- serf - Gossip protocol metrics and information
- raft - Status information about the Raft consensus protocol
- runtime - Various metrics from the runtime environment
## Examples
```
```shell
$ nomad agent-info
raft
commit_index = 0

View File

@ -0,0 +1,226 @@
---
layout: "docs"
page_title: "Commands: agent"
sidebar_current: "docs-commands-_agent" # Use "_" to break prefix match
description: >
The agent command is the main entrypoint to running a Nomad client
or server.
---
# Command: agent
The agent command is the heart of Nomad: it runs the agent that handles client
or server functionality, including exposing interfaces for client consumption
and running jobs.
Due to the power and flexibility of this command, the Nomad agent is documented
in its own section. See the [Nomad Agent] guide and the [Configuration]
documentation section for more information on how to use this command and the
options it has.
## Command-line Options
A subset of the available Nomad agent configuration can optionally be passed in
via CLI arguments. The `agent` command accepts the following arguments:
- `-alloc-dir=<path>`: Equivalent to the Client [alloc_dir] config
option.
- `-acl-enabled`: Equivalent to the ACL [enabled] config option.
- `-acl-replication-token`: Equivalent to the ACL [replication_token] config
option.
- `-bind=<address>`: Equivalent to the [bind_addr] config option.
- `-bootstrap-expect=<num>`: Equivalent to the
[bootstrap_expect] config option.
- `-client`: Enable client mode on the local agent.
- `-config=<path>`: Specifies the path to a configuration file or a directory of
configuration files to load. Can be specified multiple times.
- `-consul-address=<addr>`: Equivalent to the [address] config option.
- `-consul-auth=<auth>`: Equivalent to the [auth] config option.
- `-consul-auto-advertise`: Equivalent to the [auto_advertise] config option.
- `-consul-ca-file=<path>`: Equivalent to the [ca_file] config option.
- `-consul-cert-file=<path>`: Equivalent to the [cert_file] config option.
- `-consul-checks-use-advertise`: Equivalent to the [checks_use_advertise]
config option.
- `-consul-client-auto-join`: Equivalent to the [client_auto_join] config
option.
- `-consul-client-service-name=<name>`: Equivalent to the [client_service_name]
config option.
- `-consul-client-http-check-name=<name>`: Equivalent to the
[client_http_check_name] config option.
- `-consul-key-file=<path>`: Equivalent to the [key_file] config option.
- `-consul-server-service-name=<name>`: Equivalent to the [server_service_name]
config option.
- `-consul-server-http-check-name=<name>`: Equivalent to the
[server_http_check_name] config option.
- `-consul-server-serf-check-name=<name>`: Equivalent to the
[server_serf_check_name] config option.
- `-consul-server-rpc-check-name=<name>`: Equivalent to the
[server_rpc_check_name] config option.
- `-consul-server-auto-join`: Equivalent to the [server_auto_join] config
option.
- `-consul-ssl`: Equivalent to the [ssl] config option.
- `-consul-token=<token>`: Equivalent to the [token] config option.
- `-consul-verify-ssl`: Equivalent to the [verify_ssl] config option.
- `-data-dir=<path>`: Equivalent to the [data_dir] config option.
- `-dc=<datacenter>`: Equivalent to the [datacenter] config option.
- `-dev`: Start the agent in development mode. This enables a pre-configured
dual-role agent (client + server) which is useful for developing or testing
Nomad. No other configuration is required to start the agent in this mode,
but you may pass an optional comma-separated list of mode configurations:
- `-dev-connect`: Start the agent in development mode, but bind to a public
network interface rather than localhost for using Consul Connect. This mode
is supported only on Linux as root.
- `-encrypt`: Set the Serf encryption key. See the [Encryption Overview] for
more details.
- `-join=<address>`: Address of another agent to join upon starting up. This can
be specified multiple times to specify multiple agents to join.
- `-log-level=<level>`: Equivalent to the [log_level] config option.
- `-log-json`: Equivalent to the [log_json] config option.
- `-meta=<key=value>`: Equivalent to the Client [meta] config option.
- `-network-interface=<interface>`: Equivalent to the Client
[network_interface] config option.
- `-network-speed=<MBits>`: Equivalent to the Client
[network_speed] config option.
- `-node=<name>`: Equivalent to the [name] config option.
- `-node-class=<class>`: Equivalent to the Client [node_class]
config option.
- `-plugin-dir=<path>`: Equivalent to the [plugin_dir] config option.
- `-region=<region>`: Equivalent to the [region] config option.
- `-rejoin`: Equivalent to the [rejoin_after_leave] config option.
- `-retry-interval`: Equivalent to the [retry_interval] config option.
- `-retry-join`: Similar to `-join` but allows retrying a join if the first
attempt fails.
```sh
$ nomad agent -retry-join "127.0.0.1:4648"
```
`retry-join` can be defined as a command line flag only for servers. Clients
can configure `retry-join` only in configuration files.
- `-retry-max`: Similar to the [retry_max] config option.
- `-server`: Enable server mode on the local agent.
- `-servers=<host:port>`: Equivalent to the Client [servers] config
option.
- `-state-dir=<path>`: Equivalent to the Client [state_dir] config
option.
- `-vault-enabled`: Whether to enable or disabled Vault integration.
- `-vault-address=<addr>`: The address to communicate with Vault.
- `-vault-token=<token>`: The Vault token used to derive tokens. Only needs to
be set on Servers. Overrides the Vault token read from the VAULT_TOKEN
environment variable.
- `-vault-create-from-role=<role>`: The role name to create tokens for tasks
from.
- `-vault-ca-file=<path>`: Path to a PEM-encoded CA cert file used to verify the
Vault server SSL certificate.
- `-vault-ca-path=<path>`: Path to a directory of PEM-encoded CA cert files used
to verify the Vault server SSL certificate.Whether to enable or disabled Vault
integration.
- `vault-cert-file=<path>`: The path to the certificate for Vault communication.
- `vault-key-file=<path>`: The path to the private key for Vault communication.
- `vault-namespace=<namespace>`: The Vault namespace used for the integration.
Required for servers and clients. Overrides the Vault namespace read from the
VAULT_NAMESPACE environment variable.
- `vault-tls-skip-verify`: A boolean that determines whether to skip SSL
certificate verification.
- `vault-tls-server-name=<name>`: Used to set the SNI host when connecting to
Vault over TLS.
[address]: /docs/configuration/consul.html#address
[alloc_dir]: #alloc_dir
[auth]: /docs/configuration/consul.html#auth
[auto_advertise]: /docs/configuration/consul.html#auto_advertise
[bind_addr]: #bind_addr
[bootstrap_expect]: #bootstrap_expect
[ca_file]: /docs/configuration/consul.html#ca_file
[cert_file]: /docs/configuration/consul.html#cert_file
[checks_use_advertise]: /docs/configuration/consul.html#checks_use_advertise
[client_auto_join]: /docs/configuration/consul.html#client_auto_join
[client_http_check_name]: /docs/configuration/consul.html#client_http_check_name
[client_service_name]: /docs/configuration/consul.html#client_service_name
[Configuration]: /docs/configuration/index.html
[data_dir]: /docs/configuration/index.html#data_dir
[datacenter]: #datacenter
[enabled]: /docs/configuration/acl.html#enabled
[Encryption Overview]: /guides/security/encryption.html
[key_file]: /docs/configuration/consul.html#key_file
[log_json]: /docs/configuration/index.html#log_json
[log_level]: /docs/configuration/index.html#log_level
[meta]: #meta
[name]: #name
[network_interface]: #network_interface
[network_speed]: #network_speed
[node_class]: #node_class
[Nomad Agent]: /guides/install/production/nomad-agent.html
[plugin_dir]: /docs/configuration/index.html#plugin_dir
[region]: #region
[rejoin_after_leave]: #rejoin_after_leave
[replication_token]: /docs/configuration/acl.html#replication_token
[retry_interval]: #retry_interval
[retry_max]: #retry_max
[server_auto_join]: /docs/configuration/consul.html#server_auto_join
[server_http_check_name]: /docs/configuration/consul.html#server_http_check_name
[server_rpc_check_name]: /docs/configuration/consul.html#server_rpc_check_name
[server_serf_check_name]: /docs/configuration/consul.html#server_serf_check_name
[server_service_name]: /docs/configuration/consul.html#server_service_name
[servers]: #servers
[ssl]: /docs/configuration/consul.html#ssl
[state_dir]: #state_dir
[token]: /docs/configuration/consul.html#token
[verify_ssl]: /docs/configuration/consul.html#verify_ssl

View File

@ -1,114 +0,0 @@
---
layout: "docs"
page_title: "Commands: agent"
sidebar_current: "docs-commands-_agent" # Use "_" to break prefix match
description: >
The agent command is the main entrypoint to running a Nomad client
or server.
---
# Command: agent
The agent command is the heart of Nomad: it runs the agent that handles client
or server functionality, including exposing interfaces for client consumption
and running jobs.
Due to the power and flexibility of this command, the Nomad agent is documented
in its own section. See the [Nomad Agent](/guides/install/production/nomad-agent.html)
guide and the [Configuration](/docs/configuration/index.html) documentation section for
more information on how to use this command and the options it has.
## Command-line Options
A subset of the available Nomad agent configuration can optionally be passed in
via CLI arguments. The `agent` command accepts the following arguments:
* `-alloc-dir=<path>`: Equivalent to the Client [alloc_dir](#alloc_dir) config
option.
* `-acl-enabled`: Equivalent to the ACL [enabled](/docs/configuration/acl.html#enabled) config option.
* `-acl-replication-token`: Equivalent to the ACL [replication_token](/docs/configuration/acl.html#replication_token) config option.
* `-bind=<address>`: Equivalent to the [bind_addr](#bind_addr) config option.
* `-bootstrap-expect=<num>`: Equivalent to the
[bootstrap_expect](#bootstrap_expect) config option.
* `-client`: Enable client mode on the local agent.
* `-config=<path>`: Specifies the path to a configuration file or a directory of
configuration files to load. Can be specified multiple times.
* `-consul-address=<addr>`: Equivalent to the [address](/docs/configuration/consul.html#address) config option.
* `-consul-auth=<auth>`: Equivalent to the [auth](/docs/configuration/consul.html#auth) config option.
* `-consul-auto-advertise`: Equivalent to the [auto_advertise](/docs/configuration/consul.html#auto_advertise) config option.
* `-consul-ca-file=<path>`: Equivalent to the [ca_file](/docs/configuration/consul.html#ca_file) config option.
* `-consul-cert-file=<path>`: Equivalent to the [cert_file](/docs/configuration/consul.html#cert_file) config option.
* `-consul-checks-use-advertise`: Equivalent to the [checks_use_advertise](/docs/configuration/consul.html#checks_use_advertise) config option.
* `-consul-client-auto-join`: Equivalent to the [client_auto_join](/docs/configuration/consul.html#client_auto_join) config option.
* `-consul-client-service-name=<name>`: Equivalent to the [client_service_name](/docs/configuration/consul.html#client_service_name) config option.
* `-consul-client-http-check-name=<name>`: Equivalent to the [client_http_check_name](/docs/configuration/consul.html#client_http_check_name) config option.
* `-consul-key-file=<path>`: Equivalent to the [key_file](/docs/configuration/consul.html#key_file) config option.
* `-consul-server-service-name=<name>`: Equivalent to the [server_service_name](/docs/configuration/consul.html#server_service_name) config option.
* `-consul-server-http-check-name=<name>`: Equivalent to the [server_http_check_name](/docs/configuration/consul.html#server_http_check_name) config option.
* `-consul-server-serf-check-name=<name>`: Equivalent to the [server_serf_check_name](/docs/configuration/consul.html#server_serf_check_name) config option.
* `-consul-server-rpc-check-name=<name>`: Equivalent to the [server_rpc_check_name](/docs/configuration/consul.html#server_rpc_check_name) config option.
* `-consul-server-auto-join`: Equivalent to the [server_auto_join](/docs/configuration/consul.html#server_auto_join) config option.
* `-consul-ssl`: Equivalent to the [ssl](/docs/configuration/consul.html#ssl) config option.
* `-consul-token=<token>`: Equivalent to the [token](/docs/configuration/consul.html#token) config option.
* `-consul-verify-ssl`: Equivalent to the [verify_ssl](/docs/configuration/consul.html#verify_ssl) config option.
* `-data-dir=<path>`: Equivalent to the [data_dir](/docs/configuration/index.html#data_dir) config option.
* `-dc=<datacenter>`: Equivalent to the [datacenter](#datacenter) config option.
* `-dev`: Start the agent in development mode. This enables a pre-configured
dual-role agent (client + server) which is useful for developing or testing
Nomad. No other configuration is required to start the agent in this mode,
but you may pass an optional comma-separated list of mode configurations:
* `-dev-connect`: Start the agent in development mode, but bind to a public
network interface rather than localhost for using Consul Connect. This mode
is supported only on Linux as root.
* `-encrypt`: Set the Serf encryption key. See the [Encryption Overview](/guides/security/encryption.html) for more details.
* `-join=<address>`: Address of another agent to join upon starting up. This can
be specified multiple times to specify multiple agents to join.
* `-log-level=<level>`: Equivalent to the [log_level](/docs/configuration/index.html#log_level) config option.
* `-log-json`: Equivalent to the [log_json](/docs/configuration/index.html#log_json) config option.
* `-meta=<key=value>`: Equivalent to the Client [meta](#meta) config option.
* `-network-interface=<interface>`: Equivalent to the Client
[network_interface](#network_interface) config option.
* `-network-speed=<MBits>`: Equivalent to the Client
[network_speed](#network_speed) config option.
* `-node=<name>`: Equivalent to the [name](#name) config option.
* `-node-class=<class>`: Equivalent to the Client [node_class](#node_class)
config option.
* `-plugin-dir=<path>`: Equivalent to the [plugin_dir](/docs/configuration/index.html#plugin_dir) config option.
* `-region=<region>`: Equivalent to the [region](#region) config option.
* `-rejoin`: Equivalent to the [rejoin_after_leave](#rejoin_after_leave) config option.
* `-retry-interval`: Equivalent to the [retry_interval](#retry_interval) config option.
* `-retry-join`: Similar to `-join` but allows retrying a join if the first attempt fails.
```sh
$ nomad agent -retry-join "127.0.0.1:4648"
```
`retry-join` can be defined as a command line flag only for servers. Clients
can configure `retry-join` only in configuration files.
* `-retry-max`: Similar to the [retry_max](#retry_max) config option.
* `-server`: Enable server mode on the local agent.
* `-servers=<host:port>`: Equivalent to the Client [servers](#servers) config
option.
* `-state-dir=<path>`: Equivalent to the Client [state_dir](#state_dir) config
option.
* `-vault-enabled`: Whether to enable or disabled Vault integration.
* `-vault-address=<addr>`: The address to communicate with Vault.
* `-vault-token=<token>`: The Vault token used to derive tokens. Only needs to
be set on Servers. Overrides the Vault token read from the VAULT_TOKEN
environment variable.
* `-vault-create-from-role=<role>`: The role name to create tokens for tasks from.
* `-vault-ca-file=<path>`: Path to a PEM-encoded CA cert file used to verify the
Vault server SSL certificate.
* `-vault-ca-path=<path>`: Path to a directory of PEM-encoded CA cert files used
to verify the Vault server SSL certificate.Whether to enable or disabled Vault
integration.
* `vault-cert-file=<path>`: The path to the certificate for Vault communication.
* `vault-key-file=<path>`: The path to the private key for Vault communication.
* `vault-namespace=<namespace>`: The Vault namespace used for the integration.
Required for servers and clients. Overrides the Vault namespace read from the
VAULT_NAMESPACE environment variable.
* `vault-tls-skip-verify`: A boolean that determines whether to skip SSL
certificate verification.
* `vault-tls-server-name=<name>`: Used to set the SNI host when connecting to
Vault over TLS.

View File

@ -7,7 +7,7 @@ description: >
---
# Command: alloc
The `alloc` command is used to interact with allocations.
## Usage
@ -17,12 +17,12 @@ Usage: `nomad alloc <subcommand> [options]`
Run `nomad alloc <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`alloc fs`][fs] - Inspect the contents of an allocation directory
* [`alloc logs`][logs] - Streams the logs of a task
* [`alloc restart`][restart] - Restart a running allocation or task
* [`alloc signal`][signal] - Signal a running allocation
* [`alloc status`][status] - Display allocation status information and metadata
* [`alloc stop`][stop] - Stop and reschedule a running allocation
- [`alloc fs`][fs] - Inspect the contents of an allocation directory
- [`alloc logs`][logs] - Streams the logs of a task
- [`alloc restart`][restart] - Restart a running allocation or task
- [`alloc signal`][signal] - Signal a running allocation
- [`alloc status`][status] - Display allocation status information and metadata
- [`alloc stop`][stop] - Stop and reschedule a running allocation
[fs]: /docs/commands/alloc/fs.html "Inspect the contents of an allocation directory"
[logs]: /docs/commands/alloc/logs.html "Streams the logs of a task"

View File

@ -7,17 +7,17 @@ description: >
---
# Command: alloc exec
**Alias: `nomad exec`**
The `alloc exec` command runs a command in a running allocation.
## Usage
```
```plaintext
nomad alloc exec [options] <allocation> <command> [<args>...]
```
The nomad exec command can be use to run commands inside a running task/allocation.
Use cases are for inspecting container state, debugging a failed application
@ -34,29 +34,28 @@ the given job will be chosen.
## Exec Options
* `-task`: Sets the task to exec command in. Defaults to first task.
- `-task`: Sets the task to exec command in. Defaults to first task.
* `-job`: Use a random allocation from the specified job ID.
- `-job`: Use a random allocation from the specified job ID.
* `-i`: Pass stdin to the container, defaults to true.
Pass `-i=false` to disable explicitly.
- `-i`: Pass stdin to the container, defaults to true. Pass `-i=false` to
disable explicitly.
* `-t`: Allocate a pseudo-tty, defaults to true if stdin is detected to be a tty session.
Pass `-t=false` to disable explicitly.
* `-e` <escape_char>: Sets the escape character for sessions with a pty
(default: '~'). The escape character is only recognized at the beginning of a
line. The escape character followed by a dot ('.') closes the connection.
Setting the character to 'none' disables any escapes and makes the session fully
transparent.
- `-t`: Allocate a pseudo-tty, defaults to true if stdin is detected to be a tty
session. Pass `-t=false` to disable explicitly.
- `-e` <escape_char>: Sets the escape character for sessions with a pty
(default: '~'). The escape character is only recognized at the beginning of a
line. The escape character followed by a dot ('.') closes the connection.
Setting the character to 'none' disables any escapes and makes the session
fully transparent.
## Examples
To start an interactive debugging session in a particular alloc, invoke exec
command with your desired shell available inside the task:
```
```shell
$ nomad alloc exec eb17e557 /bin/bash
root@eb17e557:/data# # now run any debugging commands inside container
root@eb17e557:/data# # ps -ef
@ -65,9 +64,10 @@ root@eb17e557:/data# # ps -ef
To run a command and stream results without starting an interactive shell, you
can pass the command and its arguments to exec directly:
```
```shell
$ # run commands without starting an interactive session
$ nomad alloc exec eb17e557 cat /etc/resolv.conf
...
```
When passing command arguments to be evaluated in task, you may need to ensure
@ -75,14 +75,15 @@ that your host shell doesn't interpolate values before invoking `exec` command.
For example, the following command would return the environment variable on
operator shell rather than task containers:
```
```shell
$ nomad alloc exec eb17e557 echo $NOMAD_ALLOC_ID # wrong
...
```
Here, we must start a shell in task to interpolate `$NOMAD_ALLOC_ID`, and quote
command or use the [heredoc syntax][heredoc]
```
```shell
$ # by quoting argument
$ nomad alloc exec eb17e557 /bin/sh -c 'echo $NOMAD_ALLOC_ID'
eb17e557-443e-4c51-c049-5bba7a9850bc
@ -97,38 +98,42 @@ eb17e557-443e-4c51-c049-5bba7a9850bc
This technique applies when aiming to run a shell pipeline without streaming
intermediate command output across the network:
```
```shell
$ # e.g. find top appearing lines in some output
$ nomad alloc exec eb17e557 /bin/sh -c 'cat /output | sort | uniq -c | sort -rn | head -n 5'
...
```
[heredoc]: http://tldp.org/LDP/abs/html/here-docs.html
## Using Job ID instead of Allocation ID
Setting the `-job` flag causes a random allocation of the specified job to be
selected.
```
```plaintext
nomad alloc exec -job <job-id> <command> [<args>...]
```
Choosing a specific allocation is useful for debugging issues with a specific
instance of a service. For other operations using the `-job` flag may be more
convenient than looking up an allocation ID to use.
## Disabling remote execution
`alloc exec` is enabled by default to aid with debugging. Operators can disable the feature by setting [`disable_remote_exec` client config option][disable_remote_exec_flag] on all clients, or a subset of clients that run sensitive workloads.
[disable_remote_exec_flag]: /docs/configuration/client.html#disable_remote_exec
`alloc exec` is enabled by default to aid with debugging. Operators can disable
the feature by setting [`disable_remote_exec` client config
option][disable_remote_exec_flag] on all clients, or a subset of clients that
run sensitive workloads.
## Exec targeting a specific task
When trying to `alloc exec` for a job that has more than one task associated with it, you may want to target a specific task.
When trying to `alloc exec` for a job that has more than one task associated
with it, you may want to target a specific task.
```
```shell
# open a shell session in one of your allocation's tasks
$ nomad alloc exec -i -t -task mytask a1827f93 /bin/bash
a1827f93$
```
[heredoc]: http://tldp.org/LDP/abs/html/here-docs.html
[disable_remote_exec_flag]: /docs/configuration/client.html#disable_remote_exec

View File

@ -7,30 +7,34 @@ description: >
---
# Command: alloc fs
**Alias: `nomad fs`**
The `alloc fs` command allows a user to navigate an allocation directory on a Nomad
client. The following functionalities are available - `cat`, `tail`, `ls` and
`stat`.
* `cat`: If the target path is a file, Nomad will `cat` the file.
* `tail`: If the target path is a file and `-tail` flag is specified, Nomad will
`tail` the file.
* `ls`: If the target path is a directory, Nomad displays the name of a file and
directories and their associated information.
* `stat`: If the `-stat` flag is used, Nomad will display information about a
file.
- `cat`: If the target path is a file, Nomad will `cat` the file.
- `tail`: If the target path is a file and `-tail` flag is specified, Nomad will
`tail` the file.
- `ls`: If the target path is a directory, Nomad displays the name of a file and
directories and their associated information.
- `stat`: If the `-stat` flag is used, Nomad will display information about a
file.
## Usage
```
```plaintext
nomad alloc fs [options] <allocation> <path>
```
This command accepts a single allocation ID (unless the `-job` flag is specified,
in which case an allocation is chosen from the given job) and a path. The path is
relative to the root of the allocation directory. The path is optional and it
defaults to `/` of the allocation directory.
This command accepts a single allocation ID (unless the `-job` flag is
specified, in which case an allocation is chosen from the given job) and a path.
The path is relative to the root of the allocation directory. The path is
optional and it defaults to `/` of the allocation directory.
## General Options
@ -38,30 +42,30 @@ defaults to `/` of the allocation directory.
## Fs Options
* `-H`: Machine friendly output.
- `-H`: Machine friendly output.
* `-verbose`: Display verbose output.
- `-verbose`: Display verbose output.
* `-job`: Use a random allocation from the specified job, preferring a running
allocation.
- `-job`: Use a random allocation from the specified job, preferring a running
allocation.
* `-stat`: Show stat information instead of displaying the file, or listing the
directory.
- `-stat`: Show stat information instead of displaying the file, or listing the
directory.
* `-f`: Causes the output to not stop when the end of the file is reached, but
rather to wait for additional output.
- `-f`: Causes the output to not stop when the end of the file is reached, but
rather to wait for additional output.
* `-tail`: Show the files contents with offsets relative to the end of the file.
If no offset is given, -n is defaulted to 10.
- `-tail`: Show the files contents with offsets relative to the end of the file.
If no offset is given, -n is defaulted to 10.
* `-n`: Sets the tail location in best-efforted number of lines relative to the
end of the file.
- `-n`: Sets the tail location in best-efforted number of lines relative to the
end of the file.
* `-c`: Sets the tail location in number of bytes relative to the end of the file.
- `-c`: Sets the tail location in number of bytes relative to the end of the file.
## Examples
```
```shell
$ nomad alloc fs eb17e557
Mode Size Modified Time Name
drwxrwxr-x 4096 28 Jan 16 05:39 UTC alloc/
@ -98,10 +102,9 @@ selected. Nomad will prefer to select a running allocation ID for the job, but
if no running allocations for the job are found, Nomad will use a dead
allocation.
```
```plaintext
nomad alloc fs -job <job-id> <path>
```
This can be useful for debugging a job that has multiple allocations, and it's
not really required to use a specific allocation ID.
This can be useful for debugging a job that has multiple allocations, and it is
not required to observe a specific allocation.

View File

@ -7,13 +7,14 @@ description: >
---
# Command: alloc logs
**Alias: `nomad logs`**
The `alloc logs` command displays the log of a given task.
## Usage
```
```plaintext
nomad alloc logs [options] <allocation> <task>
```
@ -21,34 +22,35 @@ This command streams the logs of the given task in the allocation. If the
allocation is only running a single task, the task name can be omitted.
Optionally, the `-job` option may be used in which case a random allocation from
the given job will be chosen.
#
## General Options
<%= partial "docs/commands/_general_options" %>
## Logs Options
* `-stderr`: Display stderr logs.
- `-stderr`: Display stderr logs.
* `-verbose`: Display verbose output.
- `-verbose`: Display verbose output.
* `-job`: Use a random allocation from the specified job, preferring a running
allocation.
- `-job`: Use a random allocation from the specified job, preferring a running
allocation.
* `-f`: Causes the output to not stop when the end of the logs are reached, but
rather to wait for additional output.
- `-f`: Causes the output to not stop when the end of the logs are reached, but
rather to wait for additional output.
* `-tail`: Show the logs contents with offsets relative to the end of the logs.
If no offset is given, -n is defaulted to 10.
- `-tail`: Show the logs contents with offsets relative to the end of the logs.
If no offset is given, -n is defaulted to 10.
* `-n`: Sets the tail location in best-efforted number of lines relative to the
end of the logs.
- `-n`: Sets the tail location in best-efforted number of lines relative to the
end of the logs.
* `-c`: Sets the tail location in number of bytes relative to the end of the logs.
- `-c`: Sets the tail location in number of bytes relative to the end of the
logs.
## Examples
```
```shell
$ nomad alloc logs eb17e557 redis
foobar
baz
@ -80,11 +82,10 @@ selected. Nomad will prefer to select a running allocation ID for the job, but
if no running allocations for the job are found, Nomad will use a dead
allocation.
```
```plaintext
nomad alloc logs -job <job-id> <task>
```
Choosing a specific allocation is useful for debugging issues with a specific
instance of a service. For other operations using the `-job` flag may be more
convenient than looking up an allocation ID to use.

View File

@ -13,7 +13,7 @@ an entire allocation or individual task.
## Usage
```
```plaintext
nomad alloc restart [options] <allocation> <task>
```
@ -27,11 +27,11 @@ is optional and if omitted every task in the allocation will be restarted.
## Restart Options
* `-verbose`: Display verbose output.
- `-verbose`: Display verbose output.
## Examples
```
```shell
$ nomad alloc restart eb17e557
$ nomad alloc restart eb17e557 foo
@ -39,4 +39,3 @@ Could not find task named: foo, found:
* test
<blocking>
```

View File

@ -13,7 +13,7 @@ an entire allocation or individual task.
## Usage
```
```plaintext
nomad alloc signal [options] <allocation> <task>
```
@ -27,13 +27,12 @@ is optional and if omitted every task in the allocation will be signaled.
## Signal Options
* `-s`: Signal to send to the tasks. Valid options depend on the driver.
* `-verbose`: Display verbose output.
- `-s`: Signal to send to the tasks. Valid options depend on the driver.
- `-verbose`: Display verbose output.
## Examples
```
```shell
$ nomad alloc signal eb17e557
$ nomad alloc signal eb17e557 foo
@ -41,4 +40,3 @@ Could not find task named: foo, found:
* test
<blocking>
```

View File

@ -11,13 +11,13 @@ description: >
The `alloc status` command displays status information and metadata about an
existing allocation and its tasks. It can be useful while debugging to reveal
the underlying reasons for scheduling decisions or failures, as well as the
current state of its tasks. As of Nomad 0.7.1, alloc status also shows allocation
modification time in addition to create time. As of Nomad 0.8, alloc status shows
information about reschedule attempts.
current state of its tasks. As of Nomad 0.7.1, alloc status also shows
allocation modification time in addition to create time. As of Nomad 0.8, alloc
status shows information about reschedule attempts.
## Usage
```
```plaintext
nomad alloc status [options] <allocation>
```
@ -31,16 +31,16 @@ allocations and information will be displayed.
## Alloc Status Options
* `-short`: Display short output. Shows only the most recent task event.
* `-verbose`: Show full information.
* `-json` : Output the allocation in its JSON format.
* `-t` : Format and display the allocation using a Go template.
- `-short`: Display short output. Shows only the most recent task event.
- `-verbose`: Show full information.
- `-json` : Output the allocation in its JSON format.
- `-t` : Format and display the allocation using a Go template.
## Examples
Short status of an alloc:
```
```shell
$ nomad alloc status --short 0af996ed
ID = 0af996ed
Eval ID = be9bde98
@ -64,7 +64,7 @@ web running Started 07/25/17 16:12:49 UTC
Full status of an alloc, which shows one of the tasks dying and then being restarted:
```
```shell
$ nomad alloc status 0af996ed
ID = 0af996ed
Eval ID = be9bde98
@ -119,7 +119,7 @@ Recent Events:
Verbose status can also be accessed:
```
```shell
$ nomad alloc status -verbose 0af996ed
ID = 0af996ed-aff4-8ddb-a566-e55ebf8969c9
Eval ID = be9bde98-0490-1beb-ced0-012d10ddf22e

View File

@ -13,7 +13,7 @@ entire allocation or individual task.
## Usage
```
```plaintext
nomad alloc stop [options] <allocation>
```
@ -32,16 +32,16 @@ down. It is safe to exit the monitor early with ctrl-c.
## Stop Options
* `-detach`: Return immediately instead of entering monitor mode. After the
- `-detach`: Return immediately instead of entering monitor mode. After the
stop command is submitted, a new evaluation ID is printed to the
screen, which can be used to examine the rescheduling evaluation using the
[eval status](/docs/commands/eval-status.html) command.
[eval status] command.
* `-verbose`: Display verbose output.
- `-verbose`: Display verbose output.
## Examples
```
```shell
$ nomad alloc stop c1488bb5
==> Monitoring evaluation "26172081"
Evaluation triggered by job "example"
@ -54,3 +54,4 @@ $ nomad alloc stop -detach eb17e557
8a91f0f3-9d6b-ac83-479a-5aa186ab7795
```
[eval status]: /docs/commands/eval-status.html

View File

@ -7,7 +7,7 @@ description: >
---
# Command: deployment
The `deployment` command is used to interact with deployments.
## Usage
@ -17,12 +17,12 @@ Usage: `nomad deployment <subcommand> [options]`
Run `nomad deployment <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`deployment fail`][fail] - Manually fail a deployment
* [`deployment list`][list] - List all deployments
* [`deployment pause`][pause] - Pause a deployment
* [`deployment promote`][promote] - Promote canaries in a deployment
* [`deployment resume`][resume] - Resume a paused deployment
* [`deployment status`][status] - Display the status of a deployment
- [`deployment fail`][fail] - Manually fail a deployment
- [`deployment list`][list] - List all deployments
- [`deployment pause`][pause] - Pause a deployment
- [`deployment promote`][promote] - Promote canaries in a deployment
- [`deployment resume`][resume] - Resume a paused deployment
- [`deployment status`][status] - Display the status of a deployment
[fail]: /docs/commands/deployment/fail.html "Manually fail a deployment"
[list]: /docs/commands/deployment/list.html "List all deployments"

View File

@ -15,12 +15,12 @@ roll back to a stable version.
## Usage
```
```plaintext
nomad deployment fail [options] <deployment id>
```
The `deployment fail` command requires a single argument, a deployment ID or
prefix.
prefix.
## General Options
@ -28,17 +28,17 @@ prefix.
## Fail Options
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command.
[eval status] command.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Manually mark an ongoing deployment as failed:
```
```shell
$ nomad deployment fail 8990cfbc
Deployment "8990cfbc-28c0-cb28-ca31-856cf691b987" failed
@ -59,3 +59,5 @@ Deployed
Task Group Desired Placed Healthy Unhealthy
cache 3 2 1 0
```
[eval status]: /docs/commands/eval-status.html

View File

@ -12,7 +12,7 @@ The `deployment list` command is used list all deployments.
## Usage
```
```plaintext
nomad deployment list [options]
```
@ -24,17 +24,15 @@ The `deployment list` command requires no arguments.
## List Options
* `-json` : Output the deployments in their JSON format.
* `-t` : Format and display the deployments using a Go template.
* `-verbose`: Show full information.
- `-json` : Output the deployments in their JSON format.
- `-t` : Format and display the deployments using a Go template.
- `-verbose`: Show full information.
## Examples
List all tracked deployments:
```
```shell
$ nomad deployment list
ID Job ID Job Version Status Description
8990cfbc example 2 failed Deployment marked as failed

View File

@ -15,12 +15,12 @@ deployment.
## Usage
```
```plaintext
nomad deployment pause [options] <deployment id>
```
The `deployment pause` command requires a single argument, a deployment ID or
prefix.
prefix.
## General Options
@ -28,13 +28,13 @@ prefix.
## Pause Options
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Manually pause a deployment:
```
```shell
$ nomad deployment pause 2f14ba55
Deployment "2f14ba55-acfb-cb31-821c-facf1b9b0830" paused
```

View File

@ -14,12 +14,12 @@ and those canaries have been deemed healthy. When a task group is promoted, the
rolling upgrade of the remaining allocations is unblocked. If the canaries are
found to be unhealthy, the deployment may either be failed using the "nomad
deployment fail" command, the job can be failed forward by submitting a new
version or failed backwards by reverting to an older version using the [`job
revert`](/docs/commands/job/revert.html) command.
version or failed backwards by reverting to an older version using the
[`job revert`] command.
## Usage
```
```plaintext
nomad deployment promote [options] <deployment id>
```
@ -34,21 +34,21 @@ select particular groups to promote.
## Promote Options
* `-group`: Group may be specified many times and is used to promote that
- `-group`: Group may be specified many times and is used to promote that
particular group. If no specific groups are specified, all groups are
promoted.
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Promote canaries in all groups:
```
```shell
# Have two task groups waiting for promotion.
$ nomad status example
ID = example
@ -136,7 +136,7 @@ f2409f7d a8dcce2d web 0 stop complete 07/25/17 18:31:34 UT
Promote canaries in a particular group:
```
```shell
# Have two task groups waiting for promotion.
$ nomad status example
ID = example
@ -219,3 +219,6 @@ cee52788 6240eed6 web 0 run running 07/25/17 18:37:08 UT
ee8f972e 6240eed6 web 0 run running 07/25/17 18:37:08 UTC
0ee7800c 6240eed6 cache 0 stop complete 07/25/17 18:37:08 UTC
```
[`job revert`]: /docs/commands/job/revert.html
[eval status]: /docs/commands/eval-status.html

View File

@ -14,12 +14,12 @@ rolling deployment.
## Usage
```
```plaintext
nomad deployment resume [options] <deployment id>
```
The `deployment resume` command requires a single argument, a deployment ID or
prefix.
prefix.
## General Options
@ -27,17 +27,17 @@ prefix.
## Resume Options
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Manually resume a deployment:
```
```shell
$ nomad deployment resume c848972e
Deployment "c848972e-dcd3-7354-e0d2-39d86642cdb1" resumed
@ -50,3 +50,5 @@ Deployment "c848972e-dcd3-7354-e0d2-39d86642cdb1" resumed
Evaluation status changed: "pending" -> "complete"
==> Evaluation "5e266d42" finished with status "complete"
```
[eval status]: /docs/commands/eval-status.html

View File

@ -10,16 +10,16 @@ description: >
The `deployment status` command is used to display the status of a deployment.
The status will display the number of desired changes as well as the currently
applied changes.
applied changes.
## Usage
```
```plaintext
nomad deployment status [options] <deployment id>
```
The `deployment status` command requires a single argument, a deployment ID or
prefix.
prefix.
## General Options
@ -27,17 +27,15 @@ prefix.
## Status Options
* `-json` : Output the deployment in its JSON format.
* `-t` : Format and display the deployment using a Go template.
* `-verbose`: Show full information.
- `-json` : Output the deployment in its JSON format.
- `-t` : Format and display the deployment using a Go template.
- `-verbose`: Show full information.
## Examples
Inspect the status of a complete deployment:
```
```shell
$ nomad deployment status 06ca68a2
ID = 06ca68a2
Job ID = example
@ -53,7 +51,7 @@ web 2 2 2 0
Inspect the status of a deployment that is waiting for canary promotion:
```
```shell
$ nomad deployment status 0b
ID = 0b23b149
Job ID = example

View File

@ -20,7 +20,7 @@ evaluation reaches a terminal state.
## Usage
```
```plaintext
nomad eval status [options] <evaluation>
```
@ -44,19 +44,16 @@ indicated by exit code 1.
## Eval Status Options
* `-monitor`: Monitor an outstanding evaluation
* `-verbose`: Show full information.
* `-json` : Output the evaluation in its JSON format.
* `-t` : Format and display evaluation using a Go template.
- `-monitor`: Monitor an outstanding evaluation
- `-verbose`: Show full information.
- `-json` : Output the evaluation in its JSON format.
- `-t` : Format and display evaluation using a Go template.
## Examples
Show the status of an evaluation that has placement failures
```
```shell
$ nomad eval status 2ae0e6a5
ID = 2ae0e6a5
Status = complete
@ -78,7 +75,7 @@ Evaluation "67493a64" waiting for additional capacity to place remainder
Monitor an existing evaluation
```
```shell
$ nomad eval status -monitor 8262bc83
==> Monitoring evaluation "8262bc83"
Allocation "bd6bd0de" created: node "6f299da5", group "group1"

View File

@ -10,7 +10,7 @@ description: >
# Nomad Commands (CLI)
Nomad is controlled via a very easy to use command-line interface (CLI).
Nomad is only a single command-line application: `nomad`, which
Nomad is only a single command-line application: `nomad`, which
takes a subcommand such as "agent" or "status". The complete list of
subcommands is in the navigation to the left.
@ -25,17 +25,17 @@ with the `-h` argument.
Each command has been conveniently documented on this website. Links to each
command can be found on the left.
### Autocomplete
## Autocomplete
Nomad's CLI supports command autocomplete. Autocomplete can be installed or
uninstalled by running the following on bash or zsh shells:
```
```shell
$ nomad -autocomplete-install
$ nomad -autocomplete-uninstall
```
### Command Contexts
## Command Contexts
Nomad's CLI commands have implied contexts in their naming convention. Because
the CLI is most commonly used to manipulate or query jobs, you can assume that
@ -55,7 +55,7 @@ local machine does not have a running Nomad agent. To do so, set the
`NOMAD_ADDR` environment variable or use the `-address=<addr>` flag when running
commands.
```
```shell
$ NOMAD_ADDR=https://remote-address:4646 nomad status
$ nomad status -address=https://remote-address:4646
```

View File

@ -7,7 +7,7 @@ description: >
---
# Command: job
The `job` command is used to interact with jobs.
## Usage
@ -17,13 +17,13 @@ Usage: `nomad job <subcommand> [options]`
Run `nomad job <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`job deployments`][deployments] - List deployments for a job
* [`job dispatch`][dispatch] - Dispatch an instance of a parameterized job
* [`job eval`][eval] - Force an evaluation for a job
* [`job history`][history] - Display all tracked versions of a job
* [`job promote`][promote] - Promote a job's canaries
* [`job revert`][revert] - Revert to a prior version of the job
* [`job status`][status] - Display status information about a job
- [`job deployments`][deployments] - List deployments for a job
- [`job dispatch`][dispatch] - Dispatch an instance of a parameterized job
- [`job eval`][eval] - Force an evaluation for a job
- [`job history`][history] - Display all tracked versions of a job
- [`job promote`][promote] - Promote a job's canaries
- [`job revert`][revert] - Revert to a prior version of the job
- [`job status`][status] - Display status information about a job
[deployments]: /docs/commands/job/deployments.html "List deployments for a job"
[dispatch]: /docs/commands/job/dispatch.html "Dispatch an instance of a parameterized job"

View File

@ -13,12 +13,12 @@ particular job.
## Usage
```
```plaintext
nomad job deployments [options] <job>
```
The `job deployments` command requires a single argument, the job ID or an ID prefix
of a job to display the list of deployments for.
The `job deployments` command requires a single argument, the job ID or an ID
prefix of a job to display the list of deployments for.
## General Options
@ -26,25 +26,24 @@ of a job to display the list of deployments for.
## Deployment Options
* `-latest`: Display the latest deployment only.
- `-latest`: Display the latest deployment only.
* `-json` : Output the deployment in its JSON format.
- `-json` : Output the deployment in its JSON format.
* `-t` : Format and display the deployment using a Go template.
- `-t` : Format and display the deployment using a Go template.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
* `-all`: Display all deployments matching the job ID, even those from an
older instance of the job.
- `-all`: Display all deployments matching the job ID, even those from an
older instance of the job.
## Examples
List the deployment for a particular job:
```
```shell
$ nomad job deployments example
ID Job ID Job Version Status Description
0b23b149 example 1 running Deployment is running but requires manual promotion
06ca68a2 example 0 successful Deployment completed successfully
```

View File

@ -20,7 +20,7 @@ programming languages.
## Usage
```
```plaintext
nomad job dispatch [options] <parameterized job> [input source]
```
@ -46,24 +46,24 @@ client connection issues or internal errors, are indicated by exit code 1.
## Dispatch Options
* `-meta`: Meta takes a key/value pair separated by "=". The metadata key will
- `-meta`: Meta takes a key/value pair separated by "=". The metadata key will
be merged into the job's metadata. The job may define a default value for the
key which is overridden when dispatching. The flag can be provided more than
once to inject multiple metadata key/value pairs. Arbitrary keys are not
allowed. The parameterized job must allow the key to be merged.
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Dispatch against a parameterized job with the ID "video-encode" and
passing in a configuration payload via stdin:
```
```shell
$ cat << EOF | nomad job dispatch video-encode -
{
"s3-input": "https://video-bucket.s3-us-west-1.amazonaws.com/cb31dabb1",
@ -86,7 +86,7 @@ Evaluation ID = 31199841
Dispatch against a parameterized job with the ID "video-encode" and
passing in a configuration payload via a file:
```
```shell
$ nomad job dispatch video-encode video-config.json
Dispatched Job ID = video-encode/dispatch-1485379325-cb38d00d
Evaluation ID = 31199841
@ -101,10 +101,11 @@ Evaluation ID = 31199841
Dispatch against a parameterized job with the ID "video-encode" using the detach
flag:
```
```shell
$ nomad job dispatch -detach video-encode video-config.json
Dispatched Job ID = example/dispatch-1485380684-c37b3dba
Evaluation ID = d9034c4e
```
[eval status]: /docs/commands/eval-status.html
[parameterized job]: /docs/job-specification/parameterized.html "Nomad parameterized Job Specification"

View File

@ -8,17 +8,18 @@ description: >
# Command: job eval
The `job eval` command is used to force an evaluation of a job, given the job ID.
The `job eval` command is used to force an evaluation of a job, given the job
ID.
## Usage
```
```plaintext
nomad job eval [options] <job_id>
```
The `job eval` command requires a single argument, specifying the job ID to evaluate.
If there is an exact match based on the provided job ID, then
the job will be evaluated, forcing a scheduler run.
The `job eval` command requires a single argument, specifying the job ID to
evaluate. If there is an exact match based on the provided job ID, then the job
will be evaluated, forcing a scheduler run.
## General Options
@ -26,22 +27,23 @@ the job will be evaluated, forcing a scheduler run.
## Eval Options
* `-force-reschedule`: `force-reschedule` is used to force placement of failed allocations.
If this is set, failed allocations that are past their reschedule limit, and those that are
scheduled to be replaced at a future time are placed immediately. This option only places failed
allocations if the task group has rescheduling enabled.
- `-force-reschedule`: `force-reschedule` is used to force placement of failed
allocations. If this is set, failed allocations that are past their reschedule
limit, and those that are scheduled to be replaced at a future time are placed
immediately. This option only places failed allocations if the task group has
rescheduling enabled.
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Evaluate the job with ID "job1":
```
```shell
$ nomad job eval job1
==> Monitoring evaluation "0f3bc0f3"
Evaluation triggered by job "test"
@ -52,18 +54,20 @@ $ nomad job eval job1
Evaluate the job with ID "job1" and return immediately:
```
```shell
$ nomad job eval -detach job1
Created eval ID: "4947e728"
```
Evaluate the job with ID "job1", and reschedule any eligible failed allocations:
```
```shell
$ nomad job eval -force-reschedule job1
==> Monitoring evaluation "0f3bc0f3"
Evaluation triggered by job "test"
Evaluation within deployment: "51baf5c8"
Evaluation status changed: "pending" -> "complete"
==> Evaluation "0f3bc0f3" finished with status "complete"
```
```
[eval status]: /docs/commands/eval-status.html

View File

@ -15,7 +15,7 @@ versions to revert to.
## Usage
```
```plaintext
nomad job history [options] <job>
```
@ -28,21 +28,17 @@ of a job to display the history for.
## History Options
* `-p`: Display the differences between each job and its predecessor.
* `-full`: Display the full job definition for each version.
* `-version`: Display only the history for the given version.
* `-json` : Output the job versions in its JSON format.
* `-t` : Format and display the job versions using a Go template.
- `-p`: Display the differences between each job and its predecessor.
- `-full`: Display the full job definition for each version.
- `-version`: Display only the history for the given version.
- `-json` : Output the job versions in its JSON format.
- `-t` : Format and display the job versions using a Go template.
## Examples
Display the history showing differences between versions:
```
```shell
$ nomad job history -p e
Version = 2
Stable = false
@ -73,7 +69,7 @@ Submit Date = 07/25/17 20:35:28 UTC
Display the memory ask across submitted job versions:
```
```shell
$ nomad job history -t "{{range .}}\
v{{.Version}}: {{with index .TaskGroups 0}}{{with index .Tasks 0}}{{.Resources.MemoryMB}}{{end}}{{end}}\

View File

@ -7,27 +7,35 @@ description: >
---
# Command: job init
**Alias: `nomad init`**
The `job init` command creates an example [job specification][jobspec] in the
current directory that demonstrates some common configurations for tasks, task
groups, runtime constraints, and resource allocation.
Please refer to the [jobspec][] and [drivers](/docs/drivers/index.html)
pages to learn how to customize the template.
Please refer to the [jobspec] and [drivers] pages to learn how to customize the
template.
## Usage
```plaintext
nomad job init [options]
```
## Init Options
* `-short`: If set, a minimal jobspec without comments is emitted.
* `-connect`: If set, the jobspec includes Consul Connect integration.
- `-short`: If set, a minimal jobspec without comments is emitted.
- `-connect`: If set, the jobspec includes Consul Connect integration.
## Examples
Generate an example job file:
```text
```shell
$ nomad job init
Example job file written to example.nomad
```
[jobspec]: /docs/job-specification/index.html "Nomad Job Specification"
[drivers]: /docs/drivers/index.html

View File

@ -7,20 +7,21 @@ description: >
---
# Command: job inspect
**Alias: `nomad inspect`**
The `job inspect` command is used to inspect the content of a submitted job.
## Usage
```
```plaintext
nomad job inspect [options] <job>
```
The `job inspect` command requires a single argument, a submitted job's name, and
will retrieve the JSON version of the job. This JSON is valid to be submitted to
the [Job HTTP API](/api/jobs.html). This command is useful to inspect what
version of a job Nomad is running.
the [Job HTTP API]. This command is useful to inspect what version of a job
Nomad is running.
## General Options
@ -28,17 +29,15 @@ version of a job Nomad is running.
## Inspect Options
* `-version`: Display only the job at the given job version.
* `-json` : Output the job in its JSON format.
* `-t` : Format and display the job using a Go template.
- `-version`: Display only the job at the given job version.
- `-json` : Output the job in its JSON format.
- `-t` : Format and display the job using a Go template.
## Examples
Inspect a submitted job:
```
```shell
$ nomad job inspect redis
{
"Job": {
@ -153,3 +152,5 @@ $ nomad job inspect redis
}
}
```
[Job HTTP API]: /api/jobs.html

View File

@ -8,23 +8,23 @@ description: >
# Command: job periodic force
The `job periodic force` command is used to [force the evaluation](/api/jobs.html#force-new-periodic-instance)
of a [periodic job](/docs/job-specification/periodic.html).
The `job periodic force` command is used to [force the evaluation] of a
[periodic job].
## Usage
```
```plaintext
nomad job periodic force [options] <job id>
```
The `job periodic force` command requires a single argument, specifying the ID of the
job. This job must be a periodic job. This is used to immediately run a periodic job,
even if it violates the job's `prohibit_overlap` setting.
The `job periodic force` command requires a single argument, specifying the ID
of the job. This job must be a periodic job. This is used to immediately run a
periodic job, even if it violates the job's `prohibit_overlap` setting.
By default, on successful job submission the command will enter an
interactive monitor and display log information detailing the scheduling
decisions and placement information for the forced evaluation. The monitor will
exit after scheduling has finished or failed.
By default, on successful job submission the command will enter an interactive
monitor and display log information detailing the scheduling decisions and
placement information for the forced evaluation. The monitor will exit after
scheduling has finished or failed.
## General Options
@ -32,17 +32,17 @@ exit after scheduling has finished or failed.
## Run Options
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Force the evaluation of the job `example`, monitoring placement:
```
```shell
$ nomad job periodic force example
==> Monitoring evaluation "54b2d6d9"
Evaluation triggered by job "example/periodic-1555094493"
@ -54,8 +54,12 @@ $ nomad job periodic force example
Force the evaluation of the job `example` and return immediately:
```
```shell
$ nomad job periodic force -detach example
Force periodic successful
Evaluation ID: 0865fbf3-30de-5f53-0811-821e73e63178
```
[eval status]: /docs/commands/eval-status.html
[force the evaluation]: /api/jobs.html#force-new-periodic-instance
[periodic job]: /docs/job-specification/periodic.html

View File

@ -7,27 +7,25 @@ description: >
---
# Command: job plan
**Alias: `nomad plan`**
The `job plan` command can be used to invoke the scheduler in a dry-run mode with
new jobs or when updating existing jobs to determine what would happen if the
job is submitted. Job files must conform to the [job
specification](/docs/job-specification/index.html) format.
The `job plan` command can be used to invoke the scheduler in a dry-run mode
with new jobs or when updating existing jobs to determine what would happen if
the job is submitted. Job files must conform to the [job specification] format.
## Usage
```
```plaintext
nomad job plan [options] <path>
```
The `job plan` command requires a single argument, specifying the path to a file
containing a [HCL job specification](/docs/job-specification/index.html). This
file will be read and the resulting parsed job will be validated. If the
supplied path is "-", the job file is read from STDIN. Otherwise it is read
from the file at the supplied path or downloaded and read from URL specified.
Nomad downloads the job file using
[`go-getter`](https://github.com/hashicorp/go-getter)
and supports `go-getter` syntax.
containing an HCL [job specification]. This file will be read and the resulting
parsed job will be validated. If the supplied path is "-", the job file is read
from STDIN. Otherwise it is read from the file at the supplied path or
downloaded and read from URL specified. Nomad downloads the job file using
[`go-getter`] and supports `go-getter` syntax.
Plan invokes a dry-run of the scheduler to determine the effects of submitting
either a new or updated version of a job. The plan will not result in any
@ -35,9 +33,8 @@ changes to the cluster but gives insight into whether the job could be run
successfully and how it would affect existing allocations.
A job modify index is returned with the plan. This value can be used when
submitting the job using [`nomad job run
-check-index`](/docs/commands/job/run.html#check-index), which will check that the
job was not modified between the plan and run command before invoking the
submitting the job using [`nomad job run -check-index`], which will check that
the job was not modified between the plan and run command before invoking the
scheduler. This ensures the job has not been modified since the plan.
A structured diff between the local and remote job is displayed to
@ -48,9 +45,9 @@ environment variable are overridden and the job's region is used.
Plan will return one of the following exit codes:
* 0: No allocations created or destroyed.
* 1: Allocations created or destroyed.
* 255: Error determining plan results.
- 0: No allocations created or destroyed.
- 1: Allocations created or destroyed.
- 255: Error determining plan results.
## General Options
@ -58,18 +55,19 @@ Plan will return one of the following exit codes:
## Plan Options
* `-diff`: Determines whether the diff between the remote job and planned job is
- `-diff`: Determines whether the diff between the remote job and planned job is
shown. Defaults to true.
* `-policy-override`: Sets the flag to force override any soft mandatory Sentinel policies.
- `-policy-override`: Sets the flag to force override any soft mandatory
Sentinel policies.
* `-verbose`: Increase diff verbosity.
- `-verbose`: Increase diff verbosity.
## Examples
Plan a new job that has not been previously submitted:
```
```shell
$ nomad job plan job1.nomad
nomad job plan example.nomad
+ Job: "example"
@ -90,10 +88,9 @@ changed, another user has modified the job and the plan's results are
potentially invalid.
```
Increase the count of an existing without sufficient cluster capacity:
```
```shell
$ nomad job plan example.nomad
+/- Job: "example"
+/- Task Group: "cache" (7 create, 1 in-place update)
@ -119,7 +116,7 @@ potentially invalid.
Update an existing job such that it would cause a rolling update:
```
```shell
$ nomad job plan example.nomad
+/- Job: "example"
+/- Task Group: "cache" (3 create/destroy update)
@ -146,7 +143,7 @@ potentially invalid.
Add a task to the task group using verbose mode:
```
```shell
$ nomad job plan -verbose example.nomad
+/- Job: "example"
+/- Task Group: "cache" (3 create/destroy update)
@ -201,3 +198,8 @@ server side version matches the job modify index returned. If the index has
changed, another user has modified the job and the plan's results are
potentially invalid.
```
[job specification]: /docs/job-specification/index.html
[HCL job specification]: /docs/job-specification/index.html
[`go-getter`]: https://github.com/hashicorp/go-getter
[`nomad job run -check-index`] :/docs/commands/job/run.html#check-index

View File

@ -15,11 +15,11 @@ When a task group is promoted, the rolling upgrade of the remaining allocations
is unblocked. If the canaries are found to be unhealthy, the deployment may
either be failed using the "nomad deployment fail" command, the job can be
failed forward by submitting a new version or failed backwards by reverting to
an older version using the [job revert](/docs/commands/job/revert.html) command.
an older version using the [job revert] command.
## Usage
```
```plaintext
nomad job promote [options] <job>
```
@ -34,21 +34,21 @@ select particular groups to promote.
## Promote Options
* `-group`: Group may be specified many times and is used to promote that
- `-group`: Group may be specified many times and is used to promote that
particular group. If no specific groups are specified, all groups are
promoted.
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Promote canaries in all groups:
```
```shell
# Have two task groups waiting for promotion.
$ nomad status example
ID = example
@ -136,7 +136,7 @@ f2409f7d a8dcce2d web 0 stop complete 07/25/17 18:31:34 UT
Promote canaries in a particular group:
```
```shell
# Have two task groups waiting for promotion.
$ nomad status example
ID = example
@ -219,3 +219,6 @@ cee52788 6240eed6 web 0 run running 07/25/17 18:37:08 UT
ee8f972e 6240eed6 web 0 run running 07/25/17 18:37:08 UTC
0ee7800c 6240eed6 cache 0 stop complete 07/25/17 18:37:08 UTC
```
[job revert]: /docs/commands/job/revert.html
[eval status]: /docs/commands/eval-status.html

View File

@ -9,25 +9,24 @@ description: >
# Command: job revert
The `job revert` command is used to revert a job to a prior version of the
job. The available versions to revert to can be found using [`job
history`](/docs/commands/job/history.html) command.
job. The available versions to revert to can be found using [`job history`]
command.
The revert command will use a Vault token with the following preference:
first the `-vault-token` flag, then the `$VAULT_TOKEN` environment variable.
Because the vault token used to [run](/docs/commands/job/run.html) the targeted
job version was not persisted, it must be provided to revert if the targeted
job version includes Vault policies and the Nomad servers were
[configured](/docs/configuration/vault.html#allow_unauthenticated)
to require authentication.
Because the vault token used to [run] the targeted job version was not
persisted, it must be provided to revert if the targeted job version includes
Vault policies and the Nomad servers were configured to
[require authentication].
## Usage
```
```plaintext
nomad job revert [options] <job> <version>
```
The `job revert` command requires two inputs, the job ID and the version of that job
to revert to.
The `job revert` command requires two inputs, the job ID and the version of that
job to revert to.
## General Options
@ -35,21 +34,21 @@ to revert to.
## Revert Options
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command.
* `-vault-token`: If set, the passed Vault token is sent along with the revert request
to the Nomad servers. This overrides the token found in the $VAULT_TOKEN environment
variable.
- `-vault-token`: If set, the passed Vault token is sent along with the revert
request to the Nomad servers. This overrides the token found in the
$VAULT_TOKEN environment variable.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Revert to an older version of a job:
```
```shell
$ nomad job history -p example
Version = 1
Stable = false
@ -104,3 +103,8 @@ Version = 0
Stable = false
Submit Date = 07/25/17 21:27:18 UTC
```
[`job history`]: /docs/commands/job/history.html
[eval status]: /docs/commands/eval-status.html
[require authentication]: /docs/configuration/vault.html#allow_unauthenticated
[run]: /docs/commands/job/run.html

View File

@ -7,25 +7,24 @@ description: >
---
# Command: job run
**Alias: `nomad run`**
The `job run` command is used to submit new jobs to Nomad or to update existing
jobs. Job files must conform to the [job specification](/docs/job-specification/index.html)
format.
jobs. Job files must conform to the [job specification] format.
## Usage
```
```plaintext
nomad job run [options] <job file>
```
The `job run` command requires a single argument, specifying the path to a file
containing a valid [job specification](/docs/job-specification/index.html). This file
will be read and the job will be submitted to Nomad for scheduling. If the
supplied path is "-", the job file is read from STDIN. Otherwise it is read
from the file at the supplied path or downloaded and read from URL specified.
Nomad downloads the job file using [`go-getter`](https://github.com/hashicorp/go-getter)
and supports `go-getter` syntax.
containing a valid [job specification]. This file will be read and the job will
be submitted to Nomad for scheduling. If the supplied path is "-", the job file
is read from STDIN. Otherwise it is read from the file at the supplied path or
downloaded and read from URL specified. Nomad downloads the job file using
[`go-getter`] and supports `go-getter` syntax.
By default, on successful job submission the run command will enter an
interactive monitor and display log information detailing the scheduling
@ -50,34 +49,35 @@ precedence, going from highest to lowest: the `-vault-token` flag, the
## Run Options
* `-check-index`: If set, the job is only registered or
- `-check-index`: If set, the job is only registered or
updated if the passed job modify index matches the server side version.
If a check-index value of zero is passed, the job is only registered if it does
not yet exist. If a non-zero value is passed, it ensures that the job is being
updated from a known state. The use of this flag is most common in conjunction
with [`job plan` command](/docs/commands/job/plan.html).
with [`job plan` command].
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
- `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command
[eval status] command.
* `-output`: Output the JSON that would be submitted to the HTTP API without
- `-output`: Output the JSON that would be submitted to the HTTP API without
submitting the job.
* `-policy-override`: Sets the flag to force override any soft mandatory Sentinel policies.
- `-policy-override`: Sets the flag to force override any soft mandatory
Sentinel policies.
* `-vault-token`: If set, the passed Vault token is stored in the job before
- `-vault-token`: If set, the passed Vault token is stored in the job before
sending to the Nomad servers. This allows passing the Vault token without
storing it in the job file. This overrides the token found in the $VAULT_TOKEN
environment variable and that found in the job.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
## Examples
Schedule the job contained in the file `job1.nomad`, monitoring placement:
```
```shell
$ nomad job run job1.nomad
==> Monitoring evaluation "52dee78a"
Evaluation triggered by job "example"
@ -90,7 +90,7 @@ $ nomad job run job1.nomad
<a id="check-index"></a> Update the job using `check-index`:
```
```shell
$ nomad job run -check-index 5 example.nomad
Enforcing job modify index 5: job exists with conflicting job modify index: 6
Job not updated
@ -106,7 +106,7 @@ $ nomad job run -check-index 6 example.nomad
Schedule the job contained in `job1.nomad` and return immediately:
```
```shell
$ nomad job run -detach job1.nomad
4947e728
```
@ -114,7 +114,7 @@ $ nomad job run -detach job1.nomad
Schedule a job which cannot be successfully placed. This results in a scheduling
failure and the specifics of the placement are printed:
```
```shell
$ nomad job run failing.nomad
==> Monitoring evaluation "2ae0e6a5"
Evaluation triggered by job "example"
@ -125,3 +125,8 @@ $ nomad job run failing.nomad
* Constraint "${attr.kernel.name} = linux" filtered 1 nodes
Evaluation "67493a64" waiting for additional capacity to place remainder
```
[`go-getter`]: https://github.com/hashicorp/go-getter
[`job plan` command]: /docs/commands/job/plan.html
[eval status]: /docs/commands/eval-status.html
[job specification]: /docs/job-specification/index.html

View File

@ -12,19 +12,20 @@ The `job status` command displays status information for a job.
## Usage
```
```plaintext
nomad job status [options] [job]
```
This command accepts an optional job ID or prefix as the sole argument. If there
is an exact match based on the provided job ID or prefix, then information about
the specific job is queried and displayed. Otherwise, a list of matching jobs and
information will be displayed.
the specific job is queried and displayed. Otherwise, a list of matching jobs
and information will be displayed.
If the ID is omitted, the command lists out all of the existing jobs and a few of
the most useful status fields for each. As of Nomad 0.7.1, alloc status also shows allocation
modification time in addition to create time. When the `-verbose` flag is not set, allocation
creation and modify times are shown in a shortened relative time format like `5m ago`.
If the ID is omitted, the command lists out all of the existing jobs and a few
of the most useful status fields for each. As of Nomad 0.7.1, alloc status also
shows allocation modification time in addition to create time. When the
`-verbose` flag is not set, allocation creation and modify times are shown in a
shortened relative time format like `5m ago`.
## General Options
@ -32,21 +33,22 @@ creation and modify times are shown in a shortened relative time format like `5m
## Status Options
* `-all-allocs`: Display all allocations matching the job ID, even those from an
- `-all-allocs`: Display all allocations matching the job ID, even those from an
older instance of the job.
* `-evals`: Display the evaluations associated with the job.
- `-evals`: Display the evaluations associated with the job.
* `-short`: Display short output. Used only when a single node is being queried.
- `-short`: Display short output. Used only when a single node is being queried.
Drops verbose node allocation data from the output.
* `-verbose`: Show full information. Allocation create and modify times are shown in `yyyy/mm/dd hh:mm:ss` format.
- `-verbose`: Show full information. Allocation create and modify times are
shown in `yyyy/mm/dd hh:mm:ss` format.
## Examples
List of all jobs:
```
```shell
$ nomad job status
ID Type Priority Status Submit Date
job1 service 80 running 07/25/17 15:47:11 UTC
@ -56,7 +58,7 @@ job3 service 50 dead (stopped) 07/22/17 16:34:48 UTC
Short view of a specific job:
```
```shell
$ nomad job status -short job1
ID = job1
Name = Test Job
@ -71,7 +73,7 @@ Parameterized = false
Full status information of a job:
```
```shell
$ nomad job status example
ID = example
Name = example
@ -103,7 +105,7 @@ ID Node ID Task Group Version Desired Status Created Modified
Full status information of a periodic job:
```
```shell
$ nomad job status example
ID = example
Name = example
@ -129,7 +131,7 @@ example/periodic-1500998420 running
Full status information of a parameterized job:
```
```shell
$ nomad job status example
ID = example
Name = example
@ -158,7 +160,7 @@ example/dispatch-1485411499-fa2ee40e running
Full status information of a job with placement failures:
```
```shell
$ nomad job status example
ID = example
Name = example
@ -198,9 +200,9 @@ a17b7d3d 3f38ecb4 cache 0 run running 5m ago 5m ago
Full status information showing evaluations with a placement failure. The in
progress evaluation denotes that Nomad is blocked waiting for resources to
become availables so that it can place the remaining allocations.
become available so that it can place the remaining allocations.
```
```shell
$ nomad job status -evals example
ID = example
Name = example

View File

@ -7,6 +7,7 @@ description: >
---
# Command: job stop
**Alias: `nomad stop`**
The `job stop` command is used to stop a running job and signals the scheduler
@ -14,14 +15,14 @@ to cancel all of the running allocations.
## Usage
```
```plaintext
nomad job stop [options] <job>
```
The `job stop` command requires a single argument, specifying the job ID or prefix to
cancel. If there is an exact match based on the provided job ID or prefix, then
the job will be cancelled. Otherwise, a list of matching jobs and information
will be displayed.
The `job stop` command requires a single argument, specifying the job ID or
prefix to cancel. If there is an exact match based on the provided job ID or
prefix, then the job will be cancelled. Otherwise, a list of matching jobs and
information will be displayed.
Stop will issue a request to deregister the matched job and then invoke an
interactive monitor that exits automatically once the scheduler has processed
@ -33,25 +34,23 @@ the request. It is safe to exit the monitor early using ctrl+c.
## Stop Options
* `-detach`: Return immediately instead of entering monitor mode. After the
- `-detach`: Return immediately instead of entering monitor mode. After the
deregister command is submitted, a new evaluation ID is printed to the screen,
which can be used to examine the evaluation using the
[eval status](/docs/commands/eval-status.html) command.
which can be used to examine the evaluation using the [eval status] command.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
* `-yes`: Automatic yes to prompts.
- `-yes`: Automatic yes to prompts.
* `-purge`: Purge is used to stop the job and purge it from the system. If not
- `-purge`: Purge is used to stop the job and purge it from the system. If not
set, the job will still be queryable and will be purged by the garbage
collector.
## Examples
Stop the job with ID "job1":
```
```shell
$ nomad job stop job1
==> Monitoring evaluation "43bfe672"
Evaluation status changed: "pending" -> "complete"
@ -60,7 +59,9 @@ $ nomad job stop job1
Stop the job with ID "job1" and return immediately:
```
```shell
$ nomad job stop -detach job1
507d26cb
```
[eval status]: /docs/commands/eval-status.html

View File

@ -7,24 +7,24 @@ description: >
---
# Command: job validate
**Alias: `nomad validate`**
The `job validate` command is used to check a [HCL job specification](/docs/job-specification/index.html)
for any syntax errors or validation problems.
The `job validate` command is used to check an HCL [job specification] for any
syntax errors or validation problems.
## Usage
```
```plaintext
nomad job validate <file>
```
The `job validate` command requires a single argument, specifying the path to a file
containing a [HCL job specification](/docs/job-specification/index.html). This file
will be read and the job checked for any problems. If the
supplied path is "-", the job file is read from STDIN. Otherwise it is read
from the file at the supplied path or downloaded and read from URL specified.
Nomad downloads the job file using [`go-getter`](https://github.com/hashicorp/go-getter)
and supports `go-getter` syntax.
The `job validate` command requires a single argument, specifying the path to a
file containing an HCL [job specification]. This file will be read and the job
checked for any problems. If the supplied path is "-", the job file is read from
STDIN. Otherwise it is read from the file at the supplied path or downloaded and
read from URL specified. Nomad downloads the job file using [`go-getter`] and
supports `go-getter` syntax.
On successful validation, exit code 0 will be returned, otherwise an exit code
of 1 indicates an error.
@ -33,7 +33,7 @@ of 1 indicates an error.
Validate a job with invalid syntax:
```
```shell
$ nomad job validate example.nomad
Job validation errors:
1 error(s) occurred:
@ -45,7 +45,7 @@ Job validation errors:
Validate a job that has a configuration that causes warnings:
```
```shell
$ nomad job validate example.nomad
Job Warnings:
1 warning(s):
@ -56,3 +56,6 @@ Job Warnings:
Job validation successful
```
[`go-getter`]: https://github.com/hashicorp/go-getter
[job specification]: /docs/job-specification/index.html

View File

@ -20,11 +20,11 @@ Usage: `nomad namespace <subcommand> [options]`
Run `nomad namespace <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`namespace apply`][apply] - Create or update a namespace
* [`namespace delete`][delete] - Delete a namespace
* [`namespace inspect`][inspect] - Inspect a namespace
* [`namespace list`][list] - List available namespaces
* [`namespace status`][status] - Display a namespace's status
- [`namespace apply`][apply] - Create or update a namespace
- [`namespace delete`][delete] - Delete a namespace
- [`namespace inspect`][inspect] - Inspect a namespace
- [`namespace list`][list] - List available namespaces
- [`namespace status`][status] - Display a namespace's status
[apply]: /docs/commands/namespace/apply.html "Create or update a namespace"
[delete]: /docs/commands/namespace/delete.html "Delete a namespace"

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad namespace apply [options] <namespace>
```
@ -28,15 +28,15 @@ or updated.
## Apply Options
* `-quota` : An optional quota to apply to the namespace.
- `-quota` : An optional quota to apply to the namespace.
* `-description` : An optional human readable description for the namespace.
- `-description` : An optional human readable description for the namespace.
## Examples
Create a namespace with a quota
```
$ nomad namespace apply -description "Prod API servers" -quota prod api-prod
```shell
$ nomad namespace apply -description "Prod API servers" -quota prod api-prod
Successfully applied namespace "api-prod"!
```

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad namespace delete [options] <namespace>
```
@ -29,7 +29,7 @@ The `namespace delete` command requires the name of the namespace to be deleted.
Delete a namespace
```
```shell
$ nomad namespace delete api-prod
Successfully deleted namespace "api-prod"!
```

View File

@ -17,7 +17,7 @@ Enterprise.
## Usage
```
```plaintext
nomad namespace inspect [options] <namespace_name>
```
@ -27,13 +27,13 @@ nomad namespace inspect [options] <namespace_name>
## Inspect Options
* `-t` : Format and display the namespace using a Go template.
- `-t` : Format and display the namespace using a Go template.
## Examples
Inspect a namespace:
```
```shell
$ nomad namespace inspect default
{
"CreateIndex": 5,

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad namespace list [options]
```
@ -27,15 +27,15 @@ The `namespace list` command requires no arguments.
## List Options
* `-json` : Output the namespaces in their JSON format.
- `-json` : Output the namespaces in their JSON format.
* `-t` : Format and display the namespaces using a Go template.
- `-t` : Format and display the namespaces using a Go template.
## Examples
List all namespaces:
```
```shell
$ nomad namespace list
Name Description
default Default shared namespace

View File

@ -17,7 +17,7 @@ Enterprise.
## Usage
```
```plaintext
nomad namespace status [options] <namespace_name>
```
@ -29,7 +29,7 @@ nomad namespace status [options] <namespace_name>
View the status of a namespace:
```
```shell
$ nomad namespace status default
Name = default
Description = Default shared namespace

View File

@ -7,7 +7,7 @@ description: >
---
# Command: node
The `node` command is used to interact with nodes.
## Usage
@ -17,10 +17,14 @@ Usage: `nomad node <subcommand> [options]`
Run `nomad node <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`node config`][config] - View or modify client configuration details
* [`node drain`][drain] - Set drain mode on a given node
* [`node eligibility`][eligibility] - Toggle scheduling eligibility on a given node
* [`node status`][status] - Display status information about nodes
- [`node config`][config] - View or modify client configuration details
- [`node drain`][drain] - Set drain mode on a given node
- [`node eligibility`][eligibility] - Toggle scheduling eligibility on a given
node
- [`node status`][status] - Display status information about nodes
[config]: /docs/commands/node/config.html "View or modify client configuration details"
[drain]: /docs/commands/node/drain.html "Set drain mode on a given node"

View File

@ -14,7 +14,7 @@ the running client configurations it supports.
## Usage
```
```plaintext
nomad node config [options]
```
@ -27,13 +27,12 @@ description below for specific usage information and requirements.
## Node Config Options
* `-servers`: List the client's known servers. Client nodes do not participate
- `-servers`: List the client's known servers. Client nodes do not participate
in the gossip pool, and instead register with these servers periodically over
the network. The initial value of this list may come from configuration files
using the [`servers`](/docs/configuration/client.html#servers)
configuration option in the client block.
using the [`servers`] configuration option in the client block.
* `-update-servers`: Updates the client's server list using the provided
- `-update-servers`: Updates the client's server list using the provided
arguments. Multiple server addresses may be passed using multiple arguments.
When updating the servers list, you must specify ALL of the server nodes you
wish to configure. The set is updated atomically. It is an error to specify
@ -44,7 +43,7 @@ description below for specific usage information and requirements.
Query the currently known servers:
```
```shell
$ nomad node config -servers
server1:4647
server2:4647
@ -52,6 +51,8 @@ server2:4647
Update the list of servers:
```
```shell
$ nomad node config -update-servers server1:4647 server2:4647 server3:4647 server4
```
[`servers`]: /docs/configuration/client.html#servers

View File

@ -25,15 +25,14 @@ eligibility -disable` on all of their node IDs, and then run `node drain
-enable`. This will ensure allocations drained from the first node are not
placed on another node about to be drained.
The [node status](/docs/commands/node/status.html) command compliments this
nicely by providing the current drain status of a given node.
The [node status] command compliments this nicely by providing the current drain
status of a given node.
See the [Workload Migration guide](/guides/operations/node-draining.html) for detailed
examples of node draining.
See the [Workload Migration guide] for detailed examples of node draining.
## Usage
```
```plaintext
nomad node drain [options] <node>
```
@ -51,30 +50,40 @@ operation is desired.
## Drain Options
* `-enable`: Enable node drain mode.
* `-disable`: Disable node drain mode.
* `-deadline`: Set the deadline by which all allocations must be moved off the
- `-enable`: Enable node drain mode.
- `-disable`: Disable node drain mode.
- `-deadline`: Set the deadline by which all allocations must be moved off the
node. Remaining allocations after the deadline are force removed from the
node. Defaults to 1 hour.
* `-detach`: Return immediately instead of entering monitor mode.
* `-monitor`: Enter monitor mode directly without modifying the drain status.
* `-force`: Force remove allocations off the node immediately.
* `-no-deadline`: No deadline allows the allocations to drain off the node
- `-detach`: Return immediately instead of entering monitor mode.
- `-monitor`: Enter monitor mode directly without modifying the drain status.
- `-force`: Force remove allocations off the node immediately.
- `-no-deadline`: No deadline allows the allocations to drain off the node
without being force stopped after a certain deadline.
* `-ignore-system`: Ignore system allows the drain to complete without stopping
- `-ignore-system`: Ignore system allows the drain to complete without stopping
system job allocations. By default system jobs are stopped last.
* `-keep-ineligible`: Keep ineligible will maintain the node's scheduling
- `-keep-ineligible`: Keep ineligible will maintain the node's scheduling
ineligibility even if the drain is being disabled. This is useful when an
existing drain is being cancelled but additional scheduling on the node is not
desired.
* `-self`: Drain the local node.
* `-yes`: Automatic yes to prompts.
- `-self`: Drain the local node.
- `-yes`: Automatic yes to prompts.
## Examples
Enable drain mode on node with ID prefix "4d2ba53b":
```
```shell
$ nomad node drain -enable f4e8a9e5
Are you sure you want to enable drain mode for node "f4e8a9e5-30d8-3536-1e6f-cda5c869c35e"? [y/N] y
2018-03-30T23:13:16Z: Ctrl-C to stop monitoring: will not cancel the node drain
@ -94,14 +103,14 @@ Are you sure you want to enable drain mode for node "f4e8a9e5-30d8-3536-1e6f-cda
Enable drain mode on the local node:
```
```shell
$ nomad node drain -enable -self
...
```
Enable drain mode but do not stop system jobs:
```
```shell
$ nomad node drain -enable -ignore-system 4d2ba53b
...
```
@ -110,14 +119,14 @@ Disable drain mode but keep the node ineligible for scheduling. Useful for
inspecting the current state of a misbehaving node without Nomad trying to
start or migrate allocations:
```
```shell
$ nomad node drain -disable -keep-ineligible 4d2ba53b
...
```
Enable drain mode and detach from monitoring, then reattach later:
```
```shell
$ nomad node drain -enable -detach -self
...
$ nomad node drain -self -monitor
@ -126,3 +135,5 @@ $ nomad node drain -self -monitor
[eligibility]: /docs/commands/node/eligibility.html
[migrate]: /docs/job-specification/migrate.html
[node status]: /docs/commands/node/status.html
[Workload Migration guide]: /guides/operations/node-draining.html

View File

@ -28,7 +28,7 @@ without the risk of additional work being assigned to it.
## Usage
```
```plaintext
nomad node eligibility [options] <node>
```
@ -46,26 +46,25 @@ operation is desired.
## Drain Options
* `-enable`: Enable scheduling eligbility.
* `-disable`: Disable scheduling eligibility.
* `-self`: Set eligibility for the local node.
* `-yes`: Automatic yes to prompts.
- `-enable`: Enable scheduling eligibility.
- `-disable`: Disable scheduling eligibility.
- `-self`: Set eligibility for the local node.
- `-yes`: Automatic yes to prompts.
## Examples
Enable scheduling eligibility on node with ID prefix "574545c5":
```
```shell
$ nomad node eligibility -enable 574545c5
Node "574545c5-c2d7-e352-d505-5e2cb9fe169f" scheduling eligibility set: eligible for scheduling
```
Disable scheduling eligibility on the local node:
```
```shell
$ nomad node eligibility -disable -self
Node "574545c5-c2d7-e352-d505-5e2cb9fe169f" scheduling eligibility set: ineligible for scheduling
```
[drain]: /docs/commands/node/drain.html

View File

@ -14,7 +14,7 @@ output.
## Usage
```
```plaintext
nomad node status [options] [node]
```
@ -26,7 +26,7 @@ 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.
`-self` flag is useful to quickly access the status of the local node.
## General Options
@ -34,27 +34,26 @@ information will be displayed. If running the command on a Nomad Client, the
## Status Options
* `-self`: Query the status of the local node.
- `-self`: Query the status of the local node.
* `-stats`: Display detailed resource usage statistics.
- `-stats`: Display detailed resource usage statistics.
* `-allocs`: When a specific node is not being queried, shows the number of
- `-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.
- `-short`: Display short output. Used only when querying a single node.
* `-verbose`: Show full information.
- `-verbose`: Show full information.
* `-json` : Output the node in its JSON format.
* `-t` : Format and display node using a Go template.
- `-json` : Output the node in its JSON format.
- `-t` : Format and display node using a Go template.
## Examples
List view:
```
```shell
$ nomad node status
ID DC Name Class Drain Eligibility Status
a72dfba2 dc1 node1 <none> false eligible ready
@ -63,7 +62,7 @@ a72dfba2 dc1 node1 <none> false eligible ready
List view, with running allocations:
```
```shell
$ nomad node status -allocs
ID DC Name Class Drain Eligibility Status Running Allocs
4d2ba53b dc1 node1 <none> false eligible ready 1
@ -72,7 +71,7 @@ ID DC Name Class Drain Eligibility Status Running Allocs
Single-node view in short mode:
```
```shell
$ nomad node status -short 1f3f03ea
ID = c754da1f
Name = nomad
@ -89,7 +88,7 @@ ID Eval ID Job ID Task Group Desired Status Client Status
Full output for a single node:
```
```shell
$ nomad node status 1f3f03ea
ID = c754da1f
Name = nomad-server01
@ -132,7 +131,7 @@ ID Eval ID Job ID Task Group Desired Status Client Status
Using `-self` when on a Nomad Client:
```
```shell
$ nomad node status -self
ID = c754da1f
Name = nomad-client01
@ -190,14 +189,19 @@ 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
- *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:
```
```shell
$ nomad node status -stats c754da1f
ID = c754da1f
Name = nomad-client01
@ -278,7 +282,7 @@ ed3665f5 8bf94335 example cache run running
To view verbose information about the node:
```
```shell
$ nomad node status -verbose c754da1f
ID = c754da1f-6337-b86d-47dc-2ef4c71aca14
Name = nomad

View File

@ -14,10 +14,9 @@ as interacting with the Raft subsystem. This was added in Nomad 0.5.5.
~> Use this command with extreme caution, as improper use could lead to a Nomad
outage and even loss of data.
See the [Outage Recovery](/guides/operations/outage.html) guide for some examples of how
this command is used. For an API to perform these operations programmatically,
please see the documentation for the [Operator](/api/operator.html)
endpoint.
See the [Outage Recovery guide] guide for some examples of how this command is
used. For an API to perform these operations programmatically, please see the
documentation for the [Operator] endpoint.
## Usage
@ -26,16 +25,27 @@ Usage: `nomad operator <subcommand> <subcommand> [options]`
Run `nomad operator <subcommand>` with no arguments for help on that subcommand.
The following subcommands are available:
* [`operator autopilot get-config`][get-config] - Display the current Autopilot configuration
* [`operator autopilot set-config`][set-config] - Modify the current Autopilot configuration
* [`operator keygen`][keygen] - Generates a new encryption key
* [`operator keyring`][keyring] - Manages gossip layer encryption keys
* [`operator raft list-peers`][list] - Display the current Raft peer configuration
* [`operator raft remove-peer`][remove] - Remove a Nomad server from the Raft configuration
- [`operator autopilot get-config`][get-config] - Display the current Autopilot
configuration
- [`operator autopilot set-config`][set-config] - Modify the current Autopilot
configuration
- [`operator keygen`][keygen] - Generates a new encryption key
- [`operator keyring`][keyring] - Manages gossip layer encryption keys
- [`operator raft list-peers`][list] - Display the current Raft peer
configuration
- [`operator raft remove-peer`][remove] - Remove a Nomad server from the Raft
configuration
[get-config]: /docs/commands/operator/autopilot-get-config.html "Autopilot Get Config command"
[set-config]: /docs/commands/operator/autopilot-set-config.html "Autopilot Set Config command"
[keygen]: /docs/commands/operator/keygen.html "Generates a new encryption key"
[keyring]: /docs/commands/operator/keyring.html "Manages gossip layer encryption keys"
[list]: /docs/commands/operator/raft-list-peers.html "Raft List Peers command"
[Operator]: /api/operator.html "Operator API documentation"
[Outage Recovery guide]: /guides/operations/outage.html
[remove]: /docs/commands/operator/raft-remove-peer.html "Raft Remove Peer command"
[set-config]: /docs/commands/operator/autopilot-set-config.html "Autopilot Set Config command"

View File

@ -8,12 +8,12 @@ description: >
# Command: operator autopilot get-config
The Autopilot operator command is used to view the current Autopilot configuration. See the
[Autopilot Guide](/guides/operations/autopilot.html) for more information about Autopilot.
The Autopilot operator command is used to view the current Autopilot
configuration. See the [Autopilot Guide] for more information about Autopilot.
## Usage
```
```plaintext
nomad operator autopilot get-config [options]
```
@ -23,7 +23,8 @@ nomad operator autopilot get-config [options]
The output looks like this:
```
```shell
$ nomad operator autopilot get-config
CleanupDeadServers = true
LastContactThreshold = 200ms
MaxTrailingLogs = 250
@ -61,3 +62,5 @@ UpgradeMigrationTag = ""
- `UpgradeVersionTag` - Controls the node-meta key to use for
version info when performing upgrade migrations. If left blank, the Nomad
version will be used.
[Autopilot Guide]: /guides/operations/autopilot.html

View File

@ -8,13 +8,12 @@ description: >
# Command: operator autopilot set-config
The Autopilot operator command is used to set the current Autopilot configuration. See the
[Autopilot Guide](/guides/operations/autopilot.html) for more information about Autopilot.
The Autopilot operator command is used to set the current Autopilot
configuration. See the [Autopilot Guide] for more information about Autopilot.
## Usage
```
```plaintext
nomad operator autopilot set-config [options]
```
@ -24,35 +23,41 @@ nomad operator autopilot set-config [options]
## Set Config Options
* `-cleanup-dead-servers` - Specifies whether to enable automatic removal of dead servers
upon the successful joining of new servers to the cluster. Must be one of `[true|false]`.
- `-cleanup-dead-servers` - Specifies whether to enable automatic removal of
dead servers upon the successful joining of new servers to the cluster. Must be
one of `[true|false]`.
* `-last-contact-threshold` - Controls the maximum amount of time a server can go without contact
from the leader before being considered unhealthy. Must be a duration value such as `200ms`.
- `-last-contact-threshold` - Controls the maximum amount of time a server can
go without contact from the leader before being considered unhealthy. Must be a
duration value such as `200ms`.
* `-max-trailing-logs` - Controls the maximum number of log entries that a server can trail
the leader by before being considered unhealthy.
- `-max-trailing-logs` - Controls the maximum number of log entries that a
server can trail the leader by before being considered unhealthy.
* `-server-stabilization-time` - Controls the minimum amount of time a server must be stable in
the 'healthy' state before being added to the cluster. Only takes effect if all servers are
running Raft protocol version 3 or higher. Must be a duration value such as `10s`.
- `-server-stabilization-time` - Controls the minimum amount of time a server
must be stable in the 'healthy' state before being added to the cluster. Only
takes effect if all servers are running Raft protocol version 3 or higher. Must
be a duration value such as `10s`.
* `-disable-upgrade-migration` - (Enterprise-only) Controls whether Nomad will avoid promoting
new servers until it can perform a migration. Must be one of `[true|false]`.
- `-disable-upgrade-migration` - (Enterprise-only) Controls whether Nomad will
avoid promoting new servers until it can perform a migration. Must be one of
`[true|false]`.
* `-redundancy-zone-tag`- (Enterprise-only) Controls the
[`redundancy_zone`](/docs/configuration/server.html#redundancy_zone)
- `-redundancy-zone-tag`- (Enterprise-only) Controls the [`redundancy_zone`]
used for separating servers into different redundancy zones.
* `-upgrade-version-tag` - (Enterprise-only) Controls the
[`upgrade_version`](/docs/configuration/server.html#upgrade_version) to
- `-upgrade-version-tag` - (Enterprise-only) Controls the [`upgrade_version`] to
use for version info when performing upgrade migrations. If left blank, the
Nomad version will be used.
The output looks like this:
```
```plaintext
Configuration updated!
```
The return code will indicate success or failure.
[`redundancy_zone`]: /docs/configuration/server.html#redundancy_zone
[`upgrade_version`]: /docs/configuration/server.html#upgrade_version
[Autopilot Guide]: /guides/operations/autopilot.html

View File

@ -3,27 +3,26 @@ layout: "docs"
page_title: "Commands: operator keygen"
sidebar_current: "docs-commands-operator-keygen"
description: >
The `operator keygen` command generates an encryption key that can be used for Nomad
server's gossip traffic encryption. The keygen command uses a
The `operator keygen` command generates an encryption key that can be used for
Nomad server's gossip traffic encryption. The keygen command uses a
cryptographically strong pseudo-random number generator to generate the key.
---
# Command: operator keygen
The `operator keygen` command generates an encryption key that can be used for Nomad
server's gossip traffic encryption. The keygen command uses a cryptographically
strong pseudo-random number generator to generate the key.
The `operator keygen` command generates an encryption key that can be used for
Nomad server's gossip traffic encryption. The keygen command uses a
cryptographically strong pseudo-random number generator to generate the key.
## Usage
## Usage
```
```plaintext
nomad operator keygen
```
## Example
```
nomad operator keygen
```shell
$ nomad operator keygen
YgZOXLMhC7TtZqeghMT8+w==
```

View File

@ -24,34 +24,36 @@ All variations of the `keyring` command return 0 if all nodes reply and there
are no errors. If any node fails to reply or reports failure, the exit code
will be 1.
## Usage
Usage: `nomad operator keyring [options]`
```plaintext
nomad operator keyring [options]
```
Only one actionable argument may be specified per run, including `-list`,
`-install`, `-remove`, and `-use`.
The list of available flags are:
* `-list` - List all keys currently in use within the cluster.
- `-list` - List all keys currently in use within the cluster.
* `-install` - Install a new encryption key. This will broadcast the new key to
- `-install` - Install a new encryption key. This will broadcast the new key to
all members in the cluster.
* `-use` - Change the primary encryption key, which is used to encrypt messages.
- `-use` - Change the primary encryption key, which is used to encrypt messages.
The key must already be installed before this operation can succeed.
* `-remove` - Remove the given key from the cluster. This operation may only be
- `-remove` - Remove the given key from the cluster. This operation may only be
performed on keys which are not currently the primary key.
## Output
The output of the `nomad operator keyring -list` command consolidates information from
all the Nomad servers from all datacenters and regions to provide a simple and
easy to understand view of the cluster.
The output of the `nomad operator keyring -list` command consolidates
information from all the Nomad servers from all datacenters and regions to
provide a simple and easy to understand view of the cluster.
```
```shell
$ nomad operator keyring -list
==> Gathering installed encryption keys...
Key
PGm64/neoebUBqYR/lZTbA==

View File

@ -11,14 +11,13 @@ description: >
The Raft list-peers command is used to display the current Raft peer
configuration.
See the [Outage Recovery](/guides/operations/outage.html) guide for some examples of how
this command is used. For an API to perform these operations programmatically,
please see the documentation for the [Operator](/api/operator.html)
endpoint.
See the [Outage Recovery] guide for some examples of how this command is used.
For an API to perform these operations programmatically, please see the
documentation for the [Operator] endpoint.
## Usage
```
```plaintext
nomad operator raft list-peers [options]
```
@ -28,7 +27,7 @@ nomad operator raft list-peers [options]
## List Peers Options
* `-stale`: The stale argument defaults to "false" which means the leader
- `-stale`: The stale argument defaults to "false" which means the leader
provides the result. If the cluster is in an outage state without a leader, you
may need to set `-stale` to "true" to get the configuration from a non-leader
server.
@ -37,7 +36,7 @@ server.
An example output with three servers is as follows:
```
```shell
$ nomad operator raft list-peers
Node ID Address State Voter
nomad-server01.global 10.10.11.5:4647 10.10.11.5:4647 follower true
@ -58,3 +57,6 @@ Raft configuration.
- `Voter` is "true" or "false", indicating if the server has a vote in the Raft
configuration. Future versions of Nomad may add support for non-voting servers.
[Operator]: /api/operator.html
[Outage Recovery]: /guides/operations/outage.html

View File

@ -13,20 +13,17 @@ Remove the Nomad server with given address from the Raft configuration.
There are rare cases where a peer may be left behind in the Raft quorum even
though the server is no longer present and known to the cluster. This command
can be used to remove the failed server so that it is no longer affects the Raft
quorum. If the server still shows in the output of the [`nomad
server members`](/docs/commands/server/members.html) command, it is preferable
to clean up by simply running [`nomad
server force-leave`](/docs/commands/server/force-leave.html) instead of this
command.
quorum. If the server still shows in the output of the [`nomad server members`]
command, it is preferable to clean up by running [`nomad server force-leave`]
instead of this command.
See the [Outage Recovery](/guides/operations/outage.html) guide for some examples of how
this command is used. For an API to perform these operations programmatically,
please see the documentation for the [Operator](/api/operator.html)
endpoint.
See the [Outage Recovery] guide for some examples of how this command is used.
For an API to perform these operations programmatically, please see the
documentation for the [Operator] endpoint.
## Usage
```
```plaintext
nomad operator raft remove-peer [options]
```
@ -36,8 +33,13 @@ nomad operator raft remove-peer [options]
## Remove Peer Options
* `-peer-address`: Remove a Nomad server with given address from the Raft
configuration. The format is "IP:port"
- `-peer-address`: Remove a Nomad server with given address from the Raft
configuration. The format is "IP:port"
* `-peer-id`: Remove a Nomad server with the given ID from the Raft
configuration. The format is "id"
- `-peer-id`: Remove a Nomad server with the given ID from the Raft
configuration. The format is "id"
[`nomad server force-leave`]: /docs/commands/server/force-leave.html "Nomad server force-leave command"
[`nomad server members`]: /docs/commands/server/members.html "Nomad server members command"
[Operator]: /api/operator.html "Nomad Operator API"
[Outage Recovery]: /guides/operations/outage.html

View File

@ -20,12 +20,12 @@ Usage: `nomad quota <subcommand> [options]`
Run `nomad quota <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`quota apply`][quotaapply] - Create or update a quota specification
* [`quota delete`][quotadelete] - Delete a quota specification
* [`quota init`][quotainit] - Create an example quota specification file
* [`quota inspect`][quotainspect] - Inspect a quota specification
* [`quota list`][quotalist] - List quota specifications
* [`quota status`][quotastatus] - Display a quota's status and current usage
- [`quota apply`][quotaapply] - Create or update a quota specification
- [`quota delete`][quotadelete] - Delete a quota specification
- [`quota init`][quotainit] - Create an example quota specification file
- [`quota inspect`][quotainspect] - Inspect a quota specification
- [`quota list`][quotalist] - List quota specifications
- [`quota status`][quotastatus] - Display a quota's status and current usage
[quotaapply]: /docs/commands/quota/apply.html
[quotadelete]: /docs/commands/quota/delete.html

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad quota apply [options] <name> <path>
```
@ -28,13 +28,13 @@ specification can be read from stdin by setting the path to "-".
## Apply Options
* `-json`: Parse the input as a JSON quota specification.
- `-json`: Parse the input as a JSON quota specification.
## Examples
Create a new quota specification:
```
```shell
$ nomad quota apply my-quota.hcl
Successfully applied quota specification "my-quota"!
```

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad quota delete <quota_name>
```
@ -29,7 +29,7 @@ The `quota delete` command requires the quota specification name as an argument.
Delete a quota specification:
```
```shell
$ nomad quota delete my-quota
Successfully deleted quota "my-quota"!
```

View File

@ -16,19 +16,19 @@ Enterprise.
## Usage
```
```plaintext
nomad quota init
```
## Init Options
* `-json`: Create an example JSON quota specification.
- `-json`: Create an example JSON quota specification.
## Examples
Create an example quota specification:
```
```shell
$ nomad quota init
Example quota specification written to spec.hcl
```

View File

@ -17,7 +17,7 @@ Enterprise.
## Usage
```
```plaintext
nomad quota inspect [options] <quota_name>
```
@ -27,13 +27,13 @@ nomad quota inspect [options] <quota_name>
## Inspect Options
* `-t` : Format and display the quota using a Go template.
- `-t` : Format and display the quota using a Go template.
## Examples
Inspect a quota specification:
```
```shell
$ nomad quota inspect default-quota
{
"Spec": {

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad quota list
```
@ -25,15 +25,15 @@ nomad quota list
## List Options
* `-json`: Output the quota specifications in a JSON format.
- `-json`: Output the quota specifications in a JSON format.
* `-t`: Format and display the quotas specifications using a Go template.
- `-t`: Format and display the quotas specifications using a Go template.
## Examples
List all quota specifications:
```
```shell
$ nomad quota list
Name Description
default Limit the shared default namespace

View File

@ -17,7 +17,7 @@ Enterprise.
## Usage
```
```plaintext
nomad quota status [options] <quota_name>
```
@ -29,7 +29,7 @@ nomad quota status [options] <quota_name>
View the status of a quota specification:
```
```shell
$ nomad quota status default-quota
Name = default-quota
Description = Limit the shared default namespace

View File

@ -20,10 +20,10 @@ Usage: `nomad sentinel <subcommand> [options]`
Run `nomad sentinel <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`sentinel apply`][apply] - Create a new or update existing Sentinel policies
* [`sentinel delete`][delete] - Delete an existing Sentinel policies
* [`sentinel list`][list] - Display all Sentinel policies
* [`sentinel read`][read] - Inspects an existing Sentinel policies
- [`sentinel apply`][apply] - Create a new or update existing Sentinel policies
- [`sentinel delete`][delete] - Delete an existing Sentinel policies
- [`sentinel list`][list] - Display all Sentinel policies
- [`sentinel read`][read] - Inspects an existing Sentinel policies
[delete]: /docs/commands/sentinel/delete.html
[list]: /docs/commands/sentinel/list.html

View File

@ -3,24 +3,27 @@ layout: "docs"
page_title: "Commands: sentinel apply"
sidebar_current: "docs-commands-sentinel-apply"
description: >
The sentinel apply command is used to write a new, or update an existing, Sentinel policy.
The sentinel apply command is used to write a new, or update an existing,
Sentinel policy.
---
# Command: sentinel apply
The `sentinel apply` command is used to write a new, or update an existing, Sentinel policy.
The `sentinel apply` command is used to write a new, or update an existing,
Sentinel policy.
~> Sentinel commands are new in Nomad 0.7 and are only available with Nomad
Enterprise.
## Usage
```
```plaintext
nomad sentinel apply [options] <Policy Name> <Policy File>
```
The `sentinel apply` command requires two arguments, the policy name and the policy file.
The policy file can be read from stdin by specifying "-" as the file name.
The `sentinel apply` command requires two arguments, the policy name and the
policy file. The policy file can be read from stdin by specifying "-" as the
file name.
## General Options
@ -28,18 +31,19 @@ The policy file can be read from stdin by specifying "-" as the file name.
## Apply Options
* `-description` : Sets a human readable description for the policy
- `-description` : Sets a human readable description for the policy
* `-scope` : (default: submit-job) Sets the scope of the policy and when it should be enforced.
- `-scope` : (default: submit-job) Sets the scope of the policy and when it
should be enforced.
* `-level` : (default: advisory) Sets the enforcement level of the policy. Must be one of advisory,
soft-mandatory, hard-mandatory.
- `-level` : (default: advisory) Sets the enforcement level of the policy. Must
be one of advisory, soft-mandatory, hard-mandatory.
## Examples
Write a policy:
```
```shell
$ nomad sentinel write -description "My test policy" foo test.sentinel
Successfully wrote "foo" Sentinel policy!
```

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad sentinel delete [options] <Policy Name>
```
@ -29,7 +29,7 @@ The `sentinel delete` command requires a single argument, the policy name.
Delete a policy:
```
```shell
$ nomad sentinel delete foo
Successfully deleted "foo" Sentinel policy!
```

View File

@ -8,14 +8,15 @@ description: >
# Command: sentinel list
The `sentinel list` command is used to display all the installed Sentinel policies.
The `sentinel list` command is used to display all the installed Sentinel
policies.
~> Sentinel commands are new in Nomad 0.7 and are only available with Nomad
Enterprise.
## Usage
```
```plaintext
nomad sentinel list [options]
```
@ -29,7 +30,7 @@ The `sentinel list` command requires no arguments.
List all policies:
```
```shell
$ nomad sentinel list
Name Scope Enforcement Level Description
foo submit-job advisory my test policy

View File

@ -15,7 +15,7 @@ Enterprise.
## Usage
```
```plaintext
nomad sentinel read [options] <Policy Name>
```
@ -27,13 +27,13 @@ The `sentinel read` command requires a single argument, the policy name.
## Read Options
* `-raw` : Output the raw policy only.
- `-raw` : Output the raw policy only.
## Examples
Read all policies:
```
```shell
$ nomad sentinel read foo
Name = foo
Scope = submit-job

View File

@ -7,7 +7,7 @@ description: >
---
# Command: server
Command: `nomad server`
The `server` command is used to interact with servers.
@ -19,9 +19,9 @@ Usage: `nomad server <subcommand> [options]`
Run `nomad server <subcommand> -h` for help on that subcommand. The following
subcommands are available:
* [`server force-leave`][force-leave] - Force a server into the 'left' state
* [`server join`][join] - Join server nodes together
* [`server members`][members] - Display a list of known servers and their status
- [`server force-leave`][force-leave] - Force a server into the 'left' state
- [`server join`][join] - Join server nodes together
- [`server members`][members] - Display a list of known servers and their status
[force-leave]: /docs/commands/server/force-leave.html "Force a server into the 'left' state"
[join]: /docs/commands/server/join.html "Join server nodes together"

View File

@ -3,7 +3,8 @@ layout: "docs"
page_title: "Commands: server force-leave"
sidebar_current: "docs-commands-server-force-leave"
description: >
The server force-leave command is used to force a server into the "left" state.
The server force-leave command is used to force a server into the "left"
state.
---
# Command: server force-leave
@ -15,7 +16,7 @@ eventually rejoin the cluster again.
## Usage
```
```plaintext
nomad server force-leave [options] <node>
```
@ -30,6 +31,6 @@ to enter the "left" state.
Force-leave the server "node1":
```
```shell
$ nomad server force-leave node1
```

View File

@ -3,7 +3,8 @@ layout: "docs"
page_title: "Commands: server join"
sidebar_current: "docs-commands-server-join"
description: >
The server join command is used to join the local server to one or more Nomad servers.
The server join command is used to join the local server to one or more Nomad
servers.
---
# Command: server join
@ -15,7 +16,7 @@ handle discovery of the other server nodes in the cluster.
## Usage
```
```plaintext
nomad server join [options] <addr> [<addr>...]
```
@ -32,7 +33,7 @@ be 1.
Join the local server to a remote server:
```
```shell
$ nomad server join 10.0.0.8:4648
Joined 1 servers successfully
```

View File

@ -14,7 +14,7 @@ which is only run on server nodes.
## Usage
```
```plaintext
nomad server members [options]
```
@ -24,7 +24,7 @@ nomad server members [options]
## Server Members Options
* `-detailed`: Dump the basic member information as well as the raw set of tags
- `-detailed`: Dump the basic member information as well as the raw set of tags
for each member. This mode reveals additional information not displayed in the
standard output format.
@ -32,7 +32,7 @@ nomad server members [options]
Default view:
```
```shell
$ nomad server members
Name Addr Port Status Proto Build DC Region
node1.global 10.0.0.8 4648 alive 2 0.1.0dev dc1 global
@ -41,7 +41,7 @@ node2.global 10.0.0.9 4648 alive 2 0.1.0dev dc1 global
Detailed view:
```
```shell
$ nomad server members -detailed
Name Addr Port Tags
node1 10.0.0.8 4648 bootstrap=1,build=0.1.0dev,vsn=1,vsn_max=1,dc=dc1,port=4647,region=global,role=nomad,vsn_min=1

View File

@ -12,7 +12,7 @@ The `status` command displays the status output for any Nomad resource.
## Usage
```
```plaintext
nomad status [options] <identifier>
```
@ -31,7 +31,7 @@ for backwards compatibility and should not be relied on.
Display the status of a job:
```
```shell
$ nomad status example
ID = example
Name = example
@ -63,7 +63,7 @@ e1d14a39 f9dabe93 cache 0 run running 08/28/17 23:01:39 UTC
Display the status of an allocation:
```
```shell
$ nomad status e1d14a39
ID = e1d14a39
Eval ID = cc882755
@ -99,7 +99,7 @@ Time Type Description
Display the status of a deployment:
```
```shell
$ nomad status f5506391
ID = f5506391
Job ID = example
@ -114,7 +114,7 @@ cache 1 1 1 0
Display the status of a node:
```
```shell
$ nomad status f9dabe93
ID = f9dabe93
Name = nomad-server01

View File

@ -12,7 +12,7 @@ The `ui` command is used to open the Nomad Web UI.
## Usage
```
```plaintext
nomad ui [options] <identifier>
```
@ -22,7 +22,6 @@ will be opened in the default browser.
An identifier may be provided, in which case the UI will be opened to view the
details for that object. Supported identifiers are jobs, allocations and nodes.
## General Options
<%= partial "docs/commands/_general_options" %>
@ -31,21 +30,21 @@ details for that object. Supported identifiers are jobs, allocations and nodes.
Open the UI homepage:
```
```shell
$ nomad ui
Opening URL "http://127.0.0.1:4646"
```
Open the UI directly to look at a job:
```
```shell
$ nomad ui redis-job
http://127.0.0.1:4646/ui/jobs/redis-job
```
Open the UI directly to look at an allocation:
```
```shell
$ nomad ui d4005969
Opening URL "http://127.0.0.1:4646/ui/allocations/d4005969-b16f-10eb-4fe1-a5374986083d"
```

View File

@ -13,7 +13,7 @@ including the release version and the exact revision.
## Usage
```
```plaintext
nomad version
```
@ -25,7 +25,7 @@ end, indicating that local, uncommitted changes were detected at build time.
## Examples
```
```shell
$ nomad version
Nomad v0.0.0-615-gcf3c6aa-dev (cf3c6aa8a75a689987b689d75ae2ba73458465cb+CHANGES)
```