5.2. 池放置组和 CRUSH
当您创建池并为池设置放置组数量时,Ceph 在不特别覆盖默认值时会使用默认值。
重要
红帽建议覆盖一些默认值。特别是,设置池的副本大小并覆盖默认放置组数量。
您可以在运行池命令时设置这些值。您还可以通过在 Ceph 配置文件的 [global]
部分添加新项来覆盖默认值。
示例
[global] # By default, Ceph makes 3 replicas of objects. If you want to set 4 # copies of an object as the default value--a primary copy and three replica # copies--reset the default values as shown in 'osd pool default size'. # If you want to allow Ceph to write a lesser number of copies in a degraded # state, set 'osd pool default min size' to a number less than the # 'osd pool default size' value. osd_pool_default_size = 4 # Write an object 4 times. osd_pool_default_min_size = 1 # Allow writing one copy in a degraded state. # Ensure you have a realistic number of placement groups. We recommend # approximately 100 per OSD. E.g., total number of OSDs multiplied by 100 # divided by the number of replicas (i.e., osd pool default size). So for # 10 OSDs and osd pool default size = 4, we'd recommend approximately # (100 * 10) / 4 = 250. osd_pool_default_pg_num = 250 osd_pool_default_pgp_num = 250