Skip to content

Commit f28e305

Browse files
authored
Explicitly set rabbit cluster name (#1220)
This is important for grafana dashboard that relies on cluster name. If not set explicitly, each node has a different name which results in grafana not able to idnetify that these nodes belong to the same cluster. Read more about this problem: * rabbitmq/rabbitmq-server#11355 * https://groups.google.com/g/rabbitmq-users/c/A8v8XSmnCnA/m/4ZpoTtEWAQAJ Related PR/s * necessary addition for #1218
1 parent 25d2a68 commit f28e305

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

services/rabbit/configs/rabbitmq.conf.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ cluster_formation.peer_discovery_backend = classic_config
77
cluster_formation.classic_config.nodes.{{ ix }} = rabbit@rabbit-node0{{ ix }}_rabbit0{{ ix }}
88
{%- endfor %}
99

10+
# explicitly set cluster name so that all nodes share the same name
11+
# see https://github.com/rabbitmq/rabbitmq-server/discussions/11355
12+
# and https://groups.google.com/g/rabbitmq-users/c/A8v8XSmnCnA/m/4ZpoTtEWAQAJ
13+
# important for grafana dashboard to work properly
14+
cluster_name={{ RABBIT_CLUSTER_NAME }}
15+
1016
## Sets the initial quorum queue replica count for newly declared quorum queues.
1117
## This value can be overridden using the 'x-quorum-initial-group-size' queue argument
1218
## at declaration time.

services/rabbit/template.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ RABBIT_NETWORK=${RABBIT_NETWORK}
1414
PUBLIC_NETWORK=${PUBLIC_NETWORK}
1515
MONITORED_NETWORK=${MONITORED_NETWORK}
1616
MONITORING_DOMAIN=${MONITORING_DOMAIN}
17+
18+
RABBIT_CLUSTER_NAME=${MACHINE_FQDN}

0 commit comments

Comments
 (0)