CephFS client evict子命令使用
概述
在使用Ceph的CephFS时,每个client都会建立与MDS的连接,以获取CephFS的元数据信息。如果有多个Active的MDS,则一个client可能会与多个MDS都建立连接。
Ceph提供了client/session
子命令来查询和管理这些连接,在这些子命令中,有一个命令来处理当CephFS的client有问题时,如何手动来断开这些client的连接,比如执行命令:# ceph tell mds.2 client evict
,则会把与mds rank 2 连接的所有clients都断开。
那么执行client evict
的影响是什么?是否可以恢复呢?本文将重点介绍一下这些。
1. 查看所有client/session
可以通过命令 client/session ls
查看与ms rank [id] 建立connection的所有clients;
# ceph tell mds.0 client ls
2018-09-05 10:00:15.986 7f97f0ff9700 0 client.25196 ms_handle_reset on 192.168.0.26:6800/1856812761
2018-09-05 10:00:16.002 7f97f1ffb700 0 client.25199 ms_handle_reset on 192.168.0.26:6800/1856812761
[
{
"id": 25085,
"num_leases": 0,
"num_caps": 5,
"state": "open",
"replay_requests": 0,
"completed_requests": 0,
"reconnecting": false,
"inst": "client.25085 192.168.0.26:0/265326503",
"client_metadata": {
"ceph_sha1": "5533ecdc0fda920179d7ad84e0aa65a127b20d77",
"ceph_version": "ceph version 13.2.1 (5533ecdc0fda920179d7ad84e0aa65a127b20d77) mimic (stable)",
"entity_id": "admin",
"hostname": "mimic3",
"mount_point": "/mnt/cephfuse",
"pid": "44876",
"root": "/"
}
}
]
注释:
- id:client唯一id
- num_caps:client获取的caps
- inst:client端的ip和端口链接信息
- ceph_version:client端的ceph-fuse版本,若使用kernel client,则为kernel_version
- hostname:client端的主机名
- mount_point:client在主机上对应的mount point
- pid:client端ceph-fuse进程的pid
2. evict指定client
可以通过指定id来evict特定的client链接:
# ceph tell mds.0 client evict id=25085