Whamcloud - gitweb
b=20744 add changelog entry
[fs/lustre-release.git] / lustre / doc / lctl.8
index 1e112dd..53ea4ee 100644 (file)
@@ -7,301 +7,339 @@ lctl \- Low level Lustre filesystem configuration utility
 .br
 .B lctl --device <devno> <command [args]>
 .br
 .br
 .B lctl --device <devno> <command [args]>
 .br
-.B lctl --threads <numthreads> <verbose> <devno> <command [args]>
-.br
 .SH DESCRIPTION
 .B lctl
 .SH DESCRIPTION
 .B lctl
-can be invoked in interactive mode by issuing lctl command. After that, commands are issued as below. The most common commands in lctl are (in matching pairs) 
+is used to directly control Lustre via an ioctl interface, allowing
+various configuration, maintenance, and debugging features to be accessed.
+.B lctl
+can be invoked in interactive mode by issuing lctl command. After that, commands are issued as below. The most common commands in lctl are
+.B dl
+,
+.B dk
+,
 .B device 
 .B device 
-and 
-.B attach
-, 
-.B detach 
-and 
-.B setup
 ,
 ,
-.B cleanup 
-and
-.B connect
+.B network 
+.I <up/down>
+,
+.B list_nids
+,
+.B ping
+.I nid
 ,
 ,
-.B disconnect 
-and
 .B help
 .B help
-, and
+,
 .B quit.
 
 .B quit.
 
-To get a complete listing of available commands, type help at the lctl prompt.  To get basic help on the meaning and syntax of a command, type help command.  Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys. 
+To get a complete listing of available commands, type
+.B help
+at the lctl prompt.  To get basic help on the meaning and syntax of a
+command, type 
+.B help 
+.I command
+.  Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys. 
 
 
-For non-interactive single-threaded use, one uses the second invocation, which runs command after connecting to the device. 
+For non-interactive use, one uses the second invocation, which runs command after connecting to the device. 
 
 
-.B Network Configuration
-.TP 
-network <tcp/elans/myrinet> 
-Indicate what kind of network applies for the configuration commands that follow.
-.TP 
-connect [[<hostname> <port>] | <elan id>] 
-This will establish a connection to a remote network network id given by the hostname/port combination, or the elan id.
-.TP 
-disconnect <nid> 
-Disconnect from a remote nid.
-.TP 
-mynid [nid] 
-Informs the socknal of the local nid. It defaults to hostname for tcp networks and is automatically setup for elan/myrinet networks.
-.TP 
-add_uuid <uuid> <nid> 
-Associate a given UUID with an nid.
-.TP 
-close_uuid <uuid> 
-Disconnect a UUID.
-.TP 
-del_uuid <uuid> 
-Delete a UUID association.
-.TP 
-add_route <gateway> <target> [target] 
-Add an entry to the routing table for the given target.
-.TP 
-del_route <target> 
-Delete an entry for the target from the routing table.
+.SS Network Configuration
+.TP
+.BI network " <up/down>|<tcp/elan/myrinet>"
+Start or stop LNET, or select a network type for other
+.I lctl
+LNET commands
+.TP
+.BI list_nids
+Print all Network Identifiers on the local node. LNET must be running.
+.TP
+.BI which_nid " <nidlist>"
+From a list of nids for a remote node, show which interface communication
+will take place on.
+.TP
+.BI ping " <nid> "
+Check LNET connectivity via an LNET ping. This will use the fabric
+appropriate to the specified NID.
+.TP
+.BI interface_list 
+Print the network interface information for a given 
+.B network
+type.
+.TP
+.BI peer_list 
+Print the known peers for a given 
+.B network
+type.
+.TP
+.BI conn_list 
+Print all the connected remote NIDs for a given
+.B network
+type.
+.TP
+.BI active_tx 
+This command should print active transmits, and it is only used for elan network type.
 .TP 
 .TP 
-route_list 
+.BI route_list 
 Print the complete routing table.
 Print the complete routing table.
-.TP 
-recv_mem [size] 
-Set the socket receive buffer size; if the size is omitted, the default size for the buffer is printed.
-.TP 
-send_mem [size] 
-Set send buffer size for the socket; if size is omitted, the default size for the buffer is printed.
-.TP 
-nagle [on/off] 
-Enable/disable nagle; omitting the argument will cause the default value to be printed.
-.TP 
-fail nid|all [count] 
-Fail/restore communications. Ommiting tha count implies fail indefinitely, count of zero indicates that communication should be restored. A non-zero count indicates the number of portals messages to be dropped after which the communication is restored.
 .PP
 .PP
-.B Device Selection
-.TP 
-newdev 
-Create a new device.
+.SS Device Selection
 .TP 
 .TP 
-name2dev 
-This command can be used to determine a device number for the given device name.
-.TP 
-device 
+.BI device " <devname> " 
 This will select the specified OBD device.  All other commands depend on the device being set. 
 .TP 
 This will select the specified OBD device.  All other commands depend on the device being set. 
 .TP 
-device_list 
-Show all the devices.
-.TP 
-lustre_build_version 
-Print the Lustre build version.
+.BI device_list 
+Show all the local Lustre OBDs. AKA 
+.B dl
 .PP
 .PP
-.B Device Configuration
-.TP 
-attach type [name [uuid]] 
-Attach a type to the current device (which you need to set using the device command) and give that device a name and UUID.  This allows us to identify the device for use later, and also tells us what type of device we will have.
+.SS Device Operations
 .TP 
 .TP 
-setup <args...> 
-Type specific device setup commands. For obdfilter, a setup command tells the driver which block device it should use for storage and what type of filesystem is on that device. 
-.TP 
-cleanup 
-Cleanup a previously setup device.
+.BI list_param " [-F|-R] <param_path ...>"
+List the Lustre or LNet parameter name
+.br
+.B -F
+Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
+.br
+.B -R
+Recursively list all parameters under the specified path. If
+.I param_path 
+is unspecified, all the parameters will be shown.
+.br
+.B Examples:
+.br
+.B
+# lctl list_param ost.*
+.br
+  ost.OSS
+.br
+  ost.num_refs
+.br
+.B
+# lctl list_param -F ost.* debug
+.br
+  ost.OSS/
+.br
+  ost.num_refs
+.br
+  debug=
+.br
+.B     
+# lctl list_param -R mdt
+.br
+  mdt
+.br
+  mdt.lustre-MDT0000
+.br
+  mdt.lustre-MDT0000.capa
+.br
+  mdt.lustre-MDT0000.capa_count
+.br
+  mdt.lustre-MDT0000.capa_key_timeout
+.br
+  mdt.lustre-MDT0000.capa_timeout
+.br
+  mdt.lustre-MDT0000.commit_on_sharing
+.br
+  mdt.lustre-MDT0000.evict_client
+.br
+  ...
+.TP
+.BI get_param " [-n|-N|-F] <param_path ...>"
+Get the value of Lustre or LNET parameter from the specified path.
+.br
+.B -n
+Print only the value and not parameter name.
+.br
+.B -N
+Print only matched parameter names and not the values. (Especially useful when using patterns.)
+.br
+.B -F
+When -N specified, add '/', '@' or '=' for directories, symlinks and writeable files, respectively.
+.br
+.B Examples:
+.br
+.B
+# lctl get_param ost.*
+.br
+  ost.OSS
+.br
+  ost.num_refs
+.br
+.B
+# lctl get_param -n debug timeout
+.br
+  super warning dlmtrace error emerg ha rpctrace vfstrace config console
+.br
+  20
+.br
+.B
+# lctl get_param -N ost.* debug
+.br
+  ost.OSS
+.br
+  ost.num_refs
+.br
+  debug
+.br
+lctl "get_param -NF" is equivalent to "list_param -F".
+.TP
+.BI set_param " [-n] <param_path=value ...>"
+Set the value of Lustre or LNET parameter from the specified path.
+.br
+.B -n
+Disable printing of the key name when printing values.
+.br
+.B Examples:
+.br
+.B
+# lctl set_param fail_loc=0 timeout=20
+.br
+  fail_loc=0
+.br
+  timeout=20
+.br
+.B
+# lctl set_param -n fail_loc=0 timeout=20
+.br
+  0
+.br
+  20
+.TP
+.BI conf_param " [-d] <device|fsname>.<parameter>=<value>"
+Set a permanent configuration parameter for any device via the MGS.  This
+command must be run on the MGS node.
+.br
+.B -d <device|fsname>.<parameter>
+Delete a parameter setting (use the default value at the next restart).  A null value for <value> also deletes the parameter setting.
+.br
+.B Parameters:
+.br
+All of the writable parameters under 
+.B lctl list_param
+(e.g. 
+.I lctl list_param -F osc.*.* | grep =
+) can be permanently set using
+.B lctl conf_param
+, but the format is slightly different.  For conf_param, the device is specified first, then the obdtype. (See examples below.)  Wildcards are not supported.
+.br
+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.
+.br
+.B Examples:
+.br 
+# lctl conf_param testfs.sys.at_max=1200
+.br
+# lctl conf_param testfs.llite.max_read_ahead_mb=16 
+.br
+# lctl conf_param testfs-MDT0000.lov.stripesize=2M
+.br
+# lctl conf_param lustre-OST0001.osc.active=0 
+.br
+# lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15 
+.br
+# lctl conf_param testfs-OST0000.ost.client_cache_seconds=15 
+.br
+# lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
 .TP 
 .TP 
-detach 
-Remove driver (and name and UUID) from the current device.
+.BI activate 
+Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see 
+.B conf_param
+).
 .TP 
 .TP 
-lov_setconfig lov-uuid stripe-count default-stripe-size offset pattern UUID1 [UUID2...] 
-Write LOV configuration to an MDS device.
+.BI deactivate 
+Deactivate an import, in particular meaning do not assign new file stripes
+to an OSC.  This command should be used on the OSC in the MDT LOV
+corresponding to a failed OST device, to prevent further attempts at
+communication with the failed OST.
 .TP 
 .TP 
-lov_getconfig lov-uuid 
-Read LOV configuration from an MDS device. Returns default-stripe-count, default-stripe-size, offset, pattern, and a list of OST UUID's.
+.BI abort_recovery 
+Abort the recovery process on a restarting MDT or OST device
 .PP
 .PP
-.B Device Operations
-.TP 
-probe [timeout] 
-Build a connection handle to a device. This command is used to suspend configuration until the lctl command has ensured that the MDS and OSC services are available. This is to avoid mount failures in a rebooting cluster.
-.TP 
-close 
-Close the connection handle
-.TP 
-getattr <objid> 
-Get attributes for an OST object <objid> .
-.TP 
-setattr <objid> <mode> 
-Set mode attribute for OST object <objid>.
-.TP 
-create [num [mode [verbose]]] 
-Create the specified number <num> of OST objects with the given <mode>.
-.TP 
-destroy <num> 
-Starting at <objid>, destroy <num> number of objects starting from the object with object id <objid>.
-.TP 
-test_getattr <num> [verbose [[t]objid]] 
-Do <num> getattrs on OST object <objid> (objectid+1 on each thread).
-.TP 
-test_brw [t]<num> [write [verbose [npages [[t]objid]]]] 
-Do <num> bulk read/writes on OST object <objid> (<npages> per I/O).
-.TP 
-test_ldlm 
-Perform lock manager test.
-.TP 
-ldlm_regress_start %s [numthreads [refheld [numres [numext]]]] 
-Start lock manager stress test.
-.TP 
-ldlm_regress_stop 
-Stop lock manager stress test.
-.TP 
-dump_ldlm 
-Dump all lock manager state, this is very useful for debugging
-.TP 
-activate 
-Activate an import
-.TP 
-deacttivate 
-De-activate an import
-.TP 
-recover <connection UUID> 
-.TP 
-lookup <directory> <file>
-.TP 
-notransno 
-Disable sending of committed transnumber updates
-.TP 
-readonly 
-Disable writes to the underlying device
-.TP 
-abort_recovery 
-Abort recovery on MDS device
-.TP 
-mount_option 
-Dump mount options to a file
-.TP 
-get_stripe 
-Show stripe info for an echo client object.
-.TP 
-set_stripe <objid>[ width!count[@offset] [:id:id....] 
-Set stripe info for an echo client
-.TP 
-unset_stripe <objid> 
-Unset stripe info for an echo client object.
+.SS Virtual Block Device Operation
+Lustre is able to emulate a virtual block device upon regular file. It is necessary to be used when you are trying to setup a swap space via file.
+.TP
+.BI blockdev_attach " <file name> <device node>"
+Attach the lustre regular file to a block device. If the device node is not existent, lctl will create it \- it is recommended to create it by lctl since the emulator uses a dynamical major number.
+.TP
+.BI blockdev_detach " <device node>"
+Detach the virtual block device.
+.TP
+.BI blockdev_info " <device node>"
+Acquire which lustre file was attached to the device node.
+.PP
+.SS Changelogs
+.TP
+.BI changelog_register
+Register a new changelog user for a particular device.  Changelog entries
+will not be purged beyond any registered users' set point. (See lfs changelog_clear.)
+.TP
+.BI changelog_deregister " <id>"
+Unregister an existing changelog user.  If the user's "clear" record number
+is the minimum for the device, changelog records will be purged until the
+next minimum.  
 .PP
 .PP
-.B Debug
+.SS Debug
 .TP 
 .TP 
-debug_daemon 
-Debug daemon control and dump to a file
+.BI debug_daemon 
+Start and stop the debug daemon, and control the output filename and size.
 .TP 
 .TP 
-debug_kernel [file] [raw] 
-Get debug buffer and dump to a fileusage.
+.BI debug_kernel " [file] [raw]" 
+Dump the kernel debug buffer to stdout or file.
 .TP 
 .TP 
-debug_file <input> [output] [raw] 
-Read debug buffer from input and dump to outputusage.
+.BI debug_file " <input> [output]"
+Convert kernel-dumped debug log from binary to plain text format.
 .TP 
 .TP 
-clear 
-Clear kernel debug buffer.
+.BI clear 
+Clear the kernel debug buffer.
 .TP 
 .TP 
-mark <text> 
-Insert marker text in kernel debug buffer.
+.BI mark " <text>" 
+Insert marker text in the kernel debug buffer.
 .TP 
 .TP 
-filter <subsystem id/debug mask> 
-Filter message type from the kernel debug buffer.
+.BI filter " <subsystem id/debug mask>" 
+Filter kernel debug messages by subsystem or mask.
 .TP 
 .TP 
-show <subsystem id/debug mask> 
+.BI show " <subsystem id/debug mask>" 
 Show specific type of messages.
 .TP 
 Show specific type of messages.
 .TP 
-debug_list <subs/types> 
+.BI debug_list " <subs/types>" 
 List all the subsystem and debug types.
 List all the subsystem and debug types.
-.TP 
-panic 
-Force the kernel to panic.
-.PP
-.B Control
-.TP 
-help 
-Show a complete list of commands; help <command name> can be used to get help on specific command.
-.TP 
-exit 
-Close the lctl session.
-.TP 
-quit 
-Close the lctl session.
+.TP
+.BI modules " <path>" 
+Provide gdb-friendly module information.
 
 .SH OPTIONS
 The following options can be used to invoke lctl. 
 .TP
 .B --device 
 
 .SH OPTIONS
 The following options can be used to invoke lctl. 
 .TP
 .B --device 
-The device number to be used for the operation. The value of devno is an integer, normally found by calling lctl name2dev on a device name. 
-.TP
-.B --threads 
-How many threads should be forked doing the command specified. The numthreads variable is a strictly positive integer indicating how many threads should be started. The devno option is used as above.
+The device to be used for the operation. This can be specified by name or
+number. See 
+.B device_list
 .TP
 .B --ignore_errors | ignore_errors 
 Ignore errors during script processing
 .TP
 .B --ignore_errors | ignore_errors 
 Ignore errors during script processing
-.TP
-.B dump 
-Save ioctls to a file 
-.SH EXAMPLES
-.B attach
 
 
+.SH EXAMPLES
 # lctl
 .br
 # lctl
 .br
-lctl > newdev
-.br
-lctl > attach obdfilter OBDDEV OBDUUID
-
-.B connect
-
-lctl > name2dev OSCDEV 2 
-.br
-lctl > device 2
-.br
-lctl > connect
-
-.B getattr
-
-lctl > getattr 12
-.br
-id: 12
-.br
-grp: 0
-.br
-atime: 1002663714
+lctl > dl
+  0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
+  1 UP ost OSS OSS_uuid 3
+  2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
 .br
 .br
-mtime: 1002663535
-.br
-ctime: 1002663535
-.br
-size: 10
-.br
-blocks: 8
-.br
-blksize: 4096
-.br
-mode: 100644
-.br
-uid: 0
-.br
-gid: 0
-.br
-flags: 0
-.br
-obdflags: 0
-.br
-nlink: 1
-.br
-valid: ffffffff
-.br
-inline:
-.br
-obdmd:
-.br
-lctl > disconnect 
-.br
-Finished (success)
-
-.B setup 
-
-lctl > setup /dev/loop0 extN
+lctl > dk /tmp/log
+Debug log: 87 lines, 87 kept, 0 dropped.
 .br
 lctl > quit
 
 .SH BUGS
 .br
 lctl > quit
 
 .SH BUGS
-None are known.
+Please report all bugs to Sun Microsystems, Inc. http://bugzilla.lustre.org/
+.SH AVAILABILITY
+.B lctl
+is part of the 
+.BR Lustre (7) 
+filesystem package and is available from Sun Microsystems, Inc.
+.br
+http://www.sun.com/software/products/lustre/index.xml
+.SH SEE ALSO
+.BR Lustre (7),
+.BR mkfs.lustre (8),
+.BR mount.lustre (8),
+.BR lctl (8),
+.BR lfs (1)