这里先说下ceph中PG和PGP使用的一个典型场景,ceph中PG数是可以修改的,但是目前只能从小到大修改 ,那么就会有一种情况PG数修改变大后就会存在PG分裂的场景。如源集群PG为PG1/2/3 修改PG数为PG1/2/3/4/5后ceph为了保证存储数据平滑分裂引入PGP概念,PGP就是用来保存分裂前PG的状态,意为PG初始状态或PG祖先。所以修改PG数后PG分布不回引起太大的变化,但如果同时修改PG和PGP将引起集群数据大规模迁移,请结合上述理解以下文章内容
一、前言
首先来一段英文关于PG和PGP区别的解释:
PG = Placement Group
PGP = Placement Group for Placement purposepg_num = number of placement groups mapped to an OSD
When pg_num is increased for any pool, every PG of this pool splits into half, but they all remain mapped to their parent OSD.
Until this time, Ceph does not start rebalancing. Now, when you increase the pgp_num value for the same pool, PGs start to migrate from the parent to some other OSD, and cluster rebalancing starts. This is how PGP plays an important role.
By Karan Singh
以上是来自邮件列表的 Karan Singh 的PG和PGP的相关解释,他也是

本文详细介绍了Ceph中PG(Placement Group)和PGP(Placement Group for Placement purpose)的区别及作用。当PG数增加时,每个PG会分裂但保持在原有OSD上,直到PGP值增加,此时PG开始迁移到其他OSD,引发集群数据重新分布。实践中,增加PG会导致对象分裂,而增加PGP仅改变PG分布,不影响对象本身。总结指出,PG决定对象目录数量,PGP决定PG在OSD上的分布组合。
最低0.47元/天 解锁文章
3333

被折叠的 条评论
为什么被折叠?



