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