We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f75c393 commit 04c0c85Copy full SHA for 04c0c85
1 file changed
osd_compaction.sh
@@ -0,0 +1,27 @@
1
+#!/usr/bin/bash
2
+
3
+# Matthew hutchinson <mhutchinson@45drives.com>
4
5
+# Trigger compaction on all OSDs belonging to this host.
6
+set -euo pipefail
7
8
+HOST="$(hostname -s)"
9
+OSDS=$(ceph osd ls-tree "$HOST")
10
11
+if [ -z "$OSDS" ]; then
12
+ echo "No OSDs found for host $HOST."
13
+ exit 0
14
+fi
15
16
+echo "Starting compaction on OSDs for host: $HOST"
17
+for osd in $OSDS; do
18
+ echo "Running compaction on osd.${osd}..."
19
+ if ceph tell osd."${osd}" compact; then
20
+ echo "Compaction triggered successfully for osd.${osd}"
21
+ else
22
+ echo "Failed to trigger compaction on osd.${osd}"
23
+ fi
24
+ echo
25
+done
26
27
+echo "All compaction requests have been sent for host: $HOST"
0 commit comments