mirror of https://github.com/hashicorp/consul
Condense raft subcommand into one doc page
parent
e85b401eb9
commit
c8d0273f1b
|
@ -61,6 +61,8 @@ func (c *OperatorRaftCommand) raft(args []string) error {
|
||||||
f.StringVar(&address, "address", "",
|
f.StringVar(&address, "address", "",
|
||||||
"The address to remove from the Raft configuration.")
|
"The address to remove from the Raft configuration.")
|
||||||
|
|
||||||
|
// Leave these flags for backwards compatibility, but hide them
|
||||||
|
// TODO: remove flags/behavior from this command in Consul 0.9
|
||||||
c.Command.HideFlags("list-peers", "remove-peer", "address")
|
c.Command.HideFlags("list-peers", "remove-peer", "address")
|
||||||
|
|
||||||
if err := c.Command.Parse(args); err != nil {
|
if err := c.Command.Parse(args); err != nil {
|
||||||
|
|
|
@ -17,7 +17,7 @@ func (c *OperatorRaftRemoveCommand) Help() string {
|
||||||
helpText := `
|
helpText := `
|
||||||
Usage: consul operator raft remove-peer [options]
|
Usage: consul operator raft remove-peer [options]
|
||||||
|
|
||||||
Remove the Consul server with given -peer-address from the Raft configuration.
|
Remove the Consul server with given -address from the Raft configuration.
|
||||||
|
|
||||||
There are rare cases where a peer may be left behind in the Raft quorum even
|
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
|
though the server is no longer present and known to the cluster. This command
|
||||||
|
|
|
@ -14,12 +14,12 @@ The Raft operator command is used to interact with Consul's Raft subsystem. The
|
||||||
command can be used to verify Raft peers or in rare cases to recover quorum by
|
command can be used to verify Raft peers or in rare cases to recover quorum by
|
||||||
removing invalid peers.
|
removing invalid peers.
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```text
|
```text
|
||||||
Usage: consul operator raft <subcommand> [options]
|
Usage: consul operator raft <subcommand> [options]
|
||||||
|
|
||||||
# ...
|
The Raft operator command is used to interact with Consul's Raft subsystem. The
|
||||||
|
command can be used to verify Raft peers or in rare cases to recover quorum by
|
||||||
|
removing invalid peers.
|
||||||
|
|
||||||
Subcommands:
|
Subcommands:
|
||||||
|
|
||||||
|
@ -27,8 +27,55 @@ Subcommands:
|
||||||
remove-peer Remove a Consul server from the Raft configuration
|
remove-peer Remove a Consul server from the Raft configuration
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information, examples, and usage about a subcommand, click on the name
|
## list-peers
|
||||||
of the subcommand in the sidebar or one of the links below:
|
|
||||||
|
|
||||||
- [list-peers] (/docs/commands/operator/raft/list-peers.html)
|
This command displays the current Raft peer configuration.
|
||||||
- [remove-peer] (/docs/commands/operator/raft/remove-peer.html)
|
|
||||||
|
Usage: `consul operator raft list-peers -stale=[true|false]`
|
||||||
|
|
||||||
|
* `-stale` - Optional and 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 this to "true" to get the configuration from a non-leader server.
|
||||||
|
|
||||||
|
The output looks like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
Node ID Address State Voter
|
||||||
|
alice 127.0.0.1:8300 127.0.0.1:8300 follower true
|
||||||
|
bob 127.0.0.2:8300 127.0.0.2:8300 leader true
|
||||||
|
carol 127.0.0.3:8300 127.0.0.3:8300 follower true
|
||||||
|
```
|
||||||
|
|
||||||
|
`Node` is the node name of the server, as known to Consul, or "(unknown)" if
|
||||||
|
the node is stale and not known.
|
||||||
|
|
||||||
|
`ID` is the ID of the server. This is the same as the `Address` in Consul 0.7
|
||||||
|
but may be upgraded to a GUID in a future version of Consul.
|
||||||
|
|
||||||
|
`Address` is the IP:port for the server.
|
||||||
|
|
||||||
|
`State` is either "follower" or "leader" depending on the server's role in the
|
||||||
|
Raft configuration.
|
||||||
|
|
||||||
|
`Voter` is "true" or "false", indicating if the server has a vote in the Raft
|
||||||
|
configuration. Future versions of Consul may add support for non-voting servers.
|
||||||
|
|
||||||
|
## remove-peer
|
||||||
|
|
||||||
|
This command removes the Consul server with given address from the Raft configuration.
|
||||||
|
|
||||||
|
There are rare cases where a peer may be left behind in the Raft configuration
|
||||||
|
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
|
||||||
|
[`consul members`](/docs/commands/members.html) command, it is preferable to
|
||||||
|
clean up by simply running
|
||||||
|
[`consul force-leave`](/docs/commands/force-leave.html)
|
||||||
|
instead of this command.
|
||||||
|
|
||||||
|
Usage: `consul operator raft remove-peer -address="IP:port"`
|
||||||
|
|
||||||
|
* `-address` - "IP:port" for the server to remove. The port number is usually
|
||||||
|
8300, unless configured otherwise.
|
||||||
|
|
||||||
|
The return code will indicate success or failure.
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
---
|
|
||||||
layout: "docs"
|
|
||||||
page_title: "Commands: Operator Raft List-Peers"
|
|
||||||
sidebar_current: "docs-commands-operator-raft-list-peers"
|
|
||||||
description: >
|
|
||||||
The operator command provides cluster-level tools for Consul operators.
|
|
||||||
---
|
|
||||||
|
|
||||||
# Operator Raft List-Peers
|
|
||||||
|
|
||||||
Command: `consul operator raft list-peers`
|
|
||||||
|
|
||||||
This action displays the current Raft peer configuration.
|
|
||||||
|
|
||||||
Usage: `consul operator raft list-peers -stale=[true|false]`
|
|
||||||
|
|
||||||
* `-stale` - Optional and 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 this to "true" to get the configuration from a non-leader server.
|
|
||||||
|
|
||||||
The output looks like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
Node ID Address State Voter
|
|
||||||
alice 127.0.0.1:8300 127.0.0.1:8300 follower true
|
|
||||||
bob 127.0.0.2:8300 127.0.0.2:8300 leader true
|
|
||||||
carol 127.0.0.3:8300 127.0.0.3:8300 follower true
|
|
||||||
```
|
|
||||||
|
|
||||||
`Node` is the node name of the server, as known to Consul, or "(unknown)" if
|
|
||||||
the node is stale and not known.
|
|
||||||
|
|
||||||
`ID` is the ID of the server. This is the same as the `Address` in Consul 0.7
|
|
||||||
but may be upgraded to a GUID in a future version of Consul.
|
|
||||||
|
|
||||||
`Address` is the IP:port for the server.
|
|
||||||
|
|
||||||
`State` is either "follower" or "leader" depending on the server's role in the
|
|
||||||
Raft configuration.
|
|
||||||
|
|
||||||
`Voter` is "true" or "false", indicating if the server has a vote in the Raft
|
|
||||||
configuration. Future versions of Consul may add support for non-voting servers.
|
|
|
@ -1,29 +0,0 @@
|
||||||
---
|
|
||||||
layout: "docs"
|
|
||||||
page_title: "Commands: Operator Raft Remove-Peer"
|
|
||||||
sidebar_current: "docs-commands-operator-raft-remove-peer"
|
|
||||||
description: >
|
|
||||||
The operator command provides cluster-level tools for Consul operators.
|
|
||||||
---
|
|
||||||
|
|
||||||
# Operator Raft Remove-Peer
|
|
||||||
|
|
||||||
Command: `consul operator raft remove-peer`
|
|
||||||
|
|
||||||
This command removes the Consul server with given address from the Raft configuration.
|
|
||||||
|
|
||||||
There are rare cases where a peer may be left behind in the Raft configuration
|
|
||||||
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
|
|
||||||
[`consul members`](/docs/commands/members.html) command, it is preferable to
|
|
||||||
clean up by simply running
|
|
||||||
[`consul force-leave`](/docs/commands/force-leave.html)
|
|
||||||
instead of this command.
|
|
||||||
|
|
||||||
Usage: `consul operator raft remove-peer -address="IP:port"`
|
|
||||||
|
|
||||||
* `-address` - "IP:port" for the server to remove. The port number is usually
|
|
||||||
8300, unless configured otherwise.
|
|
||||||
|
|
||||||
The return code will indicate success or failure.
|
|
|
@ -143,15 +143,7 @@
|
||||||
<a href="/docs/commands/operator.html">operator</a>
|
<a href="/docs/commands/operator.html">operator</a>
|
||||||
<ul class="subnav">
|
<ul class="subnav">
|
||||||
<li<%= sidebar_current("docs-commands-operator-raft") %>>
|
<li<%= sidebar_current("docs-commands-operator-raft") %>>
|
||||||
<a href="/docs/commands/operator/raft.html">raft</a>
|
<a href="/docs/commands/operator/raft.html">raft</a>
|
||||||
<ul class="subnav">
|
|
||||||
<li<%= sidebar_current("docs-commands-operator-raft-list-peers") %>>
|
|
||||||
<a href="/docs/commands/operator/raft/list-peers.html">list-peers</a>
|
|
||||||
</li>
|
|
||||||
<li<%= sidebar_current("docs-commands-operator-raft-remove-peer") %>>
|
|
||||||
<a href="/docs/commands/operator/raft/remove-peer.html">remove-peer</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue