2014-02-08 00:41:03 +00:00
---
layout: "docs"
page_title: "Commands: Leave"
sidebar_current: "docs-commands-leave"
2014-10-19 23:40:10 +00:00
description: |-
The `leave` command triggers a graceful leave and shutdown of the agent. It is used to ensure other nodes see the agent as left instead of failed. Nodes that leave will not attempt to re-join the cluster on restarting with a snapshot.
2014-02-08 00:41:03 +00:00
---
2014-02-19 01:32:13 +00:00
# Consul Leave
2014-02-08 00:41:03 +00:00
2014-02-19 01:32:13 +00:00
Command: `consul leave`
2014-02-08 00:41:03 +00:00
2014-10-19 23:40:10 +00:00
The `leave` command triggers a graceful leave and shutdown of the agent.
It is used to ensure other nodes see the agent as "left" instead of
2014-02-08 00:41:03 +00:00
"failed". Nodes that leave will not attempt to re-join the cluster
on restarting with a snapshot.
2014-02-19 01:32:13 +00:00
For nodes in server mode, the node is removed from the Raft peer set
2014-04-16 04:01:12 +00:00
in a graceful manner. This is critical, as in certain situations a
non-graceful leave can affect cluster availability.
2014-02-19 01:32:13 +00:00
2014-02-08 00:41:03 +00:00
## Usage
2014-02-19 01:32:13 +00:00
Usage: `consul leave`
2014-02-08 00:41:03 +00:00
The command-line flags are all optional. The list of available flags are:
* `-rpc-addr` - Address to the RPC server of the agent you want to contact
2014-12-15 18:16:43 +00:00
to send this command. If this isn't specified, the command checks the
CONSUL_RPC_ADDR env variable. If this isn't set, the default RPC
address will be set to "127.0.0.1:8400".
2014-02-08 00:41:03 +00:00