Skip to content

Instantly share code, notes, and snippets.

@wido
wido / ceph-osd-compact.sh
Created March 11, 2020 20:04
Compact all Ceph OSDs on a host
#!/bin/bash
#
# Compact all OSDs on a host while they are stopped/offline
#
# Author: Wido den Hollander <wido@denhollander.io>
#
df|grep "/var/lib/ceph/osd"|awk '{print $6}'|cut -d '-' -f 2|sort -n|xargs -n 1 -P 10 -I OSD ceph-kvstore-tool bluestore-kv /var/lib/ceph/osd/ceph-OSD compact
require 'sinatra'
# see http://www.sinatrarb.com/intro#Conditions
set(:action) { |value| condition { params[:Action] == value.to_s } }
get '/', :action => :xyz do
# ...
end