Whamcloud - gitweb
0ade6ff14cae3c1c76c32bc86b38904bfc6ae245
[fs/lustre-release.git] / lustre / doc / lctl.8
1 .TH lctl 1 "2016 Sep 8" Lustre "configuration utilities"
2 .SH NAME
3 lctl \- Low level Lustre filesystem configuration utility
4 .SH SYNOPSIS
5 .br
6 .B lctl
7 .br
8 .B lctl --device <devno> <command [args]>
9 .br
10 .SH DESCRIPTION
11 .B lctl
12 is used to directly control Lustre via an ioctl interface, allowing
13 various configuration, maintenance, and debugging features to be accessed.
14
15 .B lctl
16 can be invoked in interactive mode by issuing lctl command. After that, commands are issued as below. The most common commands in lctl are
17 .BR dl ,
18 .BR dk ,
19 .BR device ,
20 .B network
21 .IR <up/down> ,
22 .BR list_nids ,
23 .B ping
24 .IR nid ,
25 .BR help ,
26 .BR quit .
27
28 To get a complete listing of available commands, type
29 .B help
30 at the lctl prompt.  To get basic help on the meaning and syntax of a
31 command, type
32 .B help
33 .I command
34 .  Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys.
35
36 For non-interactive use, one uses the second invocation, which runs command after connecting to the device.
37
38 .SS Network Configuration
39 .TP
40 .BR network " <" up / down >|< tcp / o2ib >
41 Start or stop LNET, or select a network type for other
42 .I lctl
43 LNET commands
44 .TP
45 .BI list_nids
46 Print all Network Identifiers on the local node. LNET must be running.
47 .TP
48 .BI which_nid " <nidlist>"
49 From a list of nids for a remote node, show which interface communication
50 will take place on.
51 .TP
52 .BI replace_nids " <devicename> <nid1>[,nid2,nid3 ...]"
53 Replace the LNET Network Identifiers for a given device,
54 as when the server's IP address has changed.
55 This command must be run on the MGS node.
56 Only MGS server should be started (command execution returns error
57 in another cases). To start the MGS service only:
58 mount -t lustre <MDT partition> -o nosvc <mount point>
59 Note the replace_nids command skips any invalidated records in the configuration log.
60 The previous log is backed up with the suffix '.bak'.
61 .TP
62 .BI ping " <nid> timeout"
63 Check LNET connectivity via an LNET ping. This will use the fabric
64 appropriate to the specified NID. By default lctl will attempt to
65 reach the remote node up to 120 seconds and then timeout. To disable
66 the timeout just specify an negative timeout value.
67 .TP
68 .BI interface_list
69 Print the network interface information for a given
70 .B network
71 type.
72 .TP
73 .BI peer_list
74 Print the known peers for a given
75 .B network
76 type.
77 .TP
78 .BI conn_list
79 Print all the connected remote NIDs for a given
80 .B network
81 type.
82 .TP
83 .BI route_list
84 Print the complete routing table.
85 .PP
86 .SS Device Selection
87 .TP
88 .BI device " <devname> "
89 This will select the specified OBD device.  All other commands depend on the device being set.
90 .TP
91 .BI device_list
92 Show all the local Lustre OBDs. AKA
93 .B dl
94 .PP
95 .SS Device Operations
96 .TP
97 .BI list_param " [-F|-R] <param_search ...>"
98 List the Lustre or LNet parameter name
99 .B -F
100 Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
101 .br
102 .B -R
103 Recursively list all parameters under the specified parameter search string. If
104 .I param_search
105 is unspecified, all the parameters will be shown.
106 .br
107 .B Examples:
108 .br
109 .B
110 # lctl list_param ost.*
111 .br
112   ost.OSS
113 .br
114   ost.num_refs
115 .br
116 .B
117 # lctl list_param -F ost.* debug
118 .br
119   ost.OSS/
120 .br
121   ost.num_refs
122 .br
123   debug=
124 .br
125 .B
126 # lctl list_param -R mdt
127 .br
128   mdt
129 .br
130   mdt.lustre-MDT0000
131 .br
132   mdt.lustre-MDT0000.capa
133 .br
134   mdt.lustre-MDT0000.capa_count
135 .br
136   mdt.lustre-MDT0000.capa_key_timeout
137 .br
138   mdt.lustre-MDT0000.capa_timeout
139 .br
140   mdt.lustre-MDT0000.commit_on_sharing
141 .br
142   mdt.lustre-MDT0000.evict_client
143 .br
144   ...
145 .TP
146 .BI get_param " [-F|-n|-N|-R] <parameter ...>"
147 Get the value of Lustre or LNET parameter.
148 .br
149 .B -F
150 When -N specified, add '/', '@' or '=' for directories, symlinks and writeable files, respectively.
151 .br
152 .br
153 .B -n
154 Print only the value and not parameter name.
155 .br
156 .B -N
157 Print only matched parameter names and not the values. (Especially useful when using patterns.)
158 .br
159 .B -R
160 Print all of the parameter names below the specified name.
161 .br
162 .B Examples:
163 .br
164 .B
165 # lctl get_param ost.*
166 .br
167   ost.OSS
168 .br
169   ost.num_refs
170 .br
171 .B
172 # lctl get_param -n debug timeout
173 .br
174   super warning dlmtrace error emerg ha rpctrace vfstrace config console
175 .br
176   20
177 .br
178 .B
179 # lctl get_param -N ost.* debug
180 .br
181   ost.OSS
182 .br
183   ost.num_refs
184 .br
185   debug
186 .br
187 lctl "get_param -NF" is equivalent to "list_param -F".
188 .TP
189 .BI set_param " [-n] [-P] [-d] <parameter=value ...>"
190 Set the value of Lustre or LNET parameter.
191 .br
192 .B -n
193 Disable printing of the key name when printing values.
194 .br
195 .B -P
196 Set the parameter permanently, filesystem-wide.
197 This parameters are only visible to 2.5.0 and later clients, older clients will not see these parameters.
198 .br
199 .B -d
200 Remove the permanent setting (only with -P option)
201 .br
202 .B Examples:
203 .br
204 .B
205 # lctl set_param fail_loc=0 timeout=20
206 .br
207   fail_loc=0
208 .br
209   timeout=20
210 .br
211 .B
212 # lctl set_param -n fail_loc=0 timeout=20
213 .br
214   0
215 .br
216   20
217 .br
218 .B
219 # lctl set_param -P osc.*.max_dirty_mb=32
220 .br
221 .TP
222 .BI conf_param " [-d] <device|fsname>.<parameter>=<value>"
223 Set a permanent configuration parameter for any device via the MGS.  This
224 command must be run on the MGS node.
225 .br
226 .B -d <device|fsname>.<parameter>
227 Delete a parameter setting (use the default value at the next restart).  A null value for <value> also deletes the parameter setting.
228 .br
229 .B Parameters:
230 .br
231 All of the writable parameters under
232 .B lctl list_param
233 (e.g.
234 .I lctl list_param -F osc.*.* | grep =
235 ) can be permanently set using
236 .B lctl conf_param
237 , but the format is slightly different.  For conf_param, the device is specified first, then the obdtype. (See examples below.)  Wildcards are not supported.
238 .br
239 Additionally, failover nodes may be added (or removed), and some system-wide parameters may be set as well (sys.at_max, sys.at_min, sys.at_extra, sys.at_early_margin, sys.at_history, sys.timeout, sys.ldlm_timeout.)  <device> is ignored for system wide parameters.
240 .br
241 .B Examples:
242 .br
243 # lctl conf_param testfs.sys.at_max=1200
244 .br
245 # lctl conf_param testfs.llite.max_read_ahead_mb=16
246 .br
247 # lctl conf_param testfs-MDT0000.lov.stripesize=2M
248 .br
249 # lctl conf_param lustre-OST0001.osc.active=0
250 .br
251 # lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15
252 .br
253 # lctl conf_param testfs-OST0000.ost.client_cache_seconds=15
254 .br
255 # lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
256 .TP
257 .BI activate
258 Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see
259 .B conf_param
260 ).
261 .TP
262 .BI deactivate
263 Deactivate an import, in particular meaning do not assign new file stripes
264 to an OSC.  This command should be used on the OSC in the MDT LOV
265 corresponding to a failed OST device, to prevent further attempts at
266 communication with the failed OST.
267 .TP
268 .BI abort_recovery
269 Abort the recovery process on a restarting MDT or OST device
270 .PP
271 .SS Changelogs
272 .TP
273 .BI changelog_register " [-n]"
274 Register a new changelog user for a particular device.  Changelog entries
275 will not be purged beyond any registered users' set point. (See lfs changelog_clear.)
276 .br
277 .B -n
278 Print only the ID of the newly registered user.
279 .TP
280 .BI changelog_deregister " <id>"
281 Unregister an existing changelog user.  If the user's "clear" record number
282 is the minimum for the device, changelog records will be purged until the
283 next minimum.
284 .PP
285 .SS Nodemap
286 An identity mapping feature that facilitates mapping of client UIDs and GIDs to
287 local file system UIDs and GIDs, while maintaining POSIX ownership, permissions,
288 and quota.
289
290 While the nodemap feature is enabled, all client file system access is subject
291 to the nodemap identity mapping policy, which consists of the 'default' catchall
292 nodemap, and any user-defined nodemaps. The 'default' nodemap maps all client
293 identities to 99:99 (nobody:nobody). Administrators can define nodemaps for a
294 range of client NIDs which map identities, and these nodemaps can be flagged as
295  'trusted' so identities are accepted without translation, as well as flagged
296 as 'admin' meaning that root is not squashed for these nodes.
297
298 Note: In the current phase of implementation, to use the nodemap functionality
299 you only need to enable and define nodemaps on the MDS. The MDSes must also be
300 in a nodemap with the admin and trusted flags set. To use quotas with nodemaps,
301 you must also use set_param to enable and define nodemaps on the OSS (matching
302 what is defined on the MDS). Nodemaps do not currently persist, unless you
303 define them with set_param and use the -P flag. Note that there is a hard limit
304 to the number of changes you can persist over the lifetime of the file system.
305
306 See also:
307
308 .PP
309 \fBlctl-nodemap-activate\fR(8)
310 .RS 4
311 Activate/deactivate the nodemap feature.
312 .RE
313 .PP
314 \fBlctl-nodemap-add\fR(8)
315 .RS 4
316 Add a new nodemap, to which NID ranges, identities, and properties can be added.
317 .RE
318 .PP
319 \fBlctl-nodemap-del\fR(8)
320 .RS 4
321 Delete an existing nodemap.
322 .RE
323 .PP
324 \fBlctl-nodemap-add-range\fR(8)
325 .RS 4
326 Define a range of NIDs for a nodemap.
327 .RE
328 .PP
329 \fBlctl-nodemap-del-range\fR(8)
330 .RS 4
331 Delete an existing NID range from a nodemap.
332 .RE
333 .PP
334 \fBlctl-nodemap-add-idmap\fR(8)
335 .RS 4
336 Add a UID or GID mapping to a nodemap.
337 .RE
338 .PP
339 \fBlctl-nodemap-del-idmap\fR(8)
340 .RS 4
341 Delete an existing UID or GID mapping from a nodemap.
342 .RE
343 .PP
344 \fBlctl-nodemap-modify\fR(8)
345 .RS 4
346 Modify a nodemap property.
347 .RE
348
349 .SS LFSCK
350 An on-line Lustre consistency check and repair tool. It is used for totally
351 replacing the old lfsck tool for kinds of Lustre inconsistency verification,
352 including: corrupted or lost OI mapping, corrupted or lost link EA, corrupted
353 or lost FID in name entry, dangling name entry, multiple referenced name entry,
354 unmatched MDT-object and name entry pairs, orphan MDT-object, incorrect
355 MDT-object links count, corrupted namespace, corrupted or lost lov EA, lost
356 OST-object, multiple referenced OST-object, unmatched MDT-object and OST-object
357 pairs, orphan OST-object, and so on.
358
359 See also:
360
361 .PP
362 \fBlctl-lfsck-start\fR(8)
363 .RS 4
364 Start LFSCK on the specified MDT or OST device with specified parameters.
365 .RE
366 .PP
367 \fBlctl-lfsck-stop\fR(8)
368 .RS 4
369 Stop LFSCK on the specified MDT or OST device.
370 .RE
371 .PP
372 \fBlctl-lfsck-query\fR(8)
373 .RS 4
374 Get the LFSCK global status via the specified MDT device.
375 .RE
376 .SS Debug
377 .TP
378 .BI debug_daemon
379 Start and stop the debug daemon, and control the output filename and size.
380 .TP
381 .BI debug_kernel " [file] [raw]"
382 Dump the kernel debug buffer to stdout or file.
383 .TP
384 .BI debug_file " <input> [output]"
385 Convert kernel-dumped debug log from binary to plain text format.
386 .TP
387 .BI clear
388 Clear the kernel debug buffer.
389 .TP
390 .BI mark " <text>"
391 Insert marker text in the kernel debug buffer.
392 .TP
393 .BI filter " <subsystem id/debug mask>"
394 Filter kernel debug messages by subsystem or mask.
395 .TP
396 .BI show " <subsystem id/debug mask>"
397 Show specific type of messages.
398 .TP
399 .BI debug_list " <subs/types>"
400 List all the subsystem and debug types.
401 .TP
402 .BI modules " <path>"
403 Provide gdb-friendly module information.
404
405 .SH OPTIONS
406 The following options can be used to invoke lctl.
407 .TP
408 .B --device
409 The device to be used for the operation. This can be specified by name or
410 number. See
411 .B device_list
412 .TP
413 .B --ignore_errors | ignore_errors
414 Ignore errors during script processing
415 .TP
416 .B lustre_build_version
417 Output the build version of the Lustre kernel modules
418 .TP
419 .B --version
420 Output the build version of the lctl utility
421 .TP
422 .B help
423 Provides brief help on the various arguments
424 .TP
425 .B exit/quit
426 Quit the interactive lctl session
427
428 .SH EXAMPLES
429 # lctl
430 .br
431 lctl > dl
432   0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
433   1 UP ost OSS OSS_uuid 3
434   2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
435 .br
436 lctl > dk /tmp/log
437 Debug log: 87 lines, 87 kept, 0 dropped.
438 .br
439 lctl > quit
440
441 .SH AVAILABILITY
442 .B lctl
443 is part of the
444 .BR Lustre (7)
445 filesystem package.
446 .SH SEE ALSO
447 .BR lustre (7),
448 .BR mkfs.lustre (8),
449 .BR mount.lustre (8),
450 .BR lctl (8),
451 .BR lctl-lfsck-start (8),
452 .BR lctl-lfsck-stop (8),
453 .BR lctl-lfsck-query (8),
454 .BR lctl-network (8),
455 .BR lctl-nodemap-activate (8),
456 .BR lctl-nodemap-add-idmap (8),
457 .BR lctl-nodemap-add-range (8),
458 .BR lctl-nodemap-add (8),
459 .BR lctl-nodemap-del-idmap (8),
460 .BR lctl-nodemap-del-range (8),
461 .BR lctl-nodemap-del (8),
462 .BR lctl-nodemap-modify (8),
463 .BR lfs (1)