Steps to replace disks for Ceph distributed storage
Ceph Distributed Storage Replacement Disk Steps
1. Confirm the drive letter and OSD ID corresponding to the disk to be replaced;
root@Ceph-B**A**-04-S2-60:~# df -h |grep 17
/dev/sdp3 1.1T 566G 551G 51% /var/lib/ceph/osd/ceph-17
2. Confirm the corresponding slot position of the disk;
root@Ceph-B**A**-04-S2-60:~# ll /dev/disk/by-path/ |grep sdp
lrwxrwxrwx 1 root root 9 Aug 17 19:17 pci-0000:02:00.0-scsi-0:0:18:0 -> ../../ sdp
lrwxrwxrwx 1 root root 10 Aug 17 19:17 pci-0000:02:00.0-scsi-0:0:18:0-part1 -> ../../ sdp1
lrwxrwxrwx 1 root root 10 Aug 17 19:17 pci-0000:02:00.0-scsi-0:0:18:0-part2 -> ../../ sdp2
lrwxrwxrwx 1 root root 10 Aug 17 19:17 pci-0000:02:00.0-scsi-0:0:18:0-part3 -> ../../ sdp3
3. Confirm host SN;
root@Ceph-B**A**-04-S2-60:~# dmidecode -s system-serial-number
HVNHB**
4. Set OSD Flag;
ceph osd out 17
5. Check the cluster status;
ceph -s
6. Close the corresponding OSD process;
stop cep-osd id=17
Remove OSD from CrshMap;
ceph osd crush remove osd.17
8. Delete OSD authentication information;
ceph auth del osd.17
9. Remove OSD from cluster;
ceph osd rm 17
10. Unmount the mount point;
umount /var/lib/ceph/osd/ceph-17
11. Replace the disk with a new one... slightly;
12. Format the new disk;
ceph-deploy disk zap Ceph-B**A**-04-S2-60.domain.tld:sdp
13. Create OSD;
ceph-deploy osd create Ceph-B**A**-04-S2-60.domain.tld:sdp
14. Adjust CrushMap;
ceph osd crush add osd.17 1.17 root=sata pod=sata-pod-01 chassis=sata-chassis-01 host=Ceph-B**A**-04-S2-60-sata
15. Optimize mount parameters;
mount -o remount,nobarrier /var/lib/ceph/osd/ceph-17