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