11.4. 查看 Ceph 文件系统的镜像状态
Ceph 文件系统(CephFS)镜像守护进程(cephfs-mirror
)会获取 CephFS 镜像状态更改的异步通知,以及对等更新。您可以通过命令查询 cephfs-mirror
admin socket,以检索镜像状态和对等状态。
先决条件
- 至少部署了一个带有镜像的 Ceph 文件系统。
- 根级别访问运行 CephFS 镜像守护进程的节点。
流程
登录到 Cephadm shell:
示例
[root@host01 ~]# cephadm shell
在运行 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
。查看镜像状态:
语法
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 秒。
同步统计信息: snaps_synced
、snaps_deleted
和 snaps_renamed
在 cephfs-mirror
守护进程重启时被重置。
其它资源
- 请参阅 Red Hat Ceph Storage 文件系统指南中的 Ceph 文件系统镜像部分。