1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter version="5.0" xml:lang="en-US" xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" xml:id='lustremonitoring'>
4 <title xml:id='lustremonitoring.title'>Lustre Monitoring</title>
6 <para>This chapter provides information on monitoring Lustre and includes the following sections:</para>
8 <itemizedlist><listitem>
9 <para><xref linkend='dbdoclet.50438273_18711'/>Lustre Changelogs</para>
12 <para><xref linkend="dbdoclet.50438273_81684"/>Lustre Monitoring Tool</para>
15 <para><xref linkend="dbdoclet.50438273_80593"/>CollectL</para>
18 <para><xref linkend="dbdoclet.50438273_44185"/>Other Monitoring Options</para>
22 <section xml:id="dbdoclet.50438273_18711">
23 <title>12.1 Lustre <anchor xml:id="dbdoclet.50438273_marker-1297383" xreflabel=""/>Changelogs</title>
24 <para>The changelogs feature records events that change the file system namespace or file metadata. Changes such as file creation, deletion, renaming, attribute changes, etc. are recorded with the target and parent file identifiers (FIDs), the name of the target, and a timestamp. These records can be used for a variety of purposes:</para>
25 <itemizedlist><listitem>
26 <para> Capture recent changes to feed into an archiving system.</para>
29 <para> Use changelog entries to exactly replicate changes in a file system mirror.</para>
32 <para> Set up "watch scripts" that take action on certain events or directories.</para>
35 <para> Maintain a rough audit trail (file/directory changes with timestamps, but no user information).</para>
38 <para>Changelogs record types are:</para>
39 <informaltable frame="all">
41 <colspec colname="c1" colwidth="50*"/>
42 <colspec colname="c2" colwidth="50*"/>
45 <entry><para><emphasis role="bold">Value</emphasis></para></entry>
46 <entry><para><emphasis role="bold">Description</emphasis></para></entry>
51 <entry><para> MARK</para></entry>
52 <entry><para> Internal recordkeeping</para></entry>
55 <entry><para> CREAT</para></entry>
56 <entry><para> Regular file creation</para></entry>
59 <entry><para> MKDIR</para></entry>
60 <entry><para> Directory creation</para></entry>
63 <entry><para> HLINK</para></entry>
64 <entry><para> Hard link</para></entry>
67 <entry><para> SLINK</para></entry>
68 <entry><para> Soft link</para></entry>
71 <entry><para> MKNOD</para></entry>
72 <entry><para> Other file creation</para></entry>
75 <entry><para> UNLNK</para></entry>
76 <entry><para> Regular file removal</para></entry>
79 <entry><para> RMDIR</para></entry>
80 <entry><para> Directory removal</para></entry>
83 <entry><para> RNMFM</para></entry>
84 <entry><para> Rename, original</para></entry>
87 <entry><para> RNMTO</para></entry>
88 <entry><para> Rename, final</para></entry>
91 <entry><para> IOCTL</para></entry>
92 <entry><para> ioctl on file or directory</para></entry>
95 <entry><para> TRUNC</para></entry>
96 <entry><para> Regular file truncated</para></entry>
99 <entry><para> SATTR</para></entry>
100 <entry><para> Attribute change</para></entry>
103 <entry><para> XATTR</para></entry>
104 <entry><para> Extended attribute change</para></entry>
107 <entry><para> UNKNW</para></entry>
108 <entry><para> Unknown operation</para></entry>
113 <para>FID-to-full-pathname and pathname-to-FID functions are also included to map target and parent FIDs into the file system namespace.</para>
115 <title>12.1.1 Working with Changelogs</title>
116 <para>Several commands are available to work with changelogs.</para>
118 <title>lctl changelog_register</title>
119 <para>Because changelog records take up space on the MDT, the system administration must register changelog users. The registrants specify which records they are "done with", and the system purges up to the greatest common record.</para>
120 <para>To register a new changelog user, run:</para>
121 <screen>lctl --device <mdt_device> changelog_register
123 <para>Changelog entries are not purged beyond a registered user's set point (see lfs changelog_clear).</para>
126 <title>lfs changelog</title>
127 <para>To display the metadata changes on an MDT (the changelog records), run:</para>
128 <screen>lfs changelog <MDT name> [startrec [endrec]]
130 <para>It is optional whether to specify the start and end records.</para>
131 <para>These are sample changelog records:</para>
132 <screen>2 02MKDIR 4298396676 0x0 t=[0x200000405:0x15f9:0x0] p=[0x13:0x15e5a7a3:0x0]\
134 3 01CREAT 4298402264 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
136 4 06UNLNK 4298404466 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
138 5 07RMDIR 4298405394 0x0 t=[0x200000405:0x15f9:0x0] p=[0x13:0x15e5a7a3:0x0]\
143 <title>lfs changelog_clear</title>
144 <para>To clear old changelog records for a specific user (records that the user no longer needs), run:</para>
145 <screen>lfs changelog_clear <MDT name> <user ID> <endrec>
147 <para>The changelog_clear command indicates that changelog records previous to <endrec> are no longer of interest to a particular user <user ID>, potentially allowing the MDT to free up disk space. An <endrec> value of 0 indicates the current last record. To run changelog_clear, the changelog user must be registered on the MDT node using lctl.</para>
148 <para>When all changelog users are done with records < X, the records are deleted.</para>
151 <title>lctl changelog_deregister</title>
152 <para>To deregister (unregister) a changelog user, run:</para>
153 <screen>lctl --device <mdt_device> changelog_deregister <user ID>
155 <para> Changelog_deregister cl1 effectively does a changelog_clear cl10 as it deregisters.</para>
159 <title>12.1.2 Changelog Examples</title>
160 <para>This section provides examples of different changelog commands.</para>
162 <title>Registering a Changelog User</title>
163 <para>To register a new changelog user for a device (lustre-MDT0000):</para>
164 <screen># lctl --device lustre-MDT0000 changelog_register
165 lustre-MDT0000: Registered changelog userid 'cl1'
169 <title>Displaying Changelog Records</title>
170 <para>To display changelog records on an MDT (lustre-MDT0000):</para>
171 <screen>$ lfs changelog lustre-MDT0000
172 1 00MARK 19:08:20.890432813 2010.03.24 0x0 t=[0x10001:0x0:0x0] p=[0:0x0:0x\
173 0] mdd_obd-lustre-MDT0000-0
174 2 02MKDIR 19:10:21.509659173 2010.03.24 0x0 t=[0x200000420:0x3:0x0] p=[0x61\
175 b4:0xca2c7dde:0x0] mydir
176 3 14SATTR 19:10:27.329356533 2010.03.24 0x0 t=[0x200000420:0x3:0x0]
177 4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
178 0000420:0x3:0x0] hosts
180 <para>Changelog records include this information:</para>
182 operation_type(numerical/text)
190 <para>Displayed in this format:</para>
191 <screen>rec# operation_type(numerical/text) timestamp datestamp flags t=target_FID \
192 p=parent_FID target_name
194 <para>For example:</para>
195 <screen>4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
196 0000420:0x3:0x0] hosts
200 <title>Clearing Changelog Records</title>
201 <para>To notify a device that a specific user (cl1) no longer needs records (up to and including 3):</para>
202 <screen>$ lfs changelog_clear lustre-MDT0000 cl1 3
204 <para>To confirm that the changelog_clear operation was successful, run lfs changelog; only records after id-3 are listed:</para>
205 <screen>$ lfs changelog lustre-MDT0000
206 4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
207 0000420:0x3:0x0] hosts
211 <title>Deregistering a Changelog User</title>
212 <para>To deregister a changelog user (cl1) for a specific device (lustre-MDT0000):</para>
213 <screen># lctl --device lustre-MDT0000 changelog_deregister cl1
214 lustre-MDT0000: Deregistered changelog user 'cl1'
216 <para>The deregistration operation clears all changelog records for the specified user (cli).</para>
217 <screen>$ lfs changelog lustre-MDT0000
218 5 00MARK 19:13:40.858292517 2010.03.24 0x0 t=[0x40001:0x0:0x0] p=[0:0x0:0x\
219 0] mdd_obd-lustre-MDT0000-0
221 <informaltable frame="none">
223 <colspec colname="c1" colwidth="100*"/>
226 <entry><para><emphasis role="bold">Note -</emphasis>MARK records typically indicate changelog recording status changes.</para></entry>
233 <title>Displaying the Changelog Index and Registered Users</title>
234 <para>To display the current, maximum changelog index and registered changelog users for a specific device (lustre-MDT0000):</para>
235 <screen># lctl get_param mdd.lustre-MDT0000.changelog_users
236 mdd.lustre-MDT0000.changelog_users=current index: 8
242 <title>Displaying the Changelog Mask</title>
243 <para>To show the current changelog mask on a specific device (lustre-MDT0000):</para>
244 <screen># lctl get_param mdd.lustre-MDT0000.changelog_mask
245 mdd.lustre-MDT0000.changelog_mask=
246 MARK CREAT MKDIR HLINK SLINK MKNOD UNLNK RMDIR RNMFM RNMTO OPEN CLOSE IOCTL\
247 TRUNC SATTR XATTR HSM
251 <title>Setting the Changelog Mask</title>
252 <para>To set the current changelog mask on a specific device (lustre-MDT0000):</para>
253 <screen># lctl set_param mdd.lustre-MDT0000.changelog_mask=HLINK
254 mdd.lustre-MDT0000.changelog_mask=HLINK
255 $ lfs changelog_clear lustre-MDT0000 cl1 0
256 $ mkdir /mnt/lustre/mydir/foo
257 $ cp /etc/hosts /mnt/lustre/mydir/foo/file
258 $ ln /mnt/lustre/mydir/foo/file /mnt/lustre/mydir/myhardlink
260 <para> Only item types that are in the mask show up in the changelog.</para>
261 <screen>$ lfs changelog lustre-MDT0000
262 9 03HLINK 19:19:35.171867477 2010.03.24 0x0 t=[0x200000420:0x6:0x0] p=[0x20\
263 0000420:0x3:0x0] myhardlink
268 <section xml:id="dbdoclet.50438273_81684">
269 <title>12.2 Lustre <anchor xml:id="dbdoclet.50438273_marker-1297386" xreflabel=""/>Monitoring Tool</title>
270 <para>The Lustre Monitoring Tool (LMT) is a Python-based, distributed system developed and maintained by Lawrence Livermore National Lab (LLNL)). It provides a ''top'' like display of activity on server-side nodes (MDS, OSS and portals routers) on one or more Lustre file systems. It does not provide support for monitoring clients. For more information on LMT, including the setup procedure, see:</para>
271 <para><link xl:href="http://code.google.com/p/lmt/">http://code.google.com/p/lmt/</link></para>
272 <para>LMT questions can be directed to:</para>
273 <para><link xl:href="mailto:lmt-discuss@googlegroups.com">lmt-discuss@googlegroups.com</link></para>
275 <section xml:id="dbdoclet.50438273_80593">
276 <title>12.3 Collect<anchor xml:id="dbdoclet.50438273_marker-1297391" xreflabel=""/>L</title>
277 <para>CollectL is another tool that can be used to monitor Lustre. You can run CollectL on a Lustre system that has any combination of MDSs, OSTs and clients. The collected data can be written to a file for continuous logging and played back at a later time. It can also be converted to a format suitable for plotting.</para>
278 <para>For more information about CollectL, see:</para>
279 <para><link xl:href="http://collectl.sourceforge.net">http://collectl.sourceforge.net</link></para>
280 <para>Lustre-specific documentation is also available. See:</para>
281 <para><link xl:href="http://collectl.sourceforge.net/Tutorial-Lustre.html">http://collectl.sourceforge.net/Tutorial-Lustre.html</link></para>
283 <section xml:id="dbdoclet.50438273_44185">
284 <title>12.4 Other Monitoring Options</title>
285 <para>A variety of standard tools are available publically.</para>
286 <para>Another option is to script a simple monitoring solution that looks at various reports from ipconfig, as well as the procfs files generated by Lustre.</para>
287 <para><anchor xml:id="dbdoclet.50438273_67514" xreflabel=""/> </para>