注意

本文档适用于 Ceph 开发版本。

池、PG 和 CRUSH 配置参考

CRUSH 算法为每个池分配的放置组数量由监控集群中的集中配置数据库中的变量值决定。

容器化部署的 Ceph(使用 Rook 进行的部署)和非容器化部署的 Ceph 都依赖于监控集群中的集中配置数据库中的值来为池分配放置组。cephadm or Rook) and non-containerized deployments of Ceph rely on the values in the central configuration database in the monitor cluster to assign placement groups to pools.

示例命令

要查看控制给定池中放置组数量的变量的值,请运行以下格式的命令:

ceph config get osd osd_pool_default_pg_num

要设置控制给定池中放置组数量的变量的值,请运行以下格式的命令:

ceph config set osd osd_pool_default_pg_num

手动调优

在某些情况下,可能建议覆盖一些默认值。例如,您可能认为设置池的副本大小并覆盖池中的默认放置组数量是明智的。您可以在运行pool commands.

参见

请参阅Autoscaling placement groups.

[global]

	# By default, Ceph makes three replicas of RADOS objects. If you want
	# to maintain 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 accept an I/O
	# operation to a degraded PG, 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 three times.
	osd_pool_default_min_size = 2 # Accept an I/O operation to a PG that has two copies of an object.

	# Note: by default, PG autoscaling is enabled and this value is used only
	# in specific circumstances. It is however still recommend to set it.
	# 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 two.
	osd_pool_default_pg_num = 256
mon_max_pool_pg_num

每个池的最大放置组数量。

type:

uint

default:

64Ki

mon_pg_stuck_threshold

经过多少秒后可以将 PG 视为卡住。

type:

int

default:

1 minute

mon_pg_warn_min_per_osd

如果任何池配置为没有副本,则提高HEALTH_WARN如果每个 OSD 的平均 PG 数量低于此数字。一个非正数将禁用此功能。in OSD is under this number. A non-positive number disables this.

type:

uint

default:

0

mon_pg_warn_min_objects

如果集群中的 RADOS 对象总数低于此数字,则不发出警告

type:

int

default:

10000

mon_pg_warn_min_pool_objects

如果池的 RADOS 对象计数低于此数字,则不发出警告

type:

int

default:

1000

mon_pg_check_down_all_threshold

超过此 OSD 百分比阈值的 OSD,我们将检查所有 PG 以查找过时的 PG。down OSDs above which we check all PGs for stale ones.

type:

float

default:

0.5

mon_pg_warn_max_object_skew

如果任何池配置为没有副本,则提高HEALTH_WARN如果任何池的每个 PG 的平均 RADOS 对象计数大于所有池的每个 PG 的平均 RADOS 对象计数的mon_pg_warn_max_object_skew倍,则发出警告。零或非正数将禁用此功能。请注意,此选项适用于ceph-mgr daemons.

type:

float

default:

10.0

mon_delta_reset_interval

在我们将 PG 差值重置为 0 之前的非活动时间(以秒为单位)。我们跟踪每个池的已用空间的差值,因此,例如,它将更容易让我们理解恢复进度或缓存层性能。但如果某个池没有报告活动,我们将仅重置该池的差值历史记录。

type:

float

default:

10.0

osd_crush_chooseleaf_type

在 CRUSH 规则中使用的桶类型。使用序数值而不是名称。chooseleaf in a CRUSH rule. Uses ordinal rank rather than name.

type:

int

default:

1

osd_crush_initial_weight

新添加的 OSD 的初始 CRUSH 权重。此选项的默认值是the size of a newly added OSD in TB。默认情况下,新添加的 OSD 的初始 CRUSH 权重设置为其设备大小(TB)。请参阅权重桶项 for details.

type:

float

default:

-1.0

osd_pool_default_crush_rule

创建复制池时使用的默认 CRUSH 规则。此选项的默认值是-1,意思是“选择具有最低数值 ID 的规则并使用该规则”。这是为了在没有规则 0 的情况下使池创建工作。

type:

int

default:

-1

osd_pool_erasure_code_stripe_unit

设置纠删码池中对象条带块的大小(以字节为单位)。每个大小为 S 的对象将存储为 N 条带,每个数据块将接收stripe unit字节。每个大小为N * stripe unit字节的条带将单独编码/解码。此选项可以被纠删码配置文件中的stripe_unit设置覆盖。

type:

size

default:

4Ki

osd_pool_default_size

设置池中对象的副本数量。默认值与ceph osd pool set {pool-name} size {size}.

type:

uint

default:

3

允许范围:

[0, 10]

相同。

设置池中对象的最低写入副本数量,以便向客户端确认 I/O 操作。如果未达到最低值,Ceph 将不会向客户端确认 I/O,这可能导致数据丢失。此设置确保在degraded模式下至少有副本数量。默认值是0,这意味着没有特定的最低值。如果0,最低值为size - (size / 2).

type:

uint

default:

0

允许范围:

[0, 255]

参见:

osd_pool_default_size

osd_pool_default_pg_num

池的默认放置组数量。默认值与pg_num with mkpool.

type:

uint

default:

32

参见:

osd_pool_default_pg_autoscale_mode

相同。

池的默认放置组数量。默认值与pgp_num with mkpool相同。

type:

uint

default:

0

参见:

osd_pool_default_pg_num, osd_pool_default_pg_autoscale_mode

osd_pool_default_pg_autoscale_mode

默认值为on,自动扩展器将使用 1 pg 启动新池,除非用户指定了 pg_num。

type:

str

default:

on

valid choices:
  • off

  • warn

  • on

osd_pool_default_flags

新池的默认标志。

type:

int

default:

0

osd_max_pgls

列出的最大放置组数量。请求大量客户端可能会使 Ceph OSD 守护进程受阻。

type:

uint

default:

1Ki

osd_min_pg_log_entries

修剪日志文件时维护的最小放置组日志条目数。

type:

uint

default:

250

参见:

osd_max_pg_log_entries, osd_pg_log_dups_tracked, osd_target_pg_log_entries_per_osd

osd_max_pg_log_entries

修剪日志文件时维护的最大放置组日志条目数。

type:

uint

default:

10000

参见:

osd_min_pg_log_entries, osd_pg_log_dups_tracked, osd_target_pg_log_entries_per_osd

osd_default_data_pool_replay_window

OSD 等待客户端重放请求的时间(以秒为单位)。

type:

int

default:

45

osd_max_pg_per_osd_hard_ratio

允许集群在 OSD 拒绝创建新 PG 之前为每个 OSD 分配的 PG 数量的比率。如果 OSD 服务的 PG 数量超过osd_max_pg_per_osd_hard_ratio * mon_max_pg_per_osd.

type:

float

default:

3.0

min:

1

参见:

mon_max_pg_per_osd

由 Ceph 基金会带给您

Ceph 文档是一个社区资源,由非盈利的 Ceph 基金会资助和托管Ceph Foundation. 如果您想支持这一点和我们的其他工作,请考虑加入现在加入.