许吉友 - 运维

Pool & PG & CRUSH 配置

官方文档:https://ceph.readthedocs.io/en/latest/rados/configuration/pool-pg-config-ref/

创建 Pool 并设置 Pool 的 PG 数时,当没有明确覆盖默认值时,Ceph将使用默认值。建议覆盖一些默认设置。具体来说,建议设置 Pool 的副本大小,并覆盖默认的 PG 数。可以在运行 Pool 命令时专门设置这些值。还可以通过在 Ceph 配置文件的 [global] 部分添加新的默认值来覆盖默认值。

[global]

    # By default, Ceph makes 3 replicas of objects. If you want to make four
    # copies of an object 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 = 3  # Write an object 3 times.
    osd pool default min size = 2 # Allow writing two copies 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.
        # always use the nearest power of 2

    osd pool default pg num = 256
    osd pool default pgp num = 256

mon max pool pg num

mon pg create interval

mon pg stuck threshold

mon pg min inactive

mon pg warn min per osd

mon pg warn min objects

mon pg warn min pool objects

mon pg check down all threshold

mon pg warn max object skew

mon delta reset interval

mon osd max op age

osd pg bits

osd pgp bits

osd crush chooseleaf type

osd crush initial weight

osd pool default crush rule

osd pool erasure code stripe unit

osd pool default size

osd pool default min size

osd pool default pg num

osd pool default pgp num

osd pool default flags

osd max pgls

osd min pg log entries

osd max pg log entries

osd default data pool replay window

osd max pg per osd hard ratio

osd recovery priority

osd recovery op priority