From a53c0651fbd8991e258ce7d0e3a80865dabfea88 Mon Sep 17 00:00:00 2001 From: Shinya Hayashi Date: Tue, 30 Jan 2024 10:32:50 +0000 Subject: [PATCH 1/2] debian: add ceph-exporter package It is hard for Debian/Ubuntu users to use ceph-exporter because it is not included in any deb packages. This commit adds a new deb package for ceph-exporter. Fixes: https://tracker.ceph.com/issues/64095 Signed-off-by: Shinya Hayashi --- debian/ceph-exporter.install | 1 + debian/control | 24 ++++++++++++++++++++++++ debian/rules | 1 + 3 files changed, 26 insertions(+) create mode 100644 debian/ceph-exporter.install diff --git a/debian/ceph-exporter.install b/debian/ceph-exporter.install new file mode 100644 index 00000000000..618cf9eadcc --- /dev/null +++ b/debian/ceph-exporter.install @@ -0,0 +1 @@ +usr/bin/ceph-exporter diff --git a/debian/control b/debian/control index f1bdec95a2e..bb8d681929c 100644 --- a/debian/control +++ b/debian/control @@ -351,6 +351,30 @@ Description: debugging symbols for ceph-mgr . This package contains the debugging symbols for ceph-mgr. +Package: ceph-exporter +Architecture: linux-any +Depends: ceph-base (= ${binary:Version}), +Description: metrics exporter for the ceph distributed storage system + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + This package contains the metrics exporter daemon, which is used to expose + the performance metrics. + +Package: ceph-exporter-dbg +Architecture: linux-any +Section: debug +Priority: extra +Depends: ceph-exporter (= ${binary:Version}), + ${misc:Depends}, +Description: debugging symbols for ceph-exporter + Ceph is a massively scalable, open-source, distributed + storage system that runs on commodity hardware and delivers object, + block and file system storage. + . + This package contains the debugging symbols for ceph-exporter. + Package: ceph-mon Architecture: linux-any Depends: ceph-base (= ${binary:Version}), diff --git a/debian/rules b/debian/rules index ed7f4a255ed..68c69e04474 100755 --- a/debian/rules +++ b/debian/rules @@ -105,6 +105,7 @@ override_dh_strip: dh_strip -pceph-mds --dbg-package=ceph-mds-dbg dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg + dh_strip -pceph-exporter --dbg-package=ceph-exporter-dbg dh_strip -pceph-mon --dbg-package=ceph-mon-dbg dh_strip -pceph-osd --dbg-package=ceph-osd-dbg dh_strip -pceph-base --dbg-package=ceph-base-dbg From 32cbe079c60031f67ee91e2f74f39244a027eba6 Mon Sep 17 00:00:00 2001 From: Shinya Hayashi Date: Mon, 5 Feb 2024 04:16:26 +0000 Subject: [PATCH 2/2] systemd: add systemd unit file for ceph-exporter Signed-off-by: Shinya Hayashi --- ceph.spec.in | 1 + debian/ceph-exporter.install | 1 + systemd/CMakeLists.txt | 1 + systemd/ceph-exporter.service.in | 29 +++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 systemd/ceph-exporter.service.in diff --git a/ceph.spec.in b/ceph.spec.in index 58ccf067997..ff2bb741c6d 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -2052,6 +2052,7 @@ fi %files -n ceph-exporter %{_bindir}/ceph-exporter +%{_unitdir}/ceph-exporter.service %files -n rbd-fuse %{_bindir}/rbd-fuse diff --git a/debian/ceph-exporter.install b/debian/ceph-exporter.install index 618cf9eadcc..1ac0edcd2a1 100644 --- a/debian/ceph-exporter.install +++ b/debian/ceph-exporter.install @@ -1 +1,2 @@ +lib/systemd/system/ceph-exporter* usr/bin/ceph-exporter diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt index ad75ce61cd8..366bab4195d 100644 --- a/systemd/CMakeLists.txt +++ b/systemd/CMakeLists.txt @@ -14,6 +14,7 @@ set(CEPH_SYSTEMD_ENV_DIR "/etc/sysconfig" set(SYSTEMD_ENV_FILE "${CEPH_SYSTEMD_ENV_DIR}/ceph") foreach(service ceph-crash + ceph-exporter ceph-fuse@ ceph-mds@ ceph-mgr@ diff --git a/systemd/ceph-exporter.service.in b/systemd/ceph-exporter.service.in new file mode 100644 index 00000000000..f4f6d05c4b4 --- /dev/null +++ b/systemd/ceph-exporter.service.in @@ -0,0 +1,29 @@ +[Unit] +Description=Ceph cluster exporter daemon +PartOf=ceph.target +After=network-online.target local-fs.target +Before=ceph.target +Wants=network-online.target local-fs.target ceph.target ceph-mon.target + +[Service] +ExecReload=/bin/kill -HUP $MAINPID +ExecStart=/usr/bin/ceph-exporter -f --id %i --setuser ceph --setgroup ceph +LockPersonality=true +NoNewPrivileges=true +PrivateDevices=yes +PrivateTmp=true +ProtectControlGroups=true +ProtectHome=true +ProtectHostname=true +ProtectKernelLogs=true +ProtectKernelModules=true +ProtectKernelTunables=true +ProtectSystem=full +Restart=on-failure +RestartSec=10 +RestrictSUIDSGID=true +StartLimitBurst=3 +StartLimitInterval=30min + +[Install] +WantedBy=multi-user.target ceph.target