ceph osd 批量删除
ceph osd 批量删除,注意删除的是当前节点正在使用的osd,数据删除有风险,所以最后一步没有去format磁盘,给你留下一剂后悔药。
#!/bin/bash
osd_list=`mount|grep osd|awk '{print $3}'|awk -F'-' '{print $2}'`
for var in $osd_list;
do
echo "ceph osd out $var"
ceph osd out $var
echo "service ceph-osd stop id=$var"
service ceph-osd stop id=$var
echo "ceph osd crush remove osd.$var"
ceph osd crush remove osd.$var
echo "ceph auth del osd.$var"
ceph auth del osd.$var
echo "ceph osd rm $var"
ceph osd rm $var
echo "umount /var/lib/ceph/osd/ceph-$var"
umount /var/lib/ceph/osd/ceph-$var
done