这里先说下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
以