「Ceph」- 常见 OSD 管理

  CREATED BY JENKINSBOT

计算 PG 数量

Ceph: too many PGs per OSD – Stack Overflow

Total PGs
Total PGs = (Total_number_of_OSD * 100) / max_replication_count
This result must be rounded up to the nearest power of 2.

Total PGs per pool Calculation:
Total PGs = ((Total_number_of_OSD * 100) / max_replication_count) / pool count
This result must be rounded up to the nearest power of 2.

常用命令

# 修复
# 需要结合当前状态使用,否则可能会影响用户数据;
ceph pg repair

# 清理
ceph pg scrub

# 深度清理
ceph deep-scrub

… pg_num X size X would mean X total pgs, which exceeds max …

WIP

pg stuck in unknown state

故障:pg state unknown – 流年晕开时光 – 博客园

# ceph health detail

# ceph pg PG-ID query

// 如果数据不重要,进行强制修复

# ceph osd force-create-pg 3.1e

// 如果数据很重要,做好心里准备