]> git.proxmox.com Git - ceph.git/blame - ceph/doc/cephfs/eviction.rst
update sources to v12.1.0
[ceph.git] / ceph / doc / cephfs / eviction.rst
CommitLineData
7c673cae 1
31f18b77 2===============================
7c673cae
FG
3Ceph filesystem client eviction
4===============================
5
6When a filesystem client is unresponsive or otherwise misbehaving, it
7may be necessary to forcibly terminate its access to the filesystem. This
8process is called *eviction*.
9
31f18b77
FG
10Evicting a CephFS client prevents it from communicating further with MDS
11daemons and OSD daemons. If a client was doing buffered IO to the filesystem,
12any un-flushed data will be lost.
13
14Clients may either be evicted automatically (if they fail to communicate
15promptly with the MDS), or manually (by the system administrator).
16
17The client eviction process applies to clients of all kinds, this includes
18FUSE mounts, kernel mounts, nfs-ganesha gateways, and any process using
19libcephfs.
20
21Automatic client eviction
22=========================
23
24There are two situations in which a client may be evicted automatically:
25
26On an active MDS daemon, if a client has not communicated with the MDS for
27over ``mds_session_autoclose`` seconds (300 seconds by default), then it
28will be evicted automatically.
29
30During MDS startup (including on failover), the MDS passes through a
31state called ``reconnect``. During this state, it waits for all the
32clients to connect to the new MDS daemon. If any clients fail to do
33so within the time window (``mds_reconnect_timeout``, 45 seconds by default)
34then they will be evicted.
35
36A warning message is sent to the cluster log if either of these situations
37arises.
7c673cae 38
31f18b77
FG
39Manual client eviction
40======================
7c673cae 41
31f18b77
FG
42Sometimes, the administrator may want to evict a client manually. This
43could happen if a client is died and the administrator does not
44want to wait for its session to time out, or it could happen if
45a client is misbehaving and the administrator does not have access to
46the client node to unmount it.
7c673cae 47
31f18b77 48It is useful to inspect the list of clients first:
7c673cae
FG
49
50::
51
31f18b77
FG
52 ceph tell mds.0 client ls
53
7c673cae 54 [
31f18b77
FG
55 {
56 "id": 4305,
57 "num_leases": 0,
58 "num_caps": 3,
59 "state": "open",
60 "replay_requests": 0,
61 "completed_requests": 0,
62 "reconnecting": false,
63 "inst": "client.4305 172.21.9.34:0/422650892",
64 "client_metadata": {
65 "ceph_sha1": "ae81e49d369875ac8b569ff3e3c456a31b8f3af5",
66 "ceph_version": "ceph version 12.0.0-1934-gae81e49 (ae81e49d369875ac8b569ff3e3c456a31b8f3af5)",
67 "entity_id": "0",
68 "hostname": "senta04",
69 "mount_point": "/tmp/tmpcMpF1b/mnt.0",
70 "pid": "29377",
71 "root": "/"
72 }
73 }
74 ]
75
76
77
78Once you have identified the client you want to evict, you can
79do that using its unique ID, or various other attributes to identify it:
7c673cae
FG
80
81::
31f18b77
FG
82
83 # These all work
84 ceph tell mds.0 client evict id=4305
85 ceph tell mds.0 client evict client_metadata.=4305
86
7c673cae 87
31f18b77
FG
88Advanced: Un-blacklisting a client
89==================================
7c673cae 90
31f18b77
FG
91Ordinarily, a blacklisted client may not reconnect to the servers: it
92must be unmounted and then mounted anew.
7c673cae 93
31f18b77
FG
94However, in some situations it may be useful to permit a client that
95was evicted to attempt to reconnect.
7c673cae 96
31f18b77
FG
97Because CephFS uses the RADOS OSD blacklist to control client eviction,
98CephFS clients can be permitted to reconnect by removing them from
99the blacklist:
7c673cae
FG
100
101::
102
31f18b77
FG
103 ceph osd blacklist ls
104 # ... identify the address of the client ...
105 ceph osd blacklist rm <address>
7c673cae 106
31f18b77
FG
107Doing this may put data integrity at risk if other clients have accessed
108files that the blacklisted client was doing buffered IO to. It is also not
109guaranteed to result in a fully functional client -- the best way to get
110a fully healthy client back after an eviction is to unmount the client
111and do a fresh mount.
7c673cae 112
31f18b77
FG
113If you are trying to reconnect clients in this way, you may also
114find it useful to set ``client_reconnect_stale`` to true in the
115FUSE client, to prompt the client to try to reconnect.
7c673cae 116
31f18b77
FG
117Advanced: Configuring blacklisting
118==================================
7c673cae 119
31f18b77
FG
120If you are experiencing frequent client evictions, due to slow
121client hosts or an unreliable network, and you cannot fix the underlying
122issue, then you may want to ask the MDS to be less strict.
7c673cae 123
31f18b77
FG
124It is possible to respond to slow clients by simply dropping their
125MDS sessions, but permit them to re-open sessions and permit them
126to continue talking to OSDs. To enable this mode, set
127``mds_session_blacklist_on_timeout`` to false on your MDS nodes.
7c673cae 128
31f18b77
FG
129For the equivalent behaviour on manual evictions, set
130``mds_session_blacklist_on_evict`` to false.
131
132Note that if blacklisting is disabled, then evicting a client will
133only have an effect on the MDS you send the command to. On a system
134with multiple active MDS daemons, you would need to send an
135eviction command to each active daemon. When blacklisting is enabled
136(the default), sending an eviction to command to just a single
137MDS is sufficient, because the blacklist propagates it to the others.
138
139Advanced options
140================
141
142``mds_blacklist_interval`` - this setting controls how many seconds
143entries will remain in the blacklist for.
7c673cae 144
7c673cae 145