]> git.proxmox.com Git - ceph.git/blame - ceph/doc/cephfs/administration.rst
import ceph nautilus 14.2.2
[ceph.git] / ceph / doc / cephfs / administration.rst
CommitLineData
11fdf7f2 1.. _cephfs-administration:
7c673cae
FG
2
3CephFS Administrative commands
4==============================
5
6Filesystems
7-----------
8
9These commands operate on the CephFS filesystems in your Ceph cluster.
10Note that by default only one filesystem is permitted: to enable
11creation of multiple filesystems use ``ceph fs flag set enable_multiple true``.
12
13::
14
15 fs new <filesystem name> <metadata pool name> <data pool name>
16
11fdf7f2
TL
17This command creates a new file system. The file system name and metadata pool
18name are self-explanatory. The specified data pool is the default data pool and
19cannot be changed once set. Each file system has its own set of MDS daemons
20assigned to ranks so ensure that you have sufficient standby daemons available
21to accommodate the new file system.
22
7c673cae
FG
23::
24
25 fs ls
26
11fdf7f2
TL
27List all file systems by name.
28
7c673cae
FG
29::
30
11fdf7f2
TL
31 fs dump [epoch]
32
33This dumps the FSMap at the given epoch (default: current) which includes all
34file system settings, MDS daemons and the ranks they hold, and the list of
35standby MDS daemons.
36
7c673cae
FG
37
38::
39
11fdf7f2
TL
40 fs rm <filesystem name> [--yes-i-really-mean-it]
41
42Destroy a CephFS file system. This wipes information about the state of the
43file system from the FSMap. The metadata pool and data pools are untouched and
44must be destroyed separately.
7c673cae
FG
45
46::
47
48 fs get <filesystem name>
49
11fdf7f2
TL
50Get information about the named file system, including settings and ranks. This
51is a subset of the same information from the ``fs dump`` command.
52
7c673cae
FG
53::
54
55 fs set <filesystem name> <var> <val>
56
11fdf7f2
TL
57Change a setting on a file system. These settings are specific to the named
58file system and do not affect other file systems.
59
7c673cae
FG
60::
61
62 fs add_data_pool <filesystem name> <pool name/id>
63
11fdf7f2
TL
64Add a data pool to the file system. This pool can be used for file layouts
65as an alternate location to store file data.
66
7c673cae
FG
67::
68
69 fs rm_data_pool <filesystem name> <pool name/id>
70
11fdf7f2
TL
71This command removes the specified pool from the list of data pools for the
72file system. If any files have layouts for the removed data pool, the file
73data will become unavailable. The default data pool (when creating the file
74system) cannot be removed.
75
7c673cae 76
31f18b77
FG
77Settings
78--------
79
80::
81
82 fs set <fs name> max_file_size <size in bytes>
83
84CephFS has a configurable maximum file size, and it's 1TB by default.
85You may wish to set this limit higher if you expect to store large files
86in CephFS. It is a 64-bit field.
87
88Setting ``max_file_size`` to 0 does not disable the limit. It would
89simply limit clients to only creating empty files.
90
91
92Maximum file sizes and performance
93----------------------------------
94
95CephFS enforces the maximum file size limit at the point of appending to
96files or setting their size. It does not affect how anything is stored.
97
98When users create a file of an enormous size (without necessarily
99writing any data to it), some operations (such as deletes) cause the MDS
100to have to do a large number of operations to check if any of the RADOS
101objects within the range that could exist (according to the file size)
102really existed.
103
104The ``max_file_size`` setting prevents users from creating files that
105appear to be eg. exabytes in size, causing load on the MDS as it tries
106to enumerate the objects during operations like stats or deletes.
107
108
28e407b8
AA
109Taking the cluster down
110-----------------------
111
11fdf7f2
TL
112Taking a CephFS cluster down is done by setting the down flag:
113
114::
115
116 fs set <fs_name> down true
117
118To bring the cluster back online:
119
120::
121
122 fs set <fs_name> down false
123
124This will also restore the previous value of max_mds. MDS daemons are brought
125down in a way such that journals are flushed to the metadata pool and all
126client I/O is stopped.
127
128
129Taking the cluster down rapidly for deletion or disaster recovery
130-----------------------------------------------------------------
131
132To allow rapidly deleting a file system (for testing) or to quickly bring the
133file system and MDS daemons down, use the ``fs fail`` command:
134
135::
136
137 fs fail <fs_name>
138
139This command sets a file system flag to prevent standbys from
140activating on the file system (the ``joinable`` flag).
141
142This process can also be done manually by doing the following:
143
144::
145
146 fs set <fs_name> joinable false
147
148Then the operator can fail all of the ranks which causes the MDS daemons to
149respawn as standbys. The file system will be left in a degraded state.
150
151::
152
153 # For all ranks, 0-N:
154 mds fail <fs_name>:<n>
155
156Once all ranks are inactive, the file system may also be deleted or left in
157this state for other purposes (perhaps disaster recovery).
158
159To bring the cluster back up, simply set the joinable flag:
28e407b8
AA
160
161::
28e407b8 162
11fdf7f2
TL
163 fs set <fs_name> joinable true
164
28e407b8 165
7c673cae
FG
166Daemons
167-------
168
11fdf7f2
TL
169Most commands manipulating MDSs take a ``<role>`` argument which can take one
170of three forms:
171
172::
173
174 <fs_name>:<rank>
175 <fs_id>:<rank>
176 <rank>
177
178Commands to manipulate MDS daemons:
7c673cae
FG
179
180::
181
224ce89b 182 mds fail <gid/name/role>
7c673cae 183
224ce89b
WB
184Mark an MDS daemon as failed. This is equivalent to what the cluster
185would do if an MDS daemon had failed to send a message to the mon
186for ``mds_beacon_grace`` second. If the daemon was active and a suitable
187standby is available, using ``mds fail`` will force a failover to the standby.
188
189If the MDS daemon was in reality still running, then using ``mds fail``
190will cause the daemon to restart. If it was active and a standby was
191available, then the "failed" daemon will return as a standby.
7c673cae 192
c07f9fc5
FG
193
194::
195
11fdf7f2 196 tell mds.<daemon name> command ...
224ce89b 197
11fdf7f2
TL
198Send a command to the MDS daemon(s). Use ``mds.*`` to send a command to all
199daemons. Use ``ceph tell mds.* help`` to learn available commands.
7c673cae
FG
200
201::
202
203 mds metadata <gid/name/role>
204
11fdf7f2
TL
205Get metadata about the given MDS known to the Monitors.
206
7c673cae
FG
207::
208
209 mds repaired <role>
210
11fdf7f2
TL
211Mark the file system rank as repaired. Unlike the name suggests, this command
212does not change a MDS; it manipulates the file system rank which has been
213marked damaged.
214
7c673cae 215
81eedcae
TL
216Minimum Client Version
217----------------------
218
219It is sometimes desirable to set the minimum version of Ceph that a client must be
220running to connect to a CephFS cluster. Older clients may sometimes still be
221running with bugs that can cause locking issues between clients (due to
222capability release). CephFS provides a mechanism to set the minimum
223client version:
224
225::
226
227 fs set <fs name> min_compat_client <release>
228
229For example, to only allow Nautilus clients, use:
230
231::
232
233 fs set cephfs min_compat_client nautilus
234
235Clients running an older version will be automatically evicted.
236
237
7c673cae
FG
238Global settings
239---------------
240
7c673cae
FG
241
242::
243
244 fs flag set <flag name> <flag val> [<confirmation string>]
245
11fdf7f2
TL
246Sets a global CephFS flag (i.e. not specific to a particular file system).
247Currently, the only flag setting is 'enable_multiple' which allows having
248multiple CephFS file systems.
7c673cae
FG
249
250Some flags require you to confirm your intentions with "--yes-i-really-mean-it"
251or a similar string they will prompt you with. Consider these actions carefully
252before proceeding; they are placed on especially dangerous activities.
253
254
255Advanced
256--------
257
258These commands are not required in normal operation, and exist
259for use in exceptional circumstances. Incorrect use of these
260commands may cause serious problems, such as an inaccessible
261filesystem.
262
263::
264
265 mds compat rm_compat
266
11fdf7f2
TL
267Removes an compatibility feature flag.
268
7c673cae
FG
269::
270
271 mds compat rm_incompat
272
11fdf7f2 273Removes an incompatibility feature flag.
7c673cae
FG
274
275::
276
11fdf7f2 277 mds compat show
7c673cae 278
11fdf7f2 279Show MDS compatibility flags.
7c673cae
FG
280
281::
282
283 mds rmfailed
284
11fdf7f2 285This removes a rank from the failed set.
31f18b77 286
7c673cae
FG
287::
288
11fdf7f2 289 fs reset <filesystem name>
7c673cae 290
11fdf7f2
TL
291This command resets the file system state to defaults, except for the name and
292pools. Non-zero ranks are saved in the stopped set.