Whamcloud - gitweb
28fa9c686b286252a28a372bf101e301c41df224
[doc/manual.git] / LustreMonitoring.xml
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'>
3   <info>
4     <title xml:id='lustremonitoring.title'>Lustre Monitoring</title>
5   </info>
6   <para>This chapter provides information on monitoring Lustre and includes the following sections:</para>
7
8   <itemizedlist><listitem>
9           <para><xref linkend='dbdoclet.50438273_18711'/>Lustre Changelogs</para>
10       </listitem>
11       <listitem>
12           <para><xref linkend="dbdoclet.50438273_81684"/>Lustre Monitoring Tool</para>
13       </listitem>
14       <listitem>
15           <para><xref linkend="dbdoclet.50438273_80593"/>CollectL</para>
16       </listitem>
17       <listitem>
18           <para><xref linkend="dbdoclet.50438273_44185"/>Other Monitoring Options</para>
19           </listitem>
20       </itemizedlist>
21
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>
27         </listitem>
28 <listitem>
29           <para> Use changelog entries to exactly replicate changes in a file system mirror.</para>
30         </listitem>
31 <listitem>
32           <para> Set up &quot;watch scripts&quot; that take action on certain events or directories.</para>
33         </listitem>
34 <listitem>
35           <para> Maintain a rough audit trail (file/directory changes with timestamps, but no user information).</para>
36         </listitem>
37 </itemizedlist>
38       <para>Changelogs record types are:</para>
39       <informaltable frame="all">
40         <tgroup cols="2">
41           <colspec colname="c1" colwidth="50*"/>
42           <colspec colname="c2" colwidth="50*"/>
43           <thead>
44             <row>
45               <entry><para><emphasis role="bold">Value</emphasis></para></entry>
46               <entry><para><emphasis role="bold">Description</emphasis></para></entry>
47             </row>
48           </thead>
49           <tbody>
50             <row>
51               <entry><para> MARK</para></entry>
52               <entry><para> Internal recordkeeping</para></entry>
53             </row>
54             <row>
55               <entry><para> CREAT</para></entry>
56               <entry><para> Regular file creation</para></entry>
57             </row>
58             <row>
59               <entry><para> MKDIR</para></entry>
60               <entry><para> Directory creation</para></entry>
61             </row>
62             <row>
63               <entry><para> HLINK</para></entry>
64               <entry><para> Hard link</para></entry>
65             </row>
66             <row>
67               <entry><para> SLINK</para></entry>
68               <entry><para> Soft link</para></entry>
69             </row>
70             <row>
71               <entry><para> MKNOD</para></entry>
72               <entry><para> Other file creation</para></entry>
73             </row>
74             <row>
75               <entry><para> UNLNK</para></entry>
76               <entry><para> Regular file removal</para></entry>
77             </row>
78             <row>
79               <entry><para> RMDIR</para></entry>
80               <entry><para> Directory removal</para></entry>
81             </row>
82             <row>
83               <entry><para> RNMFM</para></entry>
84               <entry><para> Rename, original</para></entry>
85             </row>
86             <row>
87               <entry><para> RNMTO</para></entry>
88               <entry><para> Rename, final</para></entry>
89             </row>
90             <row>
91               <entry><para> IOCTL</para></entry>
92               <entry><para> ioctl on file or directory</para></entry>
93             </row>
94             <row>
95               <entry><para> TRUNC</para></entry>
96               <entry><para> Regular file truncated</para></entry>
97             </row>
98             <row>
99               <entry><para> SATTR</para></entry>
100               <entry><para> Attribute change</para></entry>
101             </row>
102             <row>
103               <entry><para> XATTR</para></entry>
104               <entry><para> Extended attribute change</para></entry>
105             </row>
106             <row>
107               <entry><para> UNKNW</para></entry>
108               <entry><para> Unknown operation</para></entry>
109             </row>
110           </tbody>
111         </tgroup>
112       </informaltable>
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>
114       <section remap="h3">
115         <title>12.1.1 Working with Changelogs</title>
116         <para>Several commands are available to work with changelogs.</para>
117         <section remap="h5">
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 &quot;done with&quot;, 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 &lt;mdt_device&gt; changelog_register
122 </screen>
123           <para>Changelog entries are not purged beyond a registered user's set point (see lfs changelog_clear).</para>
124         </section>
125         <section remap="h5">
126           <title>lfs changelog</title>
127           <para>To display the metadata changes on an MDT (the changelog records), run:</para>
128           <screen>lfs changelog &lt;MDT name&gt; [startrec [endrec]] 
129 </screen>
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]\
133  pics 
134 3 01CREAT 4298402264 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
135 x0] chloe.jpg 
136 4 06UNLNK 4298404466 0x0 t=[0x200000405:0x15fa:0x0] p=[0x200000405:0x15f9:0\
137 x0] chloe.jpg 
138 5 07RMDIR 4298405394 0x0 t=[0x200000405:0x15f9:0x0] p=[0x13:0x15e5a7a3:0x0]\
139  pics 
140 </screen>
141         </section>
142         <section remap="h5">
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 &lt;MDT name&gt; &lt;user ID&gt; &lt;endrec&gt;
146 </screen>
147           <para>The changelog_clear 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 &lt;endrec&gt; 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 &lt; X, the records are deleted.</para>
149         </section>
150         <section remap="h5">
151           <title>lctl changelog_deregister</title>
152           <para>To deregister (unregister) a changelog user, run:</para>
153           <screen>lctl --device &lt;mdt_device&gt; changelog_deregister &lt;user ID&gt;                
154 </screen>
155           <para> Changelog_deregister cl1 effectively does a changelog_clear cl10 as it deregisters.</para>
156         </section>
157       </section>
158       <section remap="h3">
159         <title>12.1.2 Changelog Examples</title>
160         <para>This section provides examples of different changelog commands.</para>
161         <section remap="h5">
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 &apos;cl1&apos;
166 </screen>
167         </section>
168         <section remap="h5">
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 
179 </screen>
180           <para>Changelog records include this information:</para>
181           <screen>rec# 
182 operation_type(numerical/text) 
183 timestamp 
184 datestamp 
185 flags 
186 t=target_FID 
187 p=parent_FID 
188 target_name
189 </screen>
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
193 </screen>
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
197 </screen>
198         </section>
199         <section remap="h5">
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
203 </screen>
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
208 </screen>
209         </section>
210         <section remap="h5">
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 &apos;cl1&apos;
215 </screen>
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 
220 </screen>
221           <informaltable frame="none">
222             <tgroup cols="1">
223               <colspec colname="c1" colwidth="100*"/>
224               <tbody>
225                 <row>
226                   <entry><para><emphasis role="bold">Note -</emphasis>MARK records typically indicate changelog recording status changes.</para></entry>
227                 </row>
228               </tbody>
229             </tgroup>
230           </informaltable>
231         </section>
232         <section remap="h5">
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 
237 ID    index 
238 cl2   8
239 </screen>
240         </section>
241         <section remap="h5">
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 
248 </screen>
249         </section>
250         <section remap="h5">
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
259 </screen>
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
264 </screen>
265         </section>
266       </section>
267     </section>
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 &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>
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>
274     </section>
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>
282     </section>
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>
288     </section>
289 </chapter>