一、前言
首先来一段英文关于PG和PGP区别的解释:
PG = Placement Group
PGP = Placement Group for Placement purpose
pg_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的相关解释,他也是 Learning Ceph 和 Ceph Cookbook的作者,以上的解释没有问题,我们来看下具体在集群里面具体作用
二、实践
环境准备,因为是测试环境,我只准备了两台机器,每台机器4个OSD,所以做了一些参数的设置,让数据尽量散列
osd_crush_chooseleaf_type = 0
以上为修改的参数,这个是让我的环境故障域为OSD分组的
创建测试需要的存储池
我们初始情况只创建一个名为testpool包含6个PG的存储池