]> git.proxmox.com Git - ceph.git/blame - ceph/doc/cephfs/administration.rst
update sources to ceph Nautilus 14.2.1
[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
FG
215
216Global settings
217---------------
218
7c673cae
FG
219
220::
221
222 fs flag set <flag name> <flag val> [<confirmation string>]
223
11fdf7f2
TL
224Sets a global CephFS flag (i.e. not specific to a particular file system).
225Currently, the only flag setting is 'enable_multiple' which allows having
226multiple CephFS file systems.
7c673cae
FG
227
228Some flags require you to confirm your intentions with "--yes-i-really-mean-it"
229or a similar string they will prompt you with. Consider these actions carefully
230before proceeding; they are placed on especially dangerous activities.
231
232
233Advanced
234--------
235
236These commands are not required in normal operation, and exist
237for use in exceptional circumstances. Incorrect use of these
238commands may cause serious problems, such as an inaccessible
239filesystem.
240
241::
242
243 mds compat rm_compat
244
11fdf7f2
TL
245Removes an compatibility feature flag.
246
7c673cae
FG
247::
248
249 mds compat rm_incompat
250
11fdf7f2 251Removes an incompatibility feature flag.
7c673cae
FG
252
253::
254
11fdf7f2 255 mds compat show
7c673cae 256
11fdf7f2 257Show MDS compatibility flags.
7c673cae
FG
258
259::
260
261 mds rmfailed
262
11fdf7f2 263This removes a rank from the failed set.
31f18b77 264
7c673cae
FG
265::
266
11fdf7f2 267 fs reset <filesystem name>
7c673cae 268
11fdf7f2
TL
269This command resets the file system state to defaults, except for the name and
270pools. Non-zero ranks are saved in the stopped set.