github.com/outbrain/consul@v1.4.5/website/source/docs/commands/operator/raft.html.markdown.erb (about) 1 --- 2 layout: "docs" 3 page_title: "Commands: Operator Raft" 4 sidebar_current: "docs-commands-operator-raft" 5 description: > 6 The operator raft subcommand is used to view and modify Consul's Raft configuration. 7 --- 8 9 # Consul Operator Raft 10 11 Command: `consul operator raft` 12 13 The Raft operator command is used to interact with Consul's Raft subsystem. The 14 command can be used to verify Raft peers or in rare cases to recover quorum by 15 removing invalid peers. 16 17 ```text 18 Usage: consul operator raft <subcommand> [options] 19 20 The Raft operator command is used to interact with Consul's Raft subsystem. The 21 command can be used to verify Raft peers or in rare cases to recover quorum by 22 removing invalid peers. 23 24 Subcommands: 25 26 list-peers Display the current Raft peer configuration 27 remove-peer Remove a Consul server from the Raft configuration 28 ``` 29 30 ## list-peers 31 32 This command displays the current Raft peer configuration. 33 34 Usage: `consul operator raft list-peers -stale=[true|false]` 35 36 * `-stale` - Optional and defaults to "false" which means the leader provides 37 the result. If the cluster is in an outage state without a leader, you may need 38 to set this to "true" to get the configuration from a non-leader server. 39 40 The output looks like this: 41 42 ``` 43 Node ID Address State Voter RaftProtocol 44 alice 127.0.0.1:8300 127.0.0.1:8300 follower true 2 45 bob 127.0.0.2:8300 127.0.0.2:8300 leader true 3 46 carol 127.0.0.3:8300 127.0.0.3:8300 follower true 2 47 ``` 48 49 `Node` is the node name of the server, as known to Consul, or "(unknown)" if 50 the node is stale and not known. 51 52 `ID` is the ID of the server. This is the same as the `Address` in Consul 0.7 53 but may be upgraded to a GUID in a future version of Consul. 54 55 `Address` is the IP:port for the server. 56 57 `State` is either "follower" or "leader" depending on the server's role in the 58 Raft configuration. 59 60 `Voter` is "true" or "false", indicating if the server has a vote in the Raft 61 configuration. Future versions of Consul may add support for non-voting servers. 62 63 ## remove-peer 64 65 This command removes the Consul server with given address from the Raft configuration. 66 67 There are rare cases where a peer may be left behind in the Raft configuration 68 even though the server is no longer present and known to the cluster. This command 69 can be used to remove the failed server so that it is no longer affects the 70 Raft quorum. If the server still shows in the output of the 71 [`consul members`](/docs/commands/members.html) command, it is preferable to 72 clean up by simply running 73 [`consul force-leave`](/docs/commands/force-leave.html) 74 instead of this command. 75 76 Usage: `consul operator raft remove-peer -address="IP:port"` 77 78 * `-address` - "IP:port" for the server to remove. The port number is usually 79 8300, unless configured otherwise. 80 81 * `-id` - ID of the server to remove. 82 83 The return code will indicate success or failure.