Whamcloud - gitweb
LUDOC-403 acl: Update link for POSIX ACL paper
[doc/manual.git] / ManagingLNet.xml
1 <?xml version='1.0' encoding='UTF-8'?><chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="managinglnet">
2   <title xml:id="managinglnet.title">Managing Lustre Networking (LNet)</title>
3   <para>This chapter describes some tools for managing Lustre networking (LNet) and includes the
4     following sections:</para>
5   <itemizedlist>
6     <listitem>
7       <para><xref linkend="dbdoclet.50438203_51732"/></para>
8     </listitem>
9     <listitem>
10       <para><xref linkend="dbdoclet.50438203_48703"/></para>
11     </listitem>
12     <listitem>
13       <para><xref linkend="dbdoclet.50438203_82542"/></para>
14     </listitem>
15     <listitem>
16       <para><xref linkend="dbdoclet.50438203_78227"/></para>
17     </listitem>
18     <listitem>
19       <para><xref linkend="managinglnet.configuringroutes"/></para>
20     </listitem>
21   </itemizedlist>
22   <section xml:id="dbdoclet.50438203_51732">
23       <title><indexterm><primary>LNet</primary><secondary>management</secondary></indexterm>
24           Updating the Health Status of a Peer or Router</title>
25     <para>There are two mechanisms to update the health status of a peer or a router:</para>
26     <itemizedlist>
27       <listitem>
28         <para>LNet can actively check health status of all routers and mark them as dead or alive automatically. By default, this is off. To enable it set <literal>auto_down</literal> and if desired <literal>check_routers_before_use</literal>. This initial check may cause a pause equal to <literal>router_ping_timeout</literal> at system startup, if there are dead routers in the system.</para>
29       </listitem>
30       <listitem>
31         <para>When there is a communication error, all LNDs notify LNet that the peer (not necessarily a router) is down. This mechanism is always on, and there is no parameter to turn it off. However, if you set the LNet module parameter <literal>auto_down</literal> to <literal>0</literal>, LNet ignores all such peer-down notifications.</para>
32       </listitem>
33     </itemizedlist>
34     <para>Several key differences in both mechanisms:</para>
35     <itemizedlist>
36       <listitem>
37         <para>The router pinger only checks routers for their health, while LNDs notices all dead peers, regardless of whether they are a router or not.</para>
38       </listitem>
39       <listitem>
40         <para>The router pinger actively checks the router health by sending pings, but LNDs only notice a dead peer when there is network traffic going on.</para>
41       </listitem>
42       <listitem>
43         <para>The router pinger can bring a router from alive to dead or vice versa, but LNDs can only bring a peer down.</para>
44       </listitem>
45     </itemizedlist>
46   </section>
47   <section xml:id="dbdoclet.50438203_48703">
48       <title><indexterm><primary>LNet</primary><secondary>starting/stopping</secondary></indexterm>Starting and Stopping LNet</title>
49     <para>The Lustre software automatically starts and stops LNet, but it can also be manually
50       started in a standalone manner. This is particularly useful to verify that your networking
51       setup is working correctly before you attempt to start the Lustre file system.</para>
52     <section remap="h3">
53       <title>Starting LNet</title>
54       <para>To start LNet, run:</para>
55       <screen>$ modprobe lnet
56 $ lctl network up</screen>
57       <para>To see the list of local NIDs, run:</para>
58       <screen>$ lctl list_nids</screen>
59       <para>This command tells you the network(s) configured to work with the Lustre file
60         system.</para>
61       <para>If the networks are not correctly setup, see the <literal>modules.conf</literal> &quot;<literal>networks=</literal>&quot; line and make sure the network layer modules are correctly installed and configured.</para>
62       <para>To get the best remote NID, run:</para>
63       <screen>$ lctl which_nid <replaceable>NIDs</replaceable></screen>
64       <para>where <literal><replaceable>NIDs</replaceable></literal> is the list of available NIDs.</para>
65       <para>This command takes the &quot;best&quot; NID from a list of the NIDs of a remote host. The &quot;best&quot; NID is the one that the local node uses when trying to communicate with the remote node.</para>
66       <section remap="h4">
67         <title>Starting Clients</title>
68         <para>To start a TCP client, run:</para>
69         <screen>mount -t lustre mdsnode:/mdsA/client /mnt/lustre/</screen>
70         <para>To start an Elan client, run:</para>
71         <screen>mount -t lustre 2@elan0:/mdsA/client /mnt/lustre</screen>
72       </section>
73     </section>
74     <section remap="h3">
75       <title>Stopping LNet</title>
76       <para>Before the LNet modules can be removed, LNet references must be removed. In general,
77         these references are removed automatically when the Lustre file system is shut down, but for
78         standalone routers, an explicit step is needed to stop LNet. Run:</para>
79       <screen>lctl network unconfigure</screen>
80       <note>
81         <para>Attempting to remove Lustre modules prior to stopping the network may result in a
82           crash or an LNet hang. If this occurs, the node must be rebooted (in most cases). Make
83           sure that the Lustre network and Lustre file system are stopped prior to unloading the
84           modules. Be extremely careful using <literal>rmmod -f</literal>.</para>
85       </note>
86       <para>To unconfigure the LNet network, run:</para>
87       <screen>modprobe -r <replaceable>lnd_and_lnet_modules</replaceable></screen>
88       <note>
89         <para>
90 To remove all Lustre modules, run:</para>
91         <para><literal>$ lustre_rmmod</literal></para>
92       </note>
93     </section>
94   </section>
95   <section xml:id="dbdoclet.50438203_82542">
96     <title><indexterm><primary>LNet</primary><secondary>hardware multi-rail
97     configuration</secondary></indexterm>Hardware Based Multi-Rail
98     Configurations with LNet</title>
99     <para>To aggregate bandwidth across both rails of a dual-rail IB cluster
100         (o2iblnd) <footnote>
101         <para>Hardware multi-rail configurations are only supported by o2iblnd;
102         other IB LNDs do not support multiple interfaces.</para>
103       </footnote> using LNet, consider these points:</para>
104     <itemizedlist>
105       <listitem>
106         <para>LNet can work with multiple rails, however, it does not load
107         balance across them. The actual rail used for any communication is
108         determined by the peer NID.</para>
109       </listitem>
110       <listitem>
111         <para>Hardware multi-rail LNet configurations do not provide an
112         additional level of network fault tolerance. The configurations
113         described below are for bandwidth aggregation only.</para>
114       </listitem>
115       <listitem>
116         <para>A Lustre node always uses the same local NID to communicate with a
117         given peer NID. The criteria used to determine the local NID are:</para>
118         <itemizedlist>
119               <listitem>
120                 <para condition='l25'>Lowest route priority number (lower number,
121             higher priority).</para>
122               </listitem>
123           <listitem>
124             <para>Fewest hops (to minimize routing), and</para>
125           </listitem>
126           <listitem>
127             <para>Appears first in the &quot;<literal>networks</literal>&quot;
128             or &quot;<literal>ip2nets</literal>&quot; LNet configuration strings
129             </para>
130           </listitem>
131         </itemizedlist>
132       </listitem>
133     </itemizedlist>
134   </section>
135   <section xml:id="dbdoclet.50438203_78227">
136     <title><indexterm>
137         <primary>LNet</primary>
138         <secondary>InfiniBand load balancing</secondary>
139       </indexterm>Load Balancing with an InfiniBand<superscript>*</superscript> Network</title>
140     <para>A Lustre file system contains OSSs with two InfiniBand HCAs. Lustre clients have only one
141       InfiniBand HCA using OFED-based Infiniband &apos;&apos;o2ib&apos;&apos; drivers. Load
142       balancing between the HCAs on the OSS is accomplished through LNet.</para>
143     <section remap="h3">
144       <title><indexterm><primary>LNet</primary><secondary>lustre.conf</secondary></indexterm>Setting Up <literal>lustre.conf</literal> for Load Balancing</title>
145       <para>To configure LNet for load balancing on clients and servers:</para>
146       <orderedlist>
147         <listitem>
148           <para>Set the <literal>lustre.conf</literal> options.</para>
149           <para>Depending on your configuration, set <literal>lustre.conf</literal> options as follows:</para>
150           <itemizedlist>
151             <listitem>
152               <para>Dual HCA OSS server</para>
153             </listitem>
154           </itemizedlist>
155           <screen>options lnet networks="o2ib0(ib0),o2ib1(ib1)"</screen>
156           <itemizedlist>
157             <listitem>
158               <para>Client with the odd IP address</para>
159             </listitem>
160           </itemizedlist>
161           <screen>options lnet ip2nets="o2ib0(ib0) 192.168.10.[103-253/2]"</screen>
162           <itemizedlist>
163             <listitem>
164               <para>Client with the even IP address</para>
165             </listitem>
166           </itemizedlist>
167           <screen>options lnet ip2nets="o2ib1(ib0) 192.168.10.[102-254/2]"</screen>
168         </listitem>
169         <listitem>
170           <para>Run the modprobe lnet command and create a combined MGS/MDT file system.</para>
171           <para>The following commands create an MGS/MDT or OST file system and mount the targets on the servers.</para>
172           <screen>modprobe lnet
173 # mkfs.lustre --fsname lustre --mgs --mdt <replaceable>/dev/mdt_device</replaceable>
174 # mkdir -p <replaceable>/mount_point</replaceable>
175 # mount -t lustre /dev/<replaceable>mdt_device</replaceable> <replaceable>/mount_point</replaceable></screen>
176           <para>For example:</para>
177           <screen>modprobe lnet
178 mds# mkfs.lustre --fsname lustre --mdt --mgs /dev/sda
179 mds# mkdir -p /mnt/test/mdt
180 mds# mount -t lustre /dev/sda /mnt/test/mdt   
181 mds# mount -t lustre mgs@o2ib0:/lustre /mnt/mdt
182 oss# mkfs.lustre --fsname lustre --mgsnode=mds@o2ib0 --ost --index=0 /dev/sda
183 oss# mkdir -p /mnt/test/mdt
184 oss# mount -t lustre /dev/sda /mnt/test/ost   
185 oss# mount -t lustre mgs@o2ib0:/lustre /mnt/ost0</screen>
186         </listitem>
187         <listitem>
188           <para>Mount the clients.</para>
189           <screen>client# mount -t lustre <replaceable>mgs_node</replaceable>:/<replaceable>fsname</replaceable> <replaceable>/mount_point</replaceable></screen>
190           <para>This example shows an IB client being mounted.</para>
191           <screen>client# mount -t lustre
192 192.168.10.101@o2ib0,192.168.10.102@o2ib1:/mds/client /mnt/lustre</screen>
193         </listitem>
194       </orderedlist>
195       <para>As an example, consider a two-rail IB cluster running the OFED stack with these IPoIB
196         address assignments.</para>
197       <screen>             ib0                             ib1
198 Servers            192.168.0.*                     192.168.1.*
199 Clients            192.168.[2-127].*               192.168.[128-253].*</screen>
200       <para>You could create these configurations:</para>
201       <itemizedlist>
202         <listitem>
203           <para>A cluster with more clients than servers. The fact that an individual client cannot get two rails of bandwidth is unimportant because the servers are typically the actual bottleneck.</para>
204         </listitem>
205       </itemizedlist>
206       <screen>ip2nets=&quot;o2ib0(ib0),    o2ib1(ib1)      192.168.[0-1].*                     \
207                                             #all servers;\
208                    o2ib0(ib0)      192.168.[2-253].[0-252/2]       #even cl\
209 ients;\
210                    o2ib1(ib1)      192.168.[2-253].[1-253/2]       #odd cli\
211 ents&quot;</screen>
212       <para>This configuration gives every server two NIDs, one on each network, and statically load-balances clients between the rails.</para>
213       <itemizedlist>
214         <listitem>
215           <para>A single client that must get two rails of bandwidth, and it does not matter if the maximum aggregate bandwidth is only (# servers) * (1 rail).</para>
216         </listitem>
217       </itemizedlist>
218       <screen>ip2nets=&quot;       o2ib0(ib0)                      192.168.[0-1].[0-252/2]     \
219                                             #even servers;\
220            o2ib1(ib1)                      192.168.[0-1].[1-253/2]         \
221                                         #odd servers;\
222            o2ib0(ib0),o2ib1(ib1)           192.168.[2-253].*               \
223                                         #clients&quot;</screen>
224       <para>This configuration gives every server a single NID on one rail or the other. Clients have a NID on both rails.</para>
225       <itemizedlist>
226         <listitem>
227           <para>All clients and all servers must get two rails of bandwidth.</para>
228         </listitem>
229       </itemizedlist>
230       <screen>ip2nets=†  o2ib0(ib0),o2ib2(ib1)           192.168.[0-1].[0-252/2]       \
231   #even servers;\
232            o2ib1(ib0),o2ib3(ib1)           192.168.[0-1].[1-253/2]         \
233 #odd servers;\
234            o2ib0(ib0),o2ib3(ib1)           192.168.[2-253].[0-252/2)       \
235 #even clients;\
236            o2ib1(ib0),o2ib2(ib1)           192.168.[2-253].[1-253/2)       \
237 #odd clients&quot;</screen>
238       <para>This configuration includes two additional proxy o2ib networks to work around the
239         simplistic NID selection algorithm in the Lustre software. It connects &quot;even&quot;
240         clients to &quot;even&quot; servers with <literal>o2ib0</literal> on
241           <literal>rail0</literal>, and &quot;odd&quot; servers with <literal>o2ib3</literal> on
242           <literal>rail1</literal>. Similarly, it connects &quot;odd&quot; clients to
243         &quot;odd&quot; servers with <literal>o2ib1</literal> on <literal>rail0</literal>, and
244         &quot;even&quot; servers with <literal>o2ib2</literal> on <literal>rail1</literal>.</para>
245     </section>
246   </section>
247   <section xml:id="managinglnet.configuringroutes" condition='l24'>
248     <title><indexterm><primary>LNet</primary></indexterm>Dynamically Configuring
249     LNet Routes</title>
250     <para>Two scripts are provided:
251     <literal>lustre/scripts/lustre_routes_config</literal> and
252     <literal>lustre/scripts/lustre_routes_conversion</literal>.</para>
253     <para><literal>lustre_routes_config</literal> sets or cleans up LNet routes
254     from the specified config file.  The
255     <literal>/etc/sysconfig/lnet_routes.conf</literal> file can be used to
256     automatically configure routes on LNet startup. </para>
257     <para><literal>lustre_routes_conversion</literal> converts a legacy routes
258     configuration file to the new syntax, which is parsed by
259     <literal>lustre_routes_config</literal>.</para>
260     <section remap="h3">
261       <title><indexterm><primary>LNet</primary></indexterm>
262       <literal>lustre_routes_config</literal></title>
263       <para><literal>lustre_routes_config</literal> usage is as follows</para>
264       <screen><literal>lustre_routes_config [--setup|--cleanup|--dry-run|--verbose] <replaceable>config_file</replaceable></literal>
265          --setup: configure routes listed in config_file
266          --cleanup: unconfigure routes listed in config_file
267          --dry-run: echo commands to be run, but do not execute them
268          --verbose: echo commands before they are executed </screen>
269       <para> The format of the file which is passed into the script is as
270       follows: </para>
271       <para><literal><replaceable>network</replaceable>: { gateway: <replaceable>gateway</replaceable>@<replaceable>exit_network</replaceable> [hop: <replaceable>hop</replaceable>] [priority: <replaceable>priority</replaceable>] }</literal></para>
272       <para> An LNet router is identified when its local NID appears within the
273       list of routes.  However, this can not be achieved by the use of this
274       script, since the script only adds extra routes after the router is
275       identified.  To ensure that a router is identified correctly, make sure to
276       add its local NID in the routes parameter in the modprobe lustre
277       configuration file.  See <xref linkend='dbdoclet.50438293_15350'/>.</para>
278     </section>
279     <section remap="h3">
280       <title><indexterm><primary>LNet</primary></indexterm><literal>lustre_routes_conversion</literal></title>
281       <para><literal>lustre_routes_conversion</literal> usage is as follows:</para>
282       <screen><literal>lustre_routes_conversion <replaceable>legacy_file</replaceable> <replaceable>new_file</replaceable></literal></screen>
283       <para><literal>lustre_routes_conversion</literal> takes as a first parameter a file with routes configured as follows:</para>
284       <para><literal><replaceable>network</replaceable> [<replaceable>hop</replaceable>] <replaceable>gateway</replaceable>@<replaceable>exit network</replaceable>[:<replaceable>priority</replaceable>];</literal></para>
285       <para>The script then converts each routes entry in the provided file to:</para>
286       <para><literal><replaceable>network</replaceable>: { gateway: <replaceable>gateway</replaceable>@<replaceable>exit network</replaceable> [hop: <replaceable>hop</replaceable>] [priority: <replaceable>priority</replaceable>] }</literal></para>
287       <para>and appends each converted entry to the output file passed in as the second parameter to the script.</para>
288     </section>
289     <section remap="h3">
290       <title><indexterm><primary>LNet</primary></indexterm><literal>Route Configuration Examples</literal></title>
291       <para>Below is an example of a legacy LNet route configuration.  A legacy configuration file can have multiple entries.</para>
292       <screen><literal>tcp1 10.1.1.2@tcp0:1;
293 tcp2 10.1.1.3@tcp0:2;
294 tcp3 10.1.1.4@tcp0;</literal></screen>
295       <para>Below is an example of the converted LNet route configuration.  The following would be the result of the <literal>lustre_routes_conversion</literal> script, when run on the above legacy entries.</para>
296       <screen><literal>tcp1: { gateway: 10.1.1.2@tcp0 priority: 1 }
297 tcp2: { gateway: 10.1.1.2@tcp0 priority: 2 }
298 tcp1: { gateway: 10.1.1.4@tcp0 }</literal></screen>
299     </section>
300   </section>
301 </chapter>