Add support in nomad for supporting raft 3 protocol peers.json
This commit is contained in:
parent
d00da5b827
commit
3fef02aa93
|
@ -1169,7 +1169,12 @@ func (s *Server) setupRaft() error {
|
|||
}
|
||||
} else if _, err := os.Stat(peersFile); err == nil {
|
||||
s.logger.Info("found peers.json file, recovering Raft configuration...")
|
||||
configuration, err := raft.ReadPeersJSON(peersFile)
|
||||
var configuration raft.Configuration
|
||||
if s.config.RaftConfig.ProtocolVersion < 3 {
|
||||
configuration, err = raft.ReadPeersJSON(peersFile)
|
||||
} else {
|
||||
configuration, err = raft.ReadConfigJSON(peersFile)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("recovery failed to parse peers.json: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue