-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Raft V2 stage one #2282
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted a few minor things, otherwise LGTM.
s.logger.Printf("[INFO] nomad: Attempting bootstrap with nodes: %v", addrs) | ||
if err := s.raft.SetPeers(addrs).Error(); err != nil { | ||
s.logger.Printf("[ERR] nomad: failed to bootstrap peers: %v", err) | ||
// Attempt a live bootstrap! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a later commit I ended up adding an additional check here. This isn't strictly required, but helps prevent spurious leader elections if another server is added later - hashicorp/consul#2319.
peersTimeout.Reset(peersPollInterval + lib.RandomStagger(peersPollInterval/peersPollJitterFactor)) | ||
return nil | ||
} | ||
} | ||
consulQueryCount++ | ||
|
||
s.logger.Printf("[DEBUG] server.consul: lost contact with Nomad quorum, falling back to Consul for server list") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
nomad/server.go
Outdated
after an outage. It should be formatted as a JSON array containing the address | ||
and port of each Consul server in the cluster, like this: | ||
|
||
["10.1.0.1:8500","10.1.0.2:8500","10.1.0.3:8500"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were wrong in the initial PR for Consul, and don't look right for Nomad. Should update these port numbers.
nomad/server.go
Outdated
|
||
Under normal operation, the peers.json file will not be present. | ||
|
||
When Consul starts for the first time, it will create this peers.info file and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Consul/Nomad/
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR updates Nomad to use Raft V2, Stage One.