Raft Operator HTTP API
The /operator/raft
endpoints provide tools for management of the Raft subsystem.
Please see the Consensus Protocol Guide for more information about Raft consensus protocol and its use.
Read Raft Configuration
This endpoint queries the status of a client node registered with Nomad.
Method | Path | Produces |
---|---|---|
GET | /v1/operator/raft/configuration | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | management |
Parameters
stale
- Specifies if the cluster should respond without an active leader. This is specified as a query string parameter.
Sample Request
Sample Response
Field Reference
Index
(int)
- TheIndex
value is the Raft corresponding to this configuration. The latest configuration may not yet be committed if changes are in flight.Servers
(array: Server)
- The returnedServers
array has information about the servers in the Raft peer configuration.ID
(string)
- The ID of the server. For Raft protocol v2, this is the same as theAddress
. Raft protocol v3 uses GUIDs as the ID.Node
(string)
- The node name of the server, as known to Nomad, or"(unknown)"
if the node is stale and not known.Address
(string)
- Theip:port
for the server.Leader
(bool)
- is either "true" or "false" depending on the server's role in the Raft configuration.Voter
(bool)
- is "true" or "false", indicating if the server has a vote in the Raft configuration. Future versions of Nomad may add support for non-voting servers.
Remove Raft Peer
This endpoint removes a Nomad server with given address from the Raft configuration. The return code signifies success or failure.
Method | Path | Produces |
---|---|---|
DELETE | /v1/operator/raft/peer | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | management |
Parameters
address
(string: <optional>)
- Specifies the Raft Address of the server to remove as provided in the output of/v1/operator/raft/configuration
API endpoint or thenomad operator raft list-peers
command.id
(string: <optional>)
- Specifies the Raft ID of the server to remove as provided in the output of/v1/operator/raft/configuration
API endpoint or thenomad operator raft list-peers
command.Note
Either
address
orid
must be provided, but not both.
Sample Request
Transfer Leadership to another Raft Peer
This endpoint tells the current cluster leader to transfer leadership to the Nomad server with given address or ID in the Raft configuration. The return code signifies success or failure.
Method | Path | Produces |
---|---|---|
PUT POST | /v1/operator/raft/transfer-leadership | application/json |
The table below shows this endpoint's support for blocking queries and required ACLs.
Blocking Queries | ACL Required |
---|---|
NO | management |
Parameters
address
(string: <optional>)
- Specifies the Raft Address of the target server as provided in the output of/v1/operator/raft/configuration
API endpoint or thenomad operator raft list-peers
command.id
(string: <optional>)
- Specifies the Raft ID of the target server as provided in the output of/v1/operator/raft/configuration
API endpoint or thenomad operator raft list-peers
command.
Note
The cluster must be running Raft protocol v3 or greater on all server members.
Either
address
orid
must be provided, but not both.
Sample Requests