consul-alerts icon indicating copy to clipboard operation
consul-alerts copied to clipboard

Running for leader election.. Forever

Open eliranbz opened this issue 10 years ago • 9 comments

Hi,

When trying to run it, I get these "Running for leader election" forever and nothing happens, I use Consul 0.5.2 so maybe it's related

root@somehost:~$ ./consul-alerts start --alert-addr=127.0.0.1:9000 --consul-addr=127.0.0.1:8500 --consul-dc=dc1 --consul-acl-token=""
INFO[0000] Checking consul agent connection...
INFO[0001] otherserver::Serf Health Status is now pending status change from passing to critical.
INFO[0018] Consul ACL Token: 
INFO[0018] Consul Alerts daemon started
INFO[0018] Consul Alerts Host: somehost.domain
INFO[0018] Consul Agent: 127.0.0.1:8500
INFO[0018] Consul Datacenter: dc1
INFO[0018] Running for leader election...
INFO[0018] Running for leader election...
INFO[0018] Running for leader election...
INFO[0018] Running for leader election...
INFO[0018] Running for leader election...

eliranbz avatar Nov 17 '15 19:11 eliranbz

Same issue here. Consul is running on v0.5.2

JohanTan avatar Nov 20 '15 22:11 JohanTan

Same issue here with consul-alerts 0.3.2. But 0.3.0 && 0.3.1 are ok.

simhappy avatar Nov 23 '15 10:11 simhappy

It works fine for me in v0.5.2. when I use the same dc where the current host is the master:

consul@admin:/srv/consul_alert/bin$ ./consul-alerts start --alert-addr=localhost:9000 --consul-addr=localhost:8500 --consul-dc=central INFO[0000] Checking consul agent connection...
..... INFO[0000] Consul ACL Token: "" INFO[0000] Consul Alerts daemon started INFO[0000] Consul Alerts Host: INFO[0000] Consul Agent: localhost:8500 INFO[0000] Consul Datacenter: central INFO[0000] Running for leader election... INFO[0000] Now acting as leader.

When I use a different Datacenter I get the same error as the others: consul@admin:/srv/consul_alert/bin$ ./consul-alerts start --alert-addr=localhost:9000 --consul-addr=localhost:8500 --consul-dc=acc1 INFO[0000] Checking consul agent connection... ... INFO[0000] Consul ACL Token: "" INFO[0000] Consul Alerts daemon started INFO[0000] Consul Alerts Host: INFO[0000] Consul Agent: localhost:8500 INFO[0000] Consul Datacenter: acc1 INFO[0000] Running for leader election... ...

StephanZaat avatar Nov 25 '15 09:11 StephanZaat

This should be fixed with PR #87. Will put out a new build soon.

darkcrux avatar Jan 04 '16 08:01 darkcrux

Thanks @darkcrux!

trenton42 avatar Jan 04 '16 13:01 trenton42

Hello,

I'm seeing this issue too, both with the latest version of the acaleph/consul-alerts docker image, as well as if I build my own image with the latest source:

INFO[0001] Started Consul-Alerts API
INFO[0001] Running for leader election...
INFO[0001] Now watching for events.
INFO[0001] Now watching for health changes.
INFO[0011] Running for leader election...
INFO[0013] There is current no consul-alerts leader... waiting for one. INFO[0018] There is current no consul-alerts leader... waiting for one. INFO[0021] Running for leader election...
INFO[0023] There is current no consul-alerts leader... waiting for one. INFO[0028] There is current no consul-alerts leader... waiting for one. INFO[0031] Running for leader election...
INFO[0033] There is current no consul-alerts leader... waiting for one. INFO[0038] There is current no consul-alerts leader... waiting for one. INFO[0041] Running for leader election...
INFO[0043] There is current no consul-alerts leader... waiting for one. INFO[0048] There is current no consul-alerts leader... waiting for one. INFO[0051] Running for leader election...
INFO[0053] There is current no consul-alerts leader... waiting for one. INFO[0058] There is current no consul-alerts leader... waiting for one. INFO[0061] Running for leader election...
INFO[0063] There is current no consul-alerts leader... waiting for one. INFO[0068] There is current no consul-alerts leader... waiting for one. INFO[0071] Running for leader election...
INFO[0081] Running for leader election...

brmakana avatar Apr 29 '16 21:04 brmakana

same here, running docker version

if you define dc then it works fine

tsaridas avatar Jul 17 '16 22:07 tsaridas

if you define dc then it works fine

is there a special option for it when launching container? or you use docker exec after it is running? ok I have found it - "--consul-dc", anyway in my case I'm still seeing There is current no consul-alerts leader

I have created consul-alerts/leader as here - https://github.com/AcalephStorage/consul-alerts/blob/master/leader-election.go#L9 but still no success. Myabe some knows if I need to set up special ACL permissions for consul-alerts/leader key? Is is definetly ACL issue, It runs with master token. I will create separate issue to check minimal ACL permissions.

123BLiN avatar Oct 28 '16 19:10 123BLiN

👍 doesnt even work with

key "consul-alerts" { policy = "write" }
service "" { policy = "write" }
event "" { policy = "write" }
node "" { policy = "write" }
session "" { policy = "write" }
agent "" { policy = "write" }
query "" { policy = "write" }
acl "" { policy = "write" }
keyring = "write"
operator = "write"

doertedev avatar Dec 05 '19 10:12 doertedev