Skip to content

Commit

Permalink
Merge pull request #4281 from hashicorp/f-leave-on-terminate-docs
Browse files Browse the repository at this point in the history
Doc updates to clarify leave_on_terminate
  • Loading branch information
Preetha authored May 21, 2018
2 parents e485603 + bce246f commit 173a2b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
12 changes: 8 additions & 4 deletions website/source/docs/agent/configuration/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ testing.
the bind address of the specific network service if it is not provided. Any
values configured in this stanza take precedence over the default
[bind_addr](#bind_addr).
If the bind address is `0.0.0.0` then the address

If the bind address is `0.0.0.0` then the address
private IP found is advertised. You may advertise an alternate port as well.
The values support [go-sockaddr/template format][go-sockaddr/template].

Expand Down Expand Up @@ -155,11 +155,15 @@ testing.

- `leave_on_interrupt` `(bool: false)` - Specifies if the agent should
gracefully leave when receiving the interrupt signal. By default, the agent
will exit forcefully on any signal.
will exit forcefully on any signal. This value should only be set to true on
server agents if it is expected that a terminated server instance will never
join the cluster again.

- `leave_on_terminate` `(bool: false)` - Specifies if the agent should
gracefully leave when receiving the terminate signal. By default, the agent
will exit forcefully on any signal.
will exit forcefully on any signal. This value should only be set to true on
server agents if it is expected that a terminated server instance will never
join the cluster again.

- `log_level` `(string: "INFO")` - Specifies the verbosity of logs the Nomad
agent will output. Valid log levels include `WARN`, `INFO`, or `DEBUG` in
Expand Down
13 changes: 8 additions & 5 deletions website/source/intro/getting-started/running.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Additional metadata can be viewed by providing the `-detailed` flag.

You can use `Ctrl-C` (the interrupt signal) to halt the agent.
By default, all signals will cause the agent to forcefully shutdown.
The agent [can be configured](/docs/agent/configuration/index.html) to
The agent [can be configured](/docs/agent/configuration/index.html#leave_on_terminate) to
gracefully leave on either the interrupt or terminate signals.

After interrupting the agent, you should see it leave the cluster
Expand All @@ -134,10 +134,13 @@ replication continues to be attempted until the node recovers. Nomad will
automatically try to reconnect to _failed_ nodes, allowing it to recover from
certain network conditions, while _left_ nodes are no longer contacted.

If an agent is operating as a server, a graceful leave is important to avoid
causing a potential availability outage affecting the
[consensus protocol](/docs/internals/consensus.html). If a server does
forcefully exit and will not be returning into service, the
If an agent is operating as a server, [leave_on_terminate](/docs/agent/configuration/index.html#leave_on_terminate) should only
be set if the server will never rejoin the cluster again. The default value of `false` for 'leave_on_terminate` and `leave_on_interrupt`
work well for most scenarios. If Nomad servers are part of an auto scaling group where new servers are brought up to replace
failed servers, using graceful leave avoids causing a potential availability outage affecting the [consensus protocol](/docs/internals/consensus.html).
As of of Nomad 0.8, Nomad includes Autopilot which automatically removes failed or dead servers. This allows the operator to skip setting leave_on_terminate

If a server does forcefully exit and will not be returning into service, the
[`server force-leave` command](/docs/commands/server/force-leave.html) should
be used to force the server from a _failed_ to a _left_ state.

Expand Down

0 comments on commit 173a2b9

Please sign in to comment.