open-consul/website/pages/commands/leave.mdx

34 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-02-08 00:41:03 +00:00
---
layout: commands
2020-04-07 18:55:19 +00:00
page_title: 'Commands: Leave'
sidebar_title: leave
2020-04-07 18:55:19 +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
---
# Consul Leave
2014-02-08 00:41:03 +00:00
Command: `consul leave`
2014-02-08 00:41:03 +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.
For nodes in server mode, the node is removed from the Raft peer set
in a graceful manner. This is critical, as in certain situations a
non-graceful leave can affect cluster availability.
2020-04-07 18:55:19 +00:00
Running `consul leave` on a server explicitly will reduce the quorum size. Even if the cluster used `bootstrap_expect` to set a quorum size initially, issuing `consul leave` on a server will reconfigure the cluster to have fewer servers.
This means you could end up with just one server that is still able to commit writes because quorum is only 1, but those writes might be lost if that server fails before more are added.
2014-02-08 00:41:03 +00:00
## Usage
Usage: `consul leave [options]`
2014-02-08 00:41:03 +00:00
#### API Options
2014-02-08 00:41:03 +00:00
2020-04-07 18:55:19 +00:00
@include 'http_api_options_client.mdx'