Skip to content
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

Re-join to consul leader in a consul cluster #1538

Closed
mcortinas opened this Issue Apr 8, 2016 · 3 comments

Comments

Projects
None yet
5 participants
@mcortinas
Copy link

mcortinas commented Apr 8, 2016

Hello,

I'm a newbie in working with prometheus.

My datacenter has a several consul server in a cluster and after read prometheus documentation the file prometheus.yaml just let me set only 1 consul server (if i'm not in a mistake... )

In my first setup I set a consul server NOT LEADER in prometheus.yaml and I received this trace log when I re-started the configuration

Apr 08 09:33:14 XXXXXXXXXXXX[22361]: time="2016-04-08T09:33:14Z" level=error msg="Error refreshing service list: Unexpected response code: 500 (No cluster leader)" source="consul.go:195"

I think maybe we need add in prometheus the feature to re-join to consul server leader in case the server configured in prometheus.yml was not the current consul cluster LEADER or the posibility configure an array of consul server.

Marc

@guanglinlv

This comment has been minimized.

Copy link

guanglinlv commented Apr 12, 2016

@mcortinas how about set a consul agent in prometheus. and let your consul agent re-join the consul cluster.

@fabxc fabxc added kind/question and removed question labels Apr 28, 2016

@amorken

This comment has been minimized.

Copy link
Contributor

amorken commented May 26, 2016

Hi!

The recommended deployment pattern for Consul is to run a lightweight client agent on each host, and let this client agent take care of the complexities of communicating with the Consul server quorum for you. See https://www.consul.io/intro/getting-started/agent.html for more information. I believe this is what guanliniv suggests above as well.

For Prometheus, this means that it should just talk to the Consul client agent on localhost, and implementing more logic for managing connections to the quorum is not really a good thing - it is better to leave this to the Consul agent.

Now, your particular problem ("no cluster leader") would not actually be solved by running Consul this way, because connecting directly to one of the cluster servers would still work perfectly well as long as it is a member of a Consul cluster with a functioning quorum and an elected leader. The Consul server would just act as an agent for you and forward traffic to the current leader. However, when there is no cluster leader, none of the servers in the cluster can help you. This is a problem with your Consul deployment, and needs to be solved first before you can get Prometheus or any other client to work with Consul.

Thanks,
AndersM

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.