1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- This document was created with Syntext Serna Free. -->
3 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="lustremonitoring">
5 <title xml:id="lustremonitoring.title">Lustre Monitoring</title>
7 <para>This chapter provides information on monitoring Lustre and includes the following sections:</para>
10 <para><xref linkend="dbdoclet.50438273_18711"/>Lustre Changelogs</para>
13 <para><xref linkend="dbdoclet.50438273_81684"/>Lustre Monitoring Tool</para>
16 <para><xref linkend="dbdoclet.50438273_80593"/>CollectL</para>
19 <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>
27 <para> Capture recent changes to feed into an archiving system.</para>
30 <para> Use changelog entries to exactly replicate changes in a file system mirror.</para>
33 <para> Set up "watch scripts" that take action on certain events or directories.</para>
36 <para> Maintain a rough audit trail (file/directory changes with timestamps, but no user information).</para>
39 <para>Changelogs record types are:</para>
40 <informaltable frame="all">
42 <colspec colname="c1" colwidth="50*"/>
43 <colspec colname="c2" colwidth="50*"/>
47 <para><emphasis role="bold">Value</emphasis></para>
50 <para><emphasis role="bold">Description</emphasis></para>
60 <para> Internal recordkeeping</para>
68 <para> Regular file creation</para>
76 <para> Directory creation</para>
84 <para> Hard link</para>
92 <para> Soft link</para>
100 <para> Other file creation</para>
108 <para> Regular file removal</para>
116 <para> Directory removal</para>
124 <para> Rename, original</para>
132 <para> Rename, final</para>
140 <para> ioctl on file or directory</para>
148 <para> Regular file truncated</para>
156 <para> Attribute change</para>
164 <para> Extended attribute change</para>
172 <para> Unknown operation</para>
178 <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>
180 <title>12.1.1 Working with Changelogs</title>
181 <para>Several commands are available to work with changelogs.</para>
183 <title>lctl changelog_register</title>
184 <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>
185 <para>To register a new changelog user, run:</para>
186 <screen>lctl --device <mdt_device> changelog_register
188 <para>Changelog entries are not purged beyond a registered user's set point (see <literal>lfs changelog_clear</literal>).</para>
191 <title>lfs changelog</title>
192 <para>To display the metadata changes on an MDT (the changelog records), run:</para>
193 <screen>lfs changelog <MDT name> [startrec [endrec]]
195 <para>It is optional whether to specify the start and end records.</para>
196 <para>These are sample changelog records:</para>
197 <screen>2 02MKDIR 4298396676 0x0 t=[0x200000405:0x15f9:0x0] p=[0x13:0x15e5a7a3:0x0]\
199 3 01CREAT 4298402264 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
201 4 06UNLNK 4298404466 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
203 5 07RMDIR 4298405394 0x0 t=[0x200000405:0x15f9:0x0] p=[0x13:0x15e5a7a3:0x0]\
208 <title>lfs changelog_clear</title>
209 <para>To clear old changelog records for a specific user (records that the user no longer needs), run:</para>
210 <screen>lfs changelog_clear <MDT name> <user ID> <endrec>
212 <para>The <literal>changelog_clear</literal> 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 <literal><endrec></literal> value of 0 indicates the current last record. To run <literal>changelog_clear</literal>, the changelog user must be registered on the MDT node using <literal>lctl</literal>.</para>
213 <para>When all changelog users are done with records < X, the records are deleted.</para>
216 <title>lctl changelog_deregister</title>
217 <para>To deregister (unregister) a changelog user, run:</para>
218 <screen>lctl --device <mdt_device> changelog_deregister <user ID> </screen>
219 <para> <literal>changelog_deregister cl1</literal> effectively does a <literal>changelog_clear cl1 0</literal> as it deregisters.</para>
223 <title>12.1.2 Changelog Examples</title>
224 <para>This section provides examples of different changelog commands.</para>
226 <title>Registering a Changelog User</title>
227 <para>To register a new changelog user for a device (<literal>lustre-MDT0000</literal>):</para>
228 <screen># lctl --device lustre-MDT0000 changelog_register
229 lustre-MDT0000: Registered changelog userid 'cl1'
233 <title>Displaying Changelog Records</title>
234 <para>To display changelog records on an MDT (<literal>lustre-MDT0000</literal>):</para>
235 <screen>$ lfs changelog lustre-MDT0000
236 1 00MARK 19:08:20.890432813 2010.03.24 0x0 t=[0x10001:0x0:0x0] p=[0:0x0:0x\
237 0] mdd_obd-lustre-MDT0000-0
238 2 02MKDIR 19:10:21.509659173 2010.03.24 0x0 t=[0x200000420:0x3:0x0] p=[0x61\
239 b4:0xca2c7dde:0x0] mydir
240 3 14SATTR 19:10:27.329356533 2010.03.24 0x0 t=[0x200000420:0x3:0x0]
241 4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
242 0000420:0x3:0x0] hosts
244 <para>Changelog records include this information:</para>
246 operation_type(numerical/text)
254 <para>Displayed in this format:</para>
255 <screen>rec# operation_type(numerical/text) timestamp datestamp flags t=target_FID \
256 p=parent_FID target_name
258 <para>For example:</para>
259 <screen>4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
260 0000420:0x3:0x0] hosts
264 <title>Clearing Changelog Records</title>
265 <para>To notify a device that a specific user (<literal>cl1</literal>) no longer needs records (up to and including 3):</para>
266 <screen>$ lfs changelog_clear lustre-MDT0000 cl1 3
268 <para>To confirm that the <literal>changelog_clear</literal> operation was successful, run <literal>lfs changelog</literal>; only records after id-3 are listed:</para>
269 <screen>$ lfs changelog lustre-MDT0000
270 4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
271 0000420:0x3:0x0] hosts
275 <title>Deregistering a Changelog User</title>
276 <para>To deregister a changelog user (<literal>cl1</literal>) for a specific device (<literal>lustre-MDT0000</literal>):</para>
277 <screen># lctl --device lustre-MDT0000 changelog_deregister cl1
278 lustre-MDT0000: Deregistered changelog user 'cl1'
280 <para>The deregistration operation clears all changelog records for the specified user (<literal>cl1</literal>).</para>
281 <screen>$ lfs changelog lustre-MDT0000
282 5 00MARK 19:13:40.858292517 2010.03.24 0x0 t=[0x40001:0x0:0x0] p=[0:0x0:0x\
283 0] mdd_obd-lustre-MDT0000-0
285 <informaltable frame="none">
287 <colspec colname="c1" colwidth="100*"/>
291 <para><emphasis role="bold">Note -</emphasis>MARK records typically indicate changelog recording status changes.</para>
299 <title>Displaying the Changelog Index and Registered Users</title>
300 <para>To display the current, maximum changelog index and registered changelog users for a specific device (<literal>lustre-MDT0000</literal>):</para>
301 <screen># lctl get_param mdd.lustre-MDT0000.changelog_users
302 mdd.lustre-MDT0000.changelog_users=current index: 8
308 <title>Displaying the Changelog Mask</title>
309 <para>To show the current changelog mask on a specific device (<literal>lustre-MDT0000</literal>):</para>
310 <screen># lctl get_param mdd.lustre-MDT0000.changelog_mask
312 mdd.lustre-MDT0000.changelog_mask=
313 MARK CREAT MKDIR HLINK SLINK MKNOD UNLNK RMDIR RNMFM RNMTO OPEN CLOSE IOCTL\
314 TRUNC SATTR XATTR HSM
318 <title>Setting the Changelog Mask</title>
319 <para>To set the current changelog mask on a specific device (<literal>lustre-MDT0000</literal>):</para>
320 <screen># lctl set_param mdd.lustre-MDT0000.changelog_mask=HLINK
321 mdd.lustre-MDT0000.changelog_mask=HLINK
322 $ lfs changelog_clear lustre-MDT0000 cl1 0
323 $ mkdir /mnt/lustre/mydir/foo
324 $ cp /etc/hosts /mnt/lustre/mydir/foo/file
325 $ ln /mnt/lustre/mydir/foo/file /mnt/lustre/mydir/myhardlink
327 <para> Only item types that are in the mask show up in the changelog.</para>
328 <screen>$ lfs changelog lustre-MDT0000
329 9 03HLINK 19:19:35.171867477 2010.03.24 0x0 t=[0x200000420:0x6:0x0] p=[0x20\
330 0000420:0x3:0x0] myhardlink
335 <section xml:id="dbdoclet.50438273_81684">
336 <title>12.2 Lustre <anchor xml:id="dbdoclet.50438273_marker-1297386" xreflabel=""/>Monitoring Tool</title>
337 <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>
338 <para><link xl:href="http://code.google.com/p/lmt/">http://code.google.com/p/lmt/</link></para>
339 <para>LMT questions can be directed to:</para>
340 <para><link xl:href="mailto:lmt-discuss@googlegroups.com">lmt-discuss@googlegroups.com</link></para>
342 <section xml:id="dbdoclet.50438273_80593">
343 <title>12.3 Collect<anchor xml:id="dbdoclet.50438273_marker-1297391" xreflabel=""/>L</title>
344 <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>
345 <para>For more information about CollectL, see:</para>
346 <para><link xl:href="http://collectl.sourceforge.net">http://collectl.sourceforge.net</link></para>
347 <para>Lustre-specific documentation is also available. See:</para>
348 <para><link xl:href="http://collectl.sourceforge.net/Tutorial-Lustre.html">http://collectl.sourceforge.net/Tutorial-Lustre.html</link></para>
350 <section xml:id="dbdoclet.50438273_44185">
351 <title>12.4 Other Monitoring Options</title>
352 <para>A variety of standard tools are available publically.</para>
353 <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>
354 <para><anchor xml:id="dbdoclet.50438273_67514" xreflabel=""/> </para>