注意

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

在灾难性 Monitor store 损失后恢复文件系统

在罕见的情况下,集群的所有 Monitor store 都可能损坏或丢失。要在这种情况下恢复集群,您需要使用 OSDs(参见 ce4ce4: 使用 OSDs 恢复 1b6ab1: )重建 Monitor store,并完整地恢复池(活动+干净状态)。然而,重建的 Monitor store 不会恢复文件系统映射(“FSMap”)。需要额外的步骤来恢复文件系统。恢复多个活动 MDS 文件系统或多个文件系统的步骤尚未确定。目前,仅已确定和测试了恢复集群中只有一个活动 MDS 文件系统且没有其他文件系统的步骤。简要步骤如下:使用基本默认值重新创建 FSMap;并允许 MDS 从文件系统池中存储的日志/元数据中恢复。以下将详细描述这些步骤。Recovery using OSDs), and get back the pools intact (active+clean state). However, the rebuilt monitor stores don’t restore the file system maps (“FSMap”). Additional steps are required to bring back the file system. The steps to recover a multiple active MDS file system or multiple file systems are yet to be identified. Currently, only the steps to recover a single active MDS file system with no additional file systems in the cluster have been identified and tested. Briefly the steps are: recreate the FSMap with basic defaults; and allow MDSs to recover from the journal/metadata stored in the filesystem’s pools. The steps are described in more detail below.

首先,使用恢复的文件系统池重新创建文件系统。新的 FSMap 将具有文件系统的默认设置。但是,用户定义的文件系统设置,如 3fe70a: 、额外数据池等,将丢失,需要稍后重新应用。standby_count_wanted, required_client_features, extra data pools, etc., are lost and need to be reapplied later.

ceph fs new <fs_name> <metadata_pool> <data_pool> --force --recover

The recover该标志将设置文件系统等级 0 的状态为现有但失败。因此,当 MDS 守护进程最终接管等级 0 时,守护进程将读取现有的 RADOS 元数据,并且不会覆盖它。该标志还防止备用 MDS 守护进程激活文件系统。

文件系统的集群 ID,fscid,将不会被保留。这种行为可能不适合某些期望在恢复过程中文件系统保持不变的应用程序(例如,Ceph CSI)。要修复此问题,您可以选择在上面的命令中设置 64df11: 选项(参见 6e63d8: 允许备用 MDS 守护进程加入文件系统。fscid option in the above command (see 高级).

Allow standby MDS daemons to join the file system.

ceph fs set <fs_name> joinable true

检查文件系统不再处于降级状态,并且有一个活动的 MDS。

ceph fs status

重新应用任何其他自定义文件系统设置。

由 Ceph 基金会带给您

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