「CEPH」- 常见 PG 管理

增加 PG(增)

WIP

删除 PG(删)

WIP

修改 PG(改)

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

# 清理
ceph pg scrub

# 深度清理
ceph deep-scrub

查看 PG(查)

# ceph pg ls
...

# ceph pg stat
641 pgs: 641 active+clean; 884 GiB data, 1.5 TiB used, 2.0 TiB / 3.5 TiB avail; 8.0 KiB/s rd, 3.4 MiB/s wr, 24 op/s

计算 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.

=

常见问题处理

… 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

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