Including all alertmanager peers results in mesh not being created
What did you do?
When invoking the alertmanager binary if all available peers (including the invoked binary) are including in the peer list will result in the mesh not being created and high availability can not be achieved.
What did you expect to see?
That alertmanager would identify the local binary invocation and exclude it automatically from the list of peers and allowing the mesh to be created.
What did you see instead? Under which circumstances?
The mesh was never created and each peer only had knowledge about itself and no other peers.=
Environment
Staging
- System information:
/alertmanager # uname -srm
Linux 4.7.0-0.bpo.1-amd64 x86_64
- Alertmanager version:
/alertmanager # /bin/alertmanager --version
alertmanager, version 0.11.0 (branch: HEAD, revision: 30dd0426c08b6479d9a26259ea5efd63bc1ee273)
build user: root@3e103e3fc918
build date: 20171116-17:43:56
go version: go1.9.2
- Alertmanager configuration file:
global:
resolve_timeout: 5m
smtp_require_tls: true
pagerduty_url: https://events.pagerduty.com/v2/enqueue
hipchat_api_url: https://api.hipchat.com/
opsgenie_api_url: https://api.opsgenie.com/
victorops_api_url: https://alert.victorops.com/integrations/generic/20131114/alert/
route:
receiver: nobody
group_by:
- cluster
- service
routes:
- receiver: xx_low_urgency
match:
cluster: xx
severity: low
- receiver: xx_high_urgency
match:
cluster: xx
severity: high
group_wait: 10s
group_interval: 2m
repeat_interval: 1m
inhibit_rules:
- source_match:
severity: high
target_match:
severity: low
equal:
- alertname
- service
- cluster
- source_match:
service: hostup
severity: high
target_match:
service: nginx
severity: high
equal:
- cluster
- environment
- source_match:
service: hostup
severity: high
target_match:
service: serfHealth
severity: low
equal:
- cluster
- environment
- source_match:
severity: high
target_match:
severity: high
equal:
- cluster
- environment
- service_name
receivers:
- name: xx_low_urgency
pagerduty_configs:
- send_resolved: true
service_key: <secret>
url: https://events.pagerduty.com/v2/enqueue
client: '{{ template "pagerduty.default.client" . }}'
client_url: '{{ template "pagerduty.default.clientURL" . }}'
description: '{{ template "pagerduty.xx.description" . }}'
details:
explaination: '{{ template "pagerduty.xx.details" . }}'
firing: ""
num_firing: ""
num_resolved: ""
resolved: ""
- name: xx_high_urgency
pagerduty_configs:
- send_resolved: true
service_key: <secret>
url: https://events.pagerduty.com/v2/enqueue
client: '{{ template "pagerduty.default.client" . }}'
client_url: '{{ template "pagerduty.default.clientURL" . }}'
description: '{{ template "pagerduty.xx.description" . }}'
details:
explaination: '{{ template "pagerduty.xx.details" . }}'
firing: ""
num_firing: ""
num_resolved: ""
resolved: ""
- name: nobody
templates:
- /etc/alertmanager/*.tmpl
You would need to include also the list of flags passed to AlertManager. FWIW I've never seen this behavior, you have probably some misconfiguration on your side...
@simonpasquier correct it was a misconfiguration on my side. @brian-brazil recommended capturing this case within an issue to help drive improvements with the UX.
@nerd0 Would you mind sharing the used command line flags with us.
Do I understand you correctly, that you have started up three alertmanagers, each one aware of the other instances (including itself) via the --cluster.peer flag?
I have started a three instance alertmanager cluster with the below Procfile (goreman start) and all of them joined the cluster correctly.
diff --git a/Procfile b/Procfile
index ab15cfc..d174191 100644
--- a/Procfile
+++ b/Procfile
@@ -1,5 +1,5 @@
-a1: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a1 --web.listen-address=:9093 --cluster.listen-address=127.0.0.1:8001 --config.file=examples/ha/alertmanager.yml
-a2: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a2 --web.listen-address=:9094 --cluster.listen-address=127.0.0.1:8002 --cluster.peer=127.0.0.1:8001 --config.file=examples/ha/alertmanager.yml
-a3: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a3 --web.listen-address=:9095 --cluster.listen-address=127.0.0.1:8003 --cluster.peer=127.0.0.1:8001 --config.file=examples/ha/alertmanager.yml
+a1: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a1 --web.listen-address=:9093 --cluster.listen-address=127.0.0.1:8001 --cluster.peer=127.0.0.1:8001 --cluster.peer=127.0.0.1:8002 --cluster.peer=127.0.0.1:8003 --config.file=examples/ha/alertmanager.yml
+a2: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a2 --web.listen-address=:9094 --cluster.listen-address=127.0.0.1:8002 --cluster.peer=127.0.0.1:8001 --cluster.peer=127.0.0.1:8002 --cluster.peer=127.0.0.1:8003 --config.file=examples/ha/alertmanager.yml
+a3: ./alertmanager --log.level=debug --storage.path=$TMPDIR/a3 --web.listen-address=:9095 --cluster.listen-address=127.0.0.1:8003 --cluster.peer=127.0.0.1:8001 --cluster.peer=127.0.0.1:8002 --cluster.peer=127.0.0.1:8003 --config.file=examples/ha/alertmanager.yml
wh: go run ./examples/webhook/echo.go
@simonpasquier correct it was a misconfiguration on my side. @brian-brazil recommended capturing this case within an issue to help drive improvements with the UX.
@nerd0 opening an issue would be much appreciated, thanks!