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