前言


操作步骤

  1. 关闭平衡
ceph osd set norecover
ceph osd set nobackfill 
  1. 移除磁盘
ceph osd purge osd.97 --force
  1. 格式化并加入磁盘
ceph-deploy disk zap <osd_server_name> /dev/sdac
ceph-deploy osd create <osd_server_name>  --bluestore --data /dev/sdac
  1. 导出map
cd /root/ceph-admin
ceph osd getmap > osdmap.bin
  1. 计算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
  1. 计算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
  1. 开启平衡
ceph osd unset norecover   # 平衡
ceph osd unset nobackfill  # 回填

参考资料


交个朋友