[root@node1 ~]# ceph -v
ceph version 0.94.10 (b1e0532418e4631af01acbc0cedd426f1905f4af)
问题描述:
在使用批量删除osd的shell脚本删除所有的osd时,提示:Error EBUSY: osd.0 is still up; must be down before removal.查看集群架构:
[root@node1]# ceph osd tree
92 3.62999 osd.92 up 1.00000 1.00000
-5 87.12000 host node1
7 3.62999 osd.7 up 1.00000 1.00000
10 3.62999 osd.10 up 1.00000 1.00000
15 3.62999 osd.15 up 1.00000 1.00000
19 3.62999 osd.19 up 1.00000 1.00000
23 3.62999 osd.23 up 1.00000 1.00000
27 3.62999 osd.27 up 0.30496 1.00000
31 3.62999 osd.31 up 0.80005 1.00000
35 3.62999 osd.35 up 1.00000 1.00000
40 3.62999 osd.40 up 1.00000 1.00000
43 3.62999 osd.43 up 1.00000 1.00000
47 3.62999 osd.47 up 1.00000 1.00000
52 3.62999 osd.52 up 1.00000 1.00000
57 3.62999 osd.57 up 0.80005 1.00000
61 3.62999 osd.61 up 1.00000 1.00000
65 3.62999 osd.65 up 1.00000 1.00000
68 3.62999 osd.68 up 1.00000 1.00000
72 3.62999 osd.72 up 1.00000 1.00000
78 3.62999 osd.78 up 1.00000 1.00000
82 3.62999 osd.82 up 1.00000 1.00000
85 3.62999 osd.85 up 0.89999 1.00000
88 3.62999 osd.88 up 1.00000 1.00000
91 3.62999 osd.91 up 1.00000 1.00000
94 3.62999 osd.94 up 1.00000 1.00000
95 3.62999 osd.95 up 1.00000 1.00000
0 0 osd.0 up 0 1.00000
解决方法:
通过ceph命令强行标记为down,之后删除即可。下面先标记为down:
[root@node1 ceph]# ceph osd down osd.0
marked down osd.0.
此时查看集群布局:
[root@node1 ceph]# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0 root default
-3 0 host node1
-5 0 host node2
-7 0 host node3
0 0 osd.0 down 0 1.00000
最后删除该osd.0:
[root@node1 ceph]# ceph osd rm 0
removed osd.0
确认是否删除:
[root@node1 ceph]# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0 root default
-3 0 host node1
-5 0 host node2
-7 0 host node3