10.2. 为 Ceph 文件系统添加快照调度
为尚不存在的 CephFS 路径添加快照调度。您可以为单个路径创建一个或多个计划。如果计划重复的时间间隔和开始时间不同,则计划会被视为不同的。
CephFS 路径只能具有一个保留策略,但保留策略可以有多个计数期限对。
启用调度程序模块后,运行 ceph fs snap-schedule
命令将显示可用的子命令及其用法格式。
先决条件
- 一个运行良好、健康的 Red Hat Ceph Storage 集群。
- 部署 Ceph 文件系统.
- 对 Ceph Manager 和元数据服务器(MDS)节点的 root 级别访问权限。
- 在文件系统中启用 CephFS 快照。
流程
在 Ceph Manager 节点上登录到 Cephadm shell:
示例
[root@host01 ~]# cephadm shell
启用
snap_schedule
模块:示例
[ceph: root@host01 /]# ceph mgr module enable snap_schedule
登录到客户端节点:
示例
[root@host02 ~]# cephadm shell
为 Ceph 文件系统添加新计划:
语法
ceph fs snap-schedule add FILE_SYSTEM_VOLUME_PATH REPEAT_INTERVAL [START_TIME] --fs CEPH_FILE_SYSTEM_NAME
示例
[ceph: root@host02 /]# ceph fs snap-schedule add /cephfs_kernelf739cwtus2/pmo9axbwsi 1h 2022-06-27T21:50:00 --fs mycephfs
注意START_TIME 以 ISO 8601 格式表示。
本例为文件系统
mycephfs
的路径/cephfs
创建了一个快照调度,每小时执行一次快照,并在 2022 年 6 月 27 日 9:50 PM 开始。为 CephFS 卷路径的快照添加新保留策略:
语法
ceph fs snap-schedule retention add FILE_SYSTEM_VOLUME_PATH [COUNT_TIME_PERIOD_PAIR] TIME_PERIOD COUNT
示例
[ceph: root@host02 /]# ceph fs snap-schedule retention add /cephfs h 14 1 [ceph: root@host02 /]# ceph fs snap-schedule retention add /cephfs d 4 2 [ceph: root@host02 /]# ceph fs snap-schedule retention add /cephfs 14h4w 3
列出快照计划,以验证新计划是否已创建。
语法
ceph fs snap-schedule list FILE_SYSTEM_VOLUME_PATH [--format=plain|json] [--recursive=true]
示例
[ceph: root@host02 /]# ceph fs snap-schedule list /cephfs --recursive=true
这个示例列出了目录树中的所有计划。
检查快照调度的状态:
语法
ceph fs snap-schedule status FILE_SYSTEM_VOLUME_PATH [--format=plain|json]
示例
[ceph: root@host02 /]# ceph fs snap-schedule status /cephfs --format=json
本例以 JSON 格式显示 CephFS
/cephfs
路径的快照调度状态。如果没有指定默认格式为纯文本。
其它资源
- 如需了解更多详细信息,请参阅 Red Hat Ceph Storage 文件系统指南中的 Ceph 文件系统快照调度部分。
- 如需了解更多详细信息,请参阅 Red Hat Ceph Storage 文件系统指南中的 Ceph 文件系统快照部分。