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的标志位
1 2 3 4 5 6 7 8 9 10 11 | 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盘符
1 | ll / var /lib/ceph/osd/ceph-*/journal |
3、删除osd
1 2 3 4 | ceph osd crush reweight osd.${id} 0 ceph osd crush rm osd.${id} ceph osd rm osd.${id} ceph auth del osd.${id} |
4、换盘
1 2 | 将新加的盘的权限修改 chown ceph:ceph /dev/sdX |
5、部署osd
1 2 | ceph-disk prepare /dev/sdv /dev/disk/ by -partuuid/f619b6e5-8f93-4ab2-8bb3-5c6cb0326e88 --zap-disk --filestore #注意,找到osd之前对应的日志盘的partuuid |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步