github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/command/operator_raft.go (about) 1 package command 2 3 import ( 4 "strings" 5 6 "github.com/mitchellh/cli" 7 ) 8 9 type OperatorRaftCommand struct { 10 Meta 11 } 12 13 func (c *OperatorRaftCommand) Help() string { 14 helpText := ` 15 Usage: nomad operator raft <subcommand> [options] 16 17 This command groups subcommands for interacting with Nomad's Raft subsystem. 18 The command can be used to verify Raft peers or in rare cases to recover 19 quorum by removing invalid peers. 20 21 List Raft peers: 22 23 $ nomad operator raft list-peers 24 25 Remove a Raft peer: 26 27 $ nomad operator raft remove-peer -peer-address "IP:Port" 28 29 Display info about the raft logs in the data directory: 30 31 $ nomad operator raft info /var/nomad/data 32 33 Display the log entries persisted in data dir in JSON format. 34 35 $ nomad operator raft logs /var/nomad/data 36 37 Display the server state obtained by replaying raft log entries 38 persisted in data dir in JSON format. 39 40 $ nomad operator raft state /var/nomad/data 41 42 Please see the individual subcommand help for detailed usage information. 43 44 45 ` 46 return strings.TrimSpace(helpText) 47 } 48 49 func (c *OperatorRaftCommand) Synopsis() string { 50 return "Provides access to the Raft subsystem" 51 } 52 53 func (c *OperatorRaftCommand) Name() string { return "operator raft" } 54 55 func (c *OperatorRaftCommand) Run(args []string) int { 56 return cli.RunResultHelp 57 }