2017-02-10 01:58:20 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
type OperatorRaftCommand struct {
|
|
|
|
Meta
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *OperatorRaftCommand) Help() string {
|
|
|
|
helpText := `
|
|
|
|
Usage: nomad operator raft <subcommand> [options]
|
|
|
|
|
2018-03-21 21:04:54 +00:00
|
|
|
This command groups subcommands for interacting with Nomad's Raft subsystem.
|
|
|
|
The command can be used to verify Raft peers or in rare cases to recover
|
|
|
|
quorum by removing invalid peers.
|
|
|
|
|
|
|
|
List Raft peers:
|
|
|
|
|
|
|
|
$ nomad operator raft list-peers
|
|
|
|
|
|
|
|
Remove a Raft peer:
|
|
|
|
|
|
|
|
$ nomad operator raft remove-peer -peer-address "IP:Port"
|
|
|
|
|
2021-12-16 15:32:11 +00:00
|
|
|
Display info about the raft logs in the data directory:
|
|
|
|
|
|
|
|
$ nomad operator raft info /var/nomad/data
|
|
|
|
|
|
|
|
Display the log entries persisted in data dir in JSON format.
|
|
|
|
|
|
|
|
$ nomad operator raft logs /var/nomad/data
|
|
|
|
|
|
|
|
Display the server state obtained by replaying raft log entries
|
|
|
|
persisted in data dir in JSON format.
|
|
|
|
|
|
|
|
$ nomad operator raft state /var/nomad/data
|
|
|
|
|
2018-03-21 21:04:54 +00:00
|
|
|
Please see the individual subcommand help for detailed usage information.
|
2021-12-16 15:32:11 +00:00
|
|
|
|
|
|
|
|
2017-02-10 01:58:20 +00:00
|
|
|
`
|
|
|
|
return strings.TrimSpace(helpText)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *OperatorRaftCommand) Synopsis() string {
|
|
|
|
return "Provides access to the Raft subsystem"
|
|
|
|
}
|
|
|
|
|
2018-04-18 16:02:11 +00:00
|
|
|
func (c *OperatorRaftCommand) Name() string { return "operator raft" }
|
|
|
|
|
2017-02-10 01:58:20 +00:00
|
|
|
func (c *OperatorRaftCommand) Run(args []string) int {
|
|
|
|
return cli.RunResultHelp
|
|
|
|
}
|