11.2. 查看 Ceph 文件系统的镜像状态
Ceph 文件系统(CephFS)镜像守护进程(cephfs-mirror
)会获取 CephFS 镜像状态更改的异步通知,以及对等更新。CephFS 镜像模块提供镜像守护进程状态接口,用于检查镜像守护进程状态。如需更多信息,您可以使用命令查询 cephfs-mirror
admin socket,以检索镜像状态和对等状态。
先决条件
- 一个正在运行的 Red Hat Ceph Storage 集群。
- 至少部署了一个带有镜像的 Ceph 文件系统。
- 根级别访问运行 CephFS 镜像守护进程的节点。
流程
登录到 Cephadm shell:
示例
[root@host01 ~]# cephadm shell
检查
cephfs-mirror
守护进程状态:语法
ceph fs snapshot mirror daemon status
示例
[ceph: root@host01 /]# ceph fs snapshot mirror daemon status [ { "daemon_id": 15594, "filesystems": [ { "filesystem_id": 1, "name": "cephfs", "directory_count": 1, "peers": [ { "uuid": "e5ecb883-097d-492d-b026-a585d1d7da79", "remote": { "client_name": "client.mirror_remote", "cluster_name": "remote-site", "fs_name": "cephfs" }, "stats": { "failure_count": 1, "recovery_count": 0 } } ] } ] } ]
如需更多信息,请使用 admin socket 接口,如下所示。
在运行 CephFS 镜像守护进程的节点上查找 Ceph 文件系统 ID:
语法
ceph --admin-daemon PATH_TO_THE_ASOK_FILE help
示例
[ceph: root@host01 /]# ceph --admin-daemon /var/run/ceph/1011435c-9e30-4db6-b720-5bf482006e0e/ceph-client.cephfs-mirror.node1.bndvox.asok help { ... "fs mirror peer status cephfs@11 1011435c-9e30-4db6-b720-5bf482006e0e": "get peer mirror status", "fs mirror status cephfs@11": "get filesystem mirror status", ... }
本例中的 Ceph 文件系统 ID 是
cephfs@11
。注意当禁用镜像时,文件系统的对应
fs mirror status
命令不会在help
命令中显示。查看镜像状态:
语法
ceph --admin-daemon PATH_TO_THE_ASOK_FILE fs mirror status FILE_SYSTEM_NAME@_FILE_SYSTEM_ID
示例
[ceph: root@host01 /]# ceph --admin-daemon /var/run/ceph/1011435c-9e30-4db6-b720-5bf482006e0e/ceph-client.cephfs-mirror.node1.bndvox.asok fs mirror status cephfs@11 { "rados_inst": "192.168.0.5:0/1476644347", "peers": { "1011435c-9e30-4db6-b720-5bf482006e0e": { 1 "remote": { "client_name": "client.mirror_remote", "cluster_name": "remote-site", "fs_name": "cephfs" } } }, "snap_dirs": { "dir_count": 1 } }
- 1
- 这是唯一的对等 UUID。
查看对等状态:
语法
ceph --admin-daemon PATH_TO_ADMIN_SOCKET fs mirror status FILE_SYSTEM_NAME@FILE_SYSTEM_ID PEER_UUID
示例
[ceph: root@host01 /]# ceph --admin-daemon /var/run/ceph/cephfs-mirror.asok fs mirror peer status cephfs@11 1011435c-9e30-4db6-b720-5bf482006e0e { "/home/user1": { "state": "idle", 1 "last_synced_snap": { "id": 120, "name": "snap1", "sync_duration": 0.079997898999999997, "sync_time_stamp": "274900.558797s" }, "snaps_synced": 2, 2 "snaps_deleted": 0, 3 "snaps_renamed": 0 } }
state
可以是以下三个值之一:
默认连续故障数为 10,默认重试间隔为 60 秒。
显示
cephfs-mirror
守护进程映射到的目录:语法
ceph fs snapshot mirror dirmap FILE_SYSTEM_NAME PATH
示例
[ceph: root@host01 /]# ceph fs snapshot mirror dirmap cephfs /volumes/_nogroup/subvol_1 { "instance_id": "25184", 1 "last_shuffled": 1661162007.012663, "state": "mapped" }
- 1
instance_id
是与cephfs-mirror
守护进程关联的 RADOS instance-ID。
示例
[ceph: root@host01 /]# ceph fs snapshot mirror dirmap cephfs /volumes/_nogroup/subvol_1 { "reason": "no mirror daemons running", "state": "stalled" 1 }
- 1
stalled
状态表示 CephFS 镜像停滞。
第二个示例显示了没有镜像守护进程运行时的命令输出。
其它资源
- 请参阅 Red Hat Ceph Storage 文件系统指南中的 Ceph 文件系统镜像部分。