2014-02-07 16:41:03 -08:00
---
layout: "docs"
page_title: "Commands: Leave"
sidebar_current: "docs-commands-leave"
2014-10-19 19:40:10 -04: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-07 16:41:03 -08:00
---
2014-02-18 17:32:13 -08:00
# Consul Leave
2014-02-07 16:41:03 -08:00
2014-02-18 17:32:13 -08:00
Command: `consul leave`
2014-02-07 16:41:03 -08:00
2014-10-19 19:40:10 -04: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-07 16:41:03 -08:00
"failed". Nodes that leave will not attempt to re-join the cluster
on restarting with a snapshot.
2014-02-18 17:32:13 -08:00
For nodes in server mode, the node is removed from the Raft peer set
2014-04-16 00:01:12 -04:00
in a graceful manner. This is critical, as in certain situations a
non-graceful leave can affect cluster availability.
2014-02-18 17:32:13 -08:00
2014-02-07 16:41:03 -08:00
## Usage
2017-02-09 16:41:17 -05:00
Usage: `consul leave [options]`
2014-02-07 16:41:03 -08:00
2017-02-09 16:41:17 -05:00
#### API Options
2014-02-07 16:41:03 -08:00
2017-02-09 16:41:17 -05:00
<%= partial "docs/commands/http_api_options_client" %>