From c39f07295e9c2a01a4525a41e3bb10772c8bac94 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 23 Feb 2018 09:10:38 +0100 Subject: [PATCH] Add scripts to stop/remove osds --- ceph-osd-stop-remove | 31 +++++++++++++++++++++++++++++++ monit-ceph-remove => monit-remove | 0 2 files changed, 31 insertions(+) create mode 100755 ceph-osd-stop-remove rename monit-ceph-remove => monit-remove (100%) diff --git a/ceph-osd-stop-remove b/ceph-osd-stop-remove new file mode 100755 index 0000000..a8bb6bf --- /dev/null +++ b/ceph-osd-stop-remove @@ -0,0 +1,31 @@ +#!/bin/sh +# 17:19, 2018-02-09 +# Nico Schottelius + +set -x +set -e + +if [ $# -ne 1 ]; then + echo "$0 osd.id" + echo "i.e. $0 17" + exit 1 +fi + +osd_id=$1; shift +osd_name=osd.${osd_id} +mountpath=/var/lib/ceph/osd/ceph-${osd_id} + +# Remove monit job +if [ -e /etc/monit ]; then + monit stop $osd_name + /opt/ungleich-tools/monit-remove $osd_name +else + /etc/init.d/ceph stop $osd_name +fi + +ceph osd crush remove $osd_name +ceph osd rm $osd_name + +umount "$mountpath" + +echo 'TODO: remove from fstab!' diff --git a/monit-ceph-remove b/monit-remove similarity index 100% rename from monit-ceph-remove rename to monit-remove