-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Issue with /v1/status/leader API #1560
Comments
Hi @sebi-hgdata - I'll have to take a deeper look on the Raft side, but I think you might be seeing some startup behavior that's allowed by Raft but noisy for your gating check. You might want to try polling the https://www.consul.io/docs/agent/http/status.html#status_peers endpoint and looking for that to have 3 entries (you could pipe through |
@slackpad Thanks for the quick response. |
@sebi-hgdata I think there are times where multiple nodes think they are the leader, but only one will be able to perform writes, so looking at the leader endpoint for this application isn't a super reliable method to wait for Consul to get into a good state. Please take a look at the conversation on #1562 which has a way to check using the peers list. |
I have a Consul 0.5.2 setup with 3 servers and 1 agent that is used mainly for supporting docker overlay networks. I have the following upstart script for consul:
and the docker service starts only after consul.
I'm doing some disaster recovery tests in which I reboot all 4 machine at the same time and check that the docker containers are properly restarted... and observed that the post-script section script does not work as expected.. that is it reports wrongly that a leader is elected, before one really is elected, triggering the docker service startup and in consequence the errors that follow of not having a cluster leader and containers not restarting properly.
Here are the logs :
See the log "[UPSTART] wait till cluster has a leader" and the output of "10.3.0.227:8300" before docker queries the KV store.
The text was updated successfully, but these errors were encountered: