当我们的osd down掉怎么都启不动的时候,我们可以选择将osd重做。
我这里就以osd.38为例子
[root@ceph0 ~]#ceph osd tree
ID WEIGHT TYPE NAME UP/DOWN REWEIGHT PRIMARY-AFFINITY
-1 5.99991 root default
-2 2.99995 host node0
0 0.20000 osd.0 up 1.00000 1.00000
2 0.20000 osd.2 up 1.00000 1.00000
3 0.20000 osd.3 up 1.00000 1.00000
4 0.20000 osd.4 up 1.00000 1.00000
5 0.20000 osd.5 up 1.00000 1.00000
6 0.20000 osd.6 up 1.00000 1.00000
7 0.20000 osd.7 up 1.00000 1.00000
32 0.20000 osd.32 up 1.00000 1.00000
33 0.20000 osd.33 up 1.00000 1.00000
34 0.20000 osd.34 up 1.00000 1.00000
35 0.20000 osd.35 up 1.00000 1.00000
36 0.20000 osd.36 up 1.00000 1.00000
37 0.20000 osd.37 up 1.00000 1.00000
1 0.20000 osd.1 up 1.00000 1.00000
38 0.20000 osd.38 down 0 1.00000
[root@localhost ~]#ceph osd down 8
osd.8 is already down.
[root@localhost ~]#ceph osd lost 38 --yes-i-really-mean-it
marked osd lost in epoch 7774
[root@localhost ~]#ceph auth del osd.38
updated
[root@localhost ~]#ceph osd rm 38
removed osd.38
[root@localhost ~]#ceph osd create
38
[root@localhost ~]#rm -rf /data/osd.38/*
[root@localhost ~]#ceph-osd -i 38 --mkfs --mkkey
2017-06-20 03:14:13.783499 7ff5463ba900 -1 filestore(/data/osd.38) could not find -1/23c2fcde/osd_superblock/0 in index: (2) No such file or directory
2017-06-20 03:14:14.158459 7ff5463ba900 -1 created object store /data/osd.38 journal /data/osd.38/journal for osd.38 fsid 6c37bad8-96ab-4509-87ea-1189456d93f9
2017-06-20 03:14:14.158498 7ff5463ba900 -1 auth: error reading file: /data/osd.38/keyring: can‘t open /data/osd.38/keyring: (2) No such file or directory
2017-06-20 03:14:14.158689 7ff5463ba900 -1 created new key in keyring /data/osd.38/keyring
[root@localhost ~]#ceph auth add osd.38 osd ‘allow *‘ mon ‘allow rwx‘ -i /data/osd.38/keyring
added key for osd.38
[root@localhost ~]#ceph osd crush add osd.38 0.2 root=default host=node0
set item id 38 name ‘osd.38‘ weight 0.2 at location {host=node0,root=default}: no change
[root@localhost ~]#chown -R ceph /data/osd.38
[root@localhost ~]#systemctl enable ceph-osd@38.serivce
[root@localhost ~]#systemctl restart ceph-osd@38.serivce
本文出自 “12473876” 博客,请务必保留此出处http://12483876.blog.51cto.com/12473876/1942744
原文地址:http://12483876.blog.51cto.com/12473876/1942744