From 490148afb0f3eac2bead432d3a3e176b56b149f5 Mon Sep 17 00:00:00 2001 From: Mouratidis Theofilos Date: Fri, 10 May 2024 12:17:12 +0200 Subject: [PATCH] Fix CephExporter protocol bind logic In a dual stack configuration ceph-exporter binds to ipv4 only and the metrics fail in ipv6 Signed-off-by: Mouratidis Theofilos (cherry picked from commit 110bc665078fe19c31e3680c4197587e69e4e751) --- src/cephadm/cephadmlib/daemons/ceph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cephadm/cephadmlib/daemons/ceph.py b/src/cephadm/cephadmlib/daemons/ceph.py index e6392876cc60d..55a9283512976 100644 --- a/src/cephadm/cephadmlib/daemons/ceph.py +++ b/src/cephadm/cephadmlib/daemons/ceph.py @@ -292,8 +292,8 @@ class CephExporter(ContainerDaemonForm): self.image = image self.sock_dir = config_json.get('sock-dir', '/var/run/ceph/') - ipv4_addrs, _ = get_ip_addresses(get_hostname()) - addrs = '0.0.0.0' if ipv4_addrs else '::' + _, ipv6_addrs = get_ip_addresses(get_hostname()) + addrs = '::' if ipv6_addrs else '0.0.0.0' self.addrs = config_json.get('addrs', addrs) self.port = config_json.get('port', self.DEFAULT_PORT) self.prio_limit = config_json.get('prio-limit', 5) -- 2.39.5