ceph的常见命令
1、ceph设置回填速度
for i in {0..125} do ceph tell osd.$i injectargs "--osd_max_backfills 1"; done for i in {0..125} do ceph tell osd.$i injectargs "--osd_recovery_max_active 1"; done for i in {0..125} do ceph tell osd.$i injectargs "--osd_recovery_max_single_start 3"; done
2、ceph设置阀值
ceph pg set_nearfull_ratio 0.95 # 设置 nearfull 阈值告警10 版本用不了这个 ceph pg set_full_ratio 0.95 # 设置 osd 最大限制,超过就不能读写 ceph daemon osd.0 config show | grep ratio # 查看 osd 配置详情 ceph tell osd.* injectargs --osd_backfill_full_ratio 0.95 # 修改所有 osd 配置 ceph daemon osd.x dump_historic_ops # 显示 osd 的 op 处理流程情况
3、L版OSD换盘
1、OSD的标志位
ceph osd set norebalance ceph osd set nobackfill ceph osd set noout ceph osd set noscrub ceph osd set nodeep-scrub ceph osd unset norebalance ceph osd unset nobackfill ceph osd unset noout ceph osd unset noscrub ceph osd unset nodeep-scrub
2、 记录OSD对应的journal盘符
ll /var/lib/ceph/osd/ceph-*/journal
3、删除osd
ceph osd crush reweight osd.${id} 0 ceph osd crush rm osd.${id} ceph osd rm osd.${id} ceph auth del osd.${id}
4、换盘
将新加的盘的权限修改 chown ceph:ceph /dev/sdX
5、部署osd
ceph-disk prepare /dev/sdv /dev/disk/by-partuuid/f619b6e5-8f93-4ab2-8bb3-5c6cb0326e88 --zap-disk --filestore #注意,找到osd之前对应的日志盘的partuuid