From 1aed2c278fbb76efbe93eb28631a9a54c9d796b6 Mon Sep 17 00:00:00 2001 From: YuryHrytsuk Date: Tue, 23 Sep 2025 11:25:28 +0200 Subject: [PATCH] Explicitly set rabbit cluster name 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: * https://github.com/rabbitmq/rabbitmq-server/discussions/11355 * https://groups.google.com/g/rabbitmq-users/c/A8v8XSmnCnA/m/4ZpoTtEWAQAJ Related PR/s * necessary addition for https://github.com/ITISFoundation/osparc-ops-environments/pull/1218 --- services/rabbit/configs/rabbitmq.conf.j2 | 6 ++++++ services/rabbit/template.env | 2 ++ 2 files changed, 8 insertions(+) diff --git a/services/rabbit/configs/rabbitmq.conf.j2 b/services/rabbit/configs/rabbitmq.conf.j2 index 28be26d5..8c8dda34 100644 --- a/services/rabbit/configs/rabbitmq.conf.j2 +++ b/services/rabbit/configs/rabbitmq.conf.j2 @@ -7,6 +7,12 @@ cluster_formation.peer_discovery_backend = classic_config cluster_formation.classic_config.nodes.{{ ix }} = rabbit@rabbit-node0{{ ix }}_rabbit0{{ ix }} {%- endfor %} +# explicitly set cluster name so that all nodes share the same name +# see https://github.com/rabbitmq/rabbitmq-server/discussions/11355 +# and https://groups.google.com/g/rabbitmq-users/c/A8v8XSmnCnA/m/4ZpoTtEWAQAJ +# important for grafana dashboard to work properly +cluster_name={{ RABBIT_CLUSTER_NAME }} + ## Sets the initial quorum queue replica count for newly declared quorum queues. ## This value can be overridden using the 'x-quorum-initial-group-size' queue argument ## at declaration time. diff --git a/services/rabbit/template.env b/services/rabbit/template.env index b1a0a01b..137175ee 100644 --- a/services/rabbit/template.env +++ b/services/rabbit/template.env @@ -14,3 +14,5 @@ RABBIT_NETWORK=${RABBIT_NETWORK} PUBLIC_NETWORK=${PUBLIC_NETWORK} MONITORED_NETWORK=${MONITORED_NETWORK} MONITORING_DOMAIN=${MONITORING_DOMAIN} + +RABBIT_CLUSTER_NAME=${MACHINE_FQDN}