@dyj2017
2017-10-20T17:02:19.000000Z
字数 786
阅读 927
# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
# ceph -v
ceph version 12.2.1 (3e7492b9ada8bdc9a5cd0feafd42fbca27f9c38e) luminous (stable)
# touch del_osd.sh
# chmod +x del_osd.sh
# vi del_osd.sh
输入以下内容:
#!/bin/sh
osd_id=`ceph osd tree | grep down| awk '{print $1}'`
for var in ${osd_id}
do
echo "deleting osd.$var"
ceph osd out osd.$var
ceph osd rm osd.$var
ceph osd crush rm osd.$var
ceph auth del osd.$var
sleep 5
echo "umount /var/lib/ceph/osd/ceph-$var "
umount /var/lib/ceph/osd/ceph-$var
done
因为如果不sleep执行umount,umount非常容易失败,所以睡5秒执行就好咯
需要说明的是umount只能在osd所在的host上进行,如果仍然umount失败参考umount: /var/lib/ceph/osd/ceph-1:目标忙解决办法
# ./del_osd.sh
http://www.cnblogs.com/suyang/archive/2008/05/18/1201990.html
http://blog.sina.com.cn/s/blog_69a636860102vgdq.html
http://bbs.chinaunix.net/thread-2018059-1-1.html