1、关闭ceph osd进程
service ceph stop osd
2、让ceph集群中的数据进行平衡
3、等所有的pg都达到active+clean平衡度时删除osd节点
删除前ceph集群状态
[root@os-node3 ~]# ceph osd tree
# id weight type name up/down reweight
-1 4 root default
-2 1 host os-node3
0 1 osd.0 down 0
-3 1 host os-node4
1 1 osd.1 up 1
-4 1 host os-node5
2 1 osd.2 up 1
-5 1 host os-node6
3 1 osd.3 up 1
1)、在集群中删除一个osd硬盘
[root@os-node3 ~]# ceph osd rm 0
removed osd.0
[root@os-node3 ~]# ceph osd tree
# id weight type name up/down reweight
-1 4 root default
-2 1 host os-node3
0 1 osd.0 DNE
-3 1 host os-node4
1 1 osd.1 up 1
-4 1 host os-node5
2 1 osd.2 up 1
-5 1 host os-node6
3 1 osd.3 up 1
2)、在集群中删除一个osd 硬盘 crush map
[root@os-node3 ~]# ceph osd crush rm osd.0
removed item id 0 name ‘osd.0‘ from crush map
[root@os-node3 ~]# ceph osd tree
# id weight type name up/down reweight
-1 3 root default
-2 0 host os-node3
-3 1 host os-node4
1 1 osd.1 up 1
-4 1 host os-node5
2 1 osd.2 up 1
-5 1 host os-node6
3 1 osd.3 up 1
3)、在集群中删除一个osd节点
[root@os-node3 ~]# ceph osd crush rm os-node3
removed item id -2 name ‘os-node3‘ from crush map
[root@os-node3 ~]#
[root@os-node3 ~]# ceph osd tree
# id weight type name up/down reweight
-1 3 root default
-3 1 host os-node4
1 1 osd.1 up 1
-4 1 host os-node5
2 1 osd.2 up 1
-5 1 host os-node6
3 1 osd.3 up
本文出自 “zhanguo1110” 博客,请务必保留此出处http://zhanguo1110.blog.51cto.com/5750817/1535781
原文地址:http://zhanguo1110.blog.51cto.com/5750817/1535781