Add script for removing ceph monitors
This commit is contained in:
parent
e7d5475f2c
commit
b18e0bd999
2 changed files with 22 additions and 3 deletions
17
ceph-mon-stop-delete
Executable file
17
ceph-mon-stop-delete
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# -ne 0 ]; then
|
||||||
|
echo "$0 (no arguments"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mon=mon.$(hostname)
|
||||||
|
|
||||||
|
# Starting with monit, if available
|
||||||
|
if [ -e /etc/monit ]; then
|
||||||
|
/opt/ungleich-tools/monit-remove "$mon"
|
||||||
|
else
|
||||||
|
/etc/init.d/ceph stop "$mon"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ceph mon remove "${mon}"
|
|
@ -10,9 +10,11 @@ fi
|
||||||
|
|
||||||
to_monitor=$1
|
to_monitor=$1
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
conf="/etc/monit/conf.d/$to_monitor"
|
conf="/etc/monit/conf.d/$to_monitor"
|
||||||
|
|
||||||
|
|
||||||
|
monit stop "$to_monitor"
|
||||||
|
sleep 1
|
||||||
|
|
||||||
rm -f "$conf"
|
rm -f "$conf"
|
||||||
monit reload
|
/etc/init.d/monit restart
|
||||||
|
|
Loading…
Reference in a new issue