Whamcloud - gitweb
LUDOC-62 backup: file-level MDT backup now supported.
[doc/manual.git] / LustreMonitoring.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- This document was created with Syntext Serna Free. --><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">
3   <title xml:id="lustremonitoring.title">Lustre Monitoring</title>
4   <para>This chapter provides information on monitoring Lustre and includes the following sections:</para>
5   <itemizedlist>
6     <listitem>
7       <para><xref linkend="dbdoclet.50438273_18711"/>Lustre Changelogs</para>
8     </listitem>
9     <listitem>
10       <para><xref linkend="dbdoclet.50438273_81684"/>Lustre Monitoring Tool</para>
11     </listitem>
12     <listitem>
13       <para><xref linkend="dbdoclet.50438273_80593"/>CollectL</para>
14     </listitem>
15     <listitem>
16       <para><xref linkend="dbdoclet.50438273_44185"/>Other Monitoring Options</para>
17     </listitem>
18   </itemizedlist>
19   <section xml:id="dbdoclet.50438273_18711">
20       <title><indexterm><primary>change logs</primary><see>monitoring</see></indexterm>
21 <indexterm><primary>monitoring</primary></indexterm>
22 <indexterm><primary>monitoring</primary><secondary>change logs</secondary></indexterm>
23
24 Lustre Changelogs</title>
25     <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>
26     <itemizedlist>
27       <listitem>
28         <para>Capture recent changes to feed into an archiving system.</para>
29       </listitem>
30       <listitem>
31         <para>Use changelog entries to exactly replicate changes in a file system mirror.</para>
32       </listitem>
33       <listitem>
34         <para>Set up &quot;watch scripts&quot; that take action on certain events or directories.</para>
35       </listitem>
36       <listitem>
37         <para>Maintain a rough audit trail (file/directory changes with timestamps, but no user information).</para>
38       </listitem>
39     </itemizedlist>
40     <para>Changelogs record types are:</para>
41     <informaltable frame="all">
42       <tgroup cols="2">
43         <colspec colname="c1" colwidth="50*"/>
44         <colspec colname="c2" colwidth="50*"/>
45         <thead>
46           <row>
47             <entry>
48               <para><emphasis role="bold">Value</emphasis></para>
49             </entry>
50             <entry>
51               <para><emphasis role="bold">Description</emphasis></para>
52             </entry>
53           </row>
54         </thead>
55         <tbody>
56           <row>
57             <entry>
58               <para> MARK</para>
59             </entry>
60             <entry>
61               <para> Internal recordkeeping</para>
62             </entry>
63           </row>
64           <row>
65             <entry>
66               <para> CREAT</para>
67             </entry>
68             <entry>
69               <para> Regular file creation</para>
70             </entry>
71           </row>
72           <row>
73             <entry>
74               <para> MKDIR</para>
75             </entry>
76             <entry>
77               <para> Directory creation</para>
78             </entry>
79           </row>
80           <row>
81             <entry>
82               <para> HLINK</para>
83             </entry>
84             <entry>
85               <para> Hard link</para>
86             </entry>
87           </row>
88           <row>
89             <entry>
90               <para> SLINK</para>
91             </entry>
92             <entry>
93               <para> Soft link</para>
94             </entry>
95           </row>
96           <row>
97             <entry>
98               <para> MKNOD</para>
99             </entry>
100             <entry>
101               <para> Other file creation</para>
102             </entry>
103           </row>
104           <row>
105             <entry>
106               <para> UNLNK</para>
107             </entry>
108             <entry>
109               <para> Regular file removal</para>
110             </entry>
111           </row>
112           <row>
113             <entry>
114               <para> RMDIR</para>
115             </entry>
116             <entry>
117               <para> Directory removal</para>
118             </entry>
119           </row>
120           <row>
121             <entry>
122               <para> RNMFM</para>
123             </entry>
124             <entry>
125               <para> Rename, original</para>
126             </entry>
127           </row>
128           <row>
129             <entry>
130               <para> RNMTO</para>
131             </entry>
132             <entry>
133               <para> Rename, final</para>
134             </entry>
135           </row>
136           <row>
137             <entry>
138               <para> IOCTL</para>
139             </entry>
140             <entry>
141               <para> ioctl on file or directory</para>
142             </entry>
143           </row>
144           <row>
145             <entry>
146               <para> TRUNC</para>
147             </entry>
148             <entry>
149               <para> Regular file truncated</para>
150             </entry>
151           </row>
152           <row>
153             <entry>
154               <para> SATTR</para>
155             </entry>
156             <entry>
157               <para> Attribute change</para>
158             </entry>
159           </row>
160           <row>
161             <entry>
162               <para> XATTR</para>
163             </entry>
164             <entry>
165               <para> Extended attribute change</para>
166             </entry>
167           </row>
168           <row>
169             <entry>
170               <para> UNKNW</para>
171             </entry>
172             <entry>
173               <para> Unknown operation</para>
174             </entry>
175           </row>
176         </tbody>
177       </tgroup>
178     </informaltable>
179     <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     <section remap="h3">
181       <title><indexterm><primary>monitoring</primary><secondary>change logs</secondary></indexterm>
182 Working with Changelogs</title>
183       <para>Several commands are available to work with changelogs.</para>
184       <section remap="h5">
185         <title>
186           <literal>lctl changelog_register</literal>
187         </title>
188         <para>Because changelog records take up space on the MDT, the system administration must register changelog users. The registrants specify which records they are &quot;done with&quot;, and the system purges up to the greatest common record.</para>
189         <para>To register a new changelog user, run:</para>
190         <screen>lctl --device &lt;mdt_device&gt; changelog_register
191 </screen>
192         <para>Changelog entries are not purged beyond a registered user&apos;s set point (see <literal>lfs changelog_clear</literal>).</para>
193       </section>
194       <section remap="h5">
195         <title>
196           <literal>lfs changelog</literal>
197         </title>
198         <para>To display the metadata changes on an MDT (the changelog records), run:</para>
199         <screen>lfs changelog &lt;MDT name&gt; [startrec [endrec]] </screen>
200         <para>It is optional whether to specify the start and end records.</para>
201         <para>These are sample changelog records:</para>
202         <screen>2 02MKDIR 4298396676 0x0 t=[0x200000405:0x15f9:0x0] p=[0x13:0x15e5a7a3:0x0]\
203  pics 
204 3 01CREAT 4298402264 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
205 x0] chloe.jpg 
206 4 06UNLNK 4298404466 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
207 x0] chloe.jpg 
208 5 07RMDIR 4298405394 0x0 t=[0x200000405:0x15f9:0x0] p=[0x13:0x15e5a7a3:0x0]\
209  pics </screen>
210       </section>
211       <section remap="h5">
212         <title>
213           <literal>lfs changelog_clear</literal>
214         </title>
215         <para>To clear old changelog records for a specific user (records that the user no longer needs), run:</para>
216         <screen>lfs changelog_clear &lt;MDT name&gt; &lt;user ID&gt; &lt;endrec&gt;</screen>
217         <para>The <literal>changelog_clear</literal> command indicates that changelog records previous to &lt;endrec&gt; are no longer of interest to a particular user &lt;user ID&gt;, potentially allowing the MDT to free up disk space. An <literal>&lt;endrec&gt;</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>
218         <para>When all changelog users are done with records &lt; X, the records are deleted.</para>
219       </section>
220       <section remap="h5">
221         <title>
222           <literal>lctl changelog_deregister</literal>
223         </title>
224         <para>To deregister (unregister) a changelog user, run:</para>
225         <screen>lctl --device &lt;mdt_device&gt; changelog_deregister &lt;user ID&gt;       </screen>
226         <para> <literal>changelog_deregister cl1</literal> effectively does a <literal>changelog_clear cl1 0</literal> as it deregisters.</para>
227       </section>
228     </section>
229     <section remap="h3">
230       <title>Changelog Examples</title>
231       <para>This section provides examples of different changelog commands.</para>
232       <section remap="h5">
233         <title>Registering a Changelog User</title>
234         <para>To register a new changelog user for a device (<literal>lustre-MDT0000</literal>):</para>
235         <screen># lctl --device lustre-MDT0000 changelog_register
236 lustre-MDT0000: Registered changelog userid &apos;cl1&apos;</screen>
237       </section>
238       <section remap="h5">
239         <title>Displaying Changelog Records</title>
240         <para>To display changelog records on an MDT (<literal>lustre-MDT0000</literal>):</para>
241         <screen>$ lfs changelog lustre-MDT0000
242 1 00MARK  19:08:20.890432813 2010.03.24 0x0 t=[0x10001:0x0:0x0] p=[0:0x0:0x\
243 0] mdd_obd-lustre-MDT0000-0 
244 2 02MKDIR 19:10:21.509659173 2010.03.24 0x0 t=[0x200000420:0x3:0x0] p=[0x61\
245 b4:0xca2c7dde:0x0] mydir 
246 3 14SATTR 19:10:27.329356533 2010.03.24 0x0 t=[0x200000420:0x3:0x0] 
247 4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
248 0000420:0x3:0x0] hosts </screen>
249         <para>Changelog records include this information:</para>
250         <screen>rec# 
251 operation_type(numerical/text) 
252 timestamp 
253 datestamp 
254 flags 
255 t=target_FID 
256 p=parent_FID 
257 target_name</screen>
258         <para>Displayed in this format:</para>
259         <screen>rec# operation_type(numerical/text) timestamp datestamp flags t=target_FID \
260 p=parent_FID target_name</screen>
261         <para>For example:</para>
262         <screen>4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
263 0000420:0x3:0x0] hosts</screen>
264       </section>
265       <section remap="h5">
266         <title>Clearing Changelog Records</title>
267         <para>To notify a device that a specific user (<literal>cl1</literal>) no longer needs records (up to and including 3):</para>
268         <screen>$ lfs changelog_clear  lustre-MDT0000 cl1 3</screen>
269         <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>
270         <screen>$ lfs changelog lustre-MDT0000
271 4 01CREAT 19:10:37.113847713 2010.03.24 0x0 t=[0x200000420:0x4:0x0] p=[0x20\
272 0000420:0x3:0x0] hosts</screen>
273       </section>
274       <section remap="h5">
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 &apos;cl1&apos;</screen>
279         <para>The deregistration operation clears all changelog records for the specified user (<literal>cl1</literal>).</para>
280         <screen>$ lfs changelog lustre-MDT0000
281 5 00MARK  19:13:40.858292517 2010.03.24 0x0 t=[0x40001:0x0:0x0] p=[0:0x0:0x\
282 0] mdd_obd-lustre-MDT0000-0 
283 </screen>
284         <note>
285           <para>MARK records typically indicate changelog recording status changes.</para>
286         </note>
287       </section>
288       <section remap="h5">
289         <title>Displaying the Changelog Index and Registered Users</title>
290         <para>To display the current, maximum changelog index and registered changelog users for a specific device (<literal>lustre-MDT0000</literal>):</para>
291         <screen># lctl get_param  mdd.lustre-MDT0000.changelog_users 
292 mdd.lustre-MDT0000.changelog_users=current index: 8 
293 ID    index 
294 cl2   8
295 </screen>
296       </section>
297       <section remap="h5">
298         <title>Displaying the Changelog Mask</title>
299         <para>To show the current changelog mask on a specific device (<literal>lustre-MDT0000</literal>):</para>
300         <screen># lctl get_param  mdd.lustre-MDT0000.changelog_mask 
301
302 mdd.lustre-MDT0000.changelog_mask= 
303 MARK CREAT MKDIR HLINK SLINK MKNOD UNLNK RMDIR RNMFM RNMTO OPEN CLOSE IOCTL\
304  TRUNC SATTR XATTR HSM 
305 </screen>
306       </section>
307       <section remap="h5">
308         <title>Setting the Changelog Mask</title>
309         <para>To set the current changelog mask on a specific device (<literal>lustre-MDT0000</literal>):</para>
310         <screen># lctl set_param mdd.lustre-MDT0000.changelog_mask=HLINK 
311 mdd.lustre-MDT0000.changelog_mask=HLINK 
312 $ lfs changelog_clear lustre-MDT0000 cl1 0 
313 $ mkdir /mnt/lustre/mydir/foo
314 $ cp /etc/hosts /mnt/lustre/mydir/foo/file
315 $ ln /mnt/lustre/mydir/foo/file /mnt/lustre/mydir/myhardlink
316 </screen>
317         <para>Only item types that are in the mask show up in the changelog.</para>
318         <screen>$ lfs changelog lustre-MDT0000
319 9 03HLINK 19:19:35.171867477 2010.03.24 0x0 t=[0x200000420:0x6:0x0] p=[0x20\
320 0000420:0x3:0x0] myhardlink
321 </screen>
322       </section>
323     </section>
324   </section>
325   <section xml:id="dbdoclet.50438273_81684">
326     <title><indexterm><primary>monitoring</primary><secondary>Lustre Monitoring Tool</secondary></indexterm>
327 Lustre Monitoring Tool</title>
328     <para>The Lustre Monitoring Tool (LMT) is a Python-based, distributed system developed and maintained by Lawrence Livermore National Lab (LLNL)). It provides a &apos;&apos;top&apos;&apos; 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>
329     <para><link xl:href="http://code.google.com/p/lmt/">http://code.google.com/p/lmt/</link></para>
330     <para>LMT questions can be directed to:</para>
331     <para><link xl:href="mailto:lmt-discuss@googlegroups.com">lmt-discuss@googlegroups.com</link></para>
332   </section>
333   <section xml:id="dbdoclet.50438273_80593">
334     <title>
335       <literal>CollectL</literal>
336     </title>
337     <para><literal>CollectL</literal> is another tool that can be used to monitor Lustre. You can run <literal>CollectL</literal> 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>
338     <para>For more information about <literal>CollectL</literal>, see:</para>
339     <para><link xl:href="http://collectl.sourceforge.net">http://collectl.sourceforge.net</link></para>
340     <para>Lustre-specific documentation is also available. See:</para>
341     <para><link xl:href="http://collectl.sourceforge.net/Tutorial-Lustre.html">http://collectl.sourceforge.net/Tutorial-Lustre.html</link></para>
342   </section>
343   <section xml:id="dbdoclet.50438273_44185">
344     <title><indexterm><primary>monitoring</primary><secondary>additional tools</secondary></indexterm>
345 Other Monitoring Options</title>
346     <para>A variety of standard tools are available publically.</para>
347     <para>Another option is to script a simple monitoring solution that looks at various reports from <literal>ipconfig</literal>, as well as the <literal>procfs</literal> files generated by Lustre.</para>
348   </section>
349 </chapter>