前言
操作步骤
- 关闭平衡
ceph osd set norecover
ceph osd set nobackfill
- 移除磁盘
ceph osd purge osd.97 --force
- 格式化并加入磁盘
ceph-deploy disk zap <osd_server_name> /dev/sdac
ceph-deploy osd create <osd_server_name> --bluestore --data /dev/sdac
- 导出map
cd /root/ceph-admin
ceph osd getmap > osdmap.bin
- 计算metadata
osdmaptool --upmap-pool cephfs_metadata osdmap.bin --upmap upmap.txt --upmap-deviation 1 --upmap-max 1000
awk '{print $0" &"}' upmap.txt >upmap2.txt
source upmap2.txt
- 计算data
osdmaptool --upmap-pool cephfs_data osdmap.bin --upmap upmap.txt --upmap-deviation 1 --upmap-max 10000
awk '{print $0" &"}' upmap.txt >upmap2.txt
source upmap2.txt
- 开启平衡
ceph osd unset norecover # 平衡
ceph osd unset nobackfill # 回填
参考资料
交个朋友