Whamcloud - gitweb
81b017f7f7340aa8eba36dfeb30dad7681f27b62
[doc/manual.git] / ConfiguringLNET.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='configuringlnet'>
3   <info>
4     <title xml:id='configuringlnet.title'>Configuring Lustre Networking (LNET)</title>
5   </info>
6
7   <para>This chapter describes how to configure Lustre Networking (LNET). It includes the following sections:</para>
8   <toc/>
9
10   <itemizedlist><listitem>
11           <para><xref linkend='dbdoclet.50438216_33148'/>
12           </para>
13       </listitem>
14       <listitem>
15           <para><xref linkend='dbdoclet.50438216_46279'/>
16           </para>
17       </listitem>
18       <listitem>
19           <para><xref linkend="dbdoclet.50438216_31414"/>
20           </para>
21       </listitem>
22       <listitem>
23           <para><xref linkend="dbdoclet.50438216_71227"/>
24           </para>
25       </listitem>
26       <listitem>
27           <para><xref linkend="dbdoclet.50438216_10523"/>
28           </para>
29       </listitem>
30       <listitem>
31           <para><xref linkend="dbdoclet.50438216_35668"/>
32           </para>
33       </listitem>
34       <listitem>
35           <para><xref linkend="dbdoclet.50438216_15200"/>
36           </para>
37       </listitem>
38   </itemizedlist>
39
40     <note>
41 <para>Configuring LNET is optional.</para><para> LNET will, by default, use the first TCP/IP interface it discovers on a system (eth0). If this network configuration is sufficient, you do not need to configure LNET. LNET configuration is required if you are using Infiniband or multiple Ethernet interfaces.</para>
42 </note>
43
44     <section xml:id="dbdoclet.50438216_33148" >
45       <title>9.1 Overview of LNET Module Parameters</title>
46       <para>LNET kernel module (lnet) parameters specify how LNET is to be configured to work with Lustre, including which NICs will be configured to work with Lustre and the routing to be used with Lustre.</para>
47       <para>Parameters for lnet are specified in the modprobe.conf or modules.conf file (depending on your Linux distribution) in one or more entries with the syntax:</para>
48       <screen>options lnet &lt;<emphasis>parameter</emphasis>&gt;=&lt;<emphasis>parameter value</emphasis>&gt;
49 </screen>
50       <para>To specify the network interfaces that are to be used for Lustre, set either the networks parameter or the ip2nets parameter (only one of these parameters can be used at a time):</para>
51       <itemizedlist><listitem>
52           <para>networks  - Specifies the networks to be used.</para>
53         </listitem>
54 <listitem>
55           <para>ip2nets  - Lists globally-available networks, each with a range of IP addresses. LNET then identifies locally-available networks through address list-matching lookup.</para>
56         </listitem>
57 </itemizedlist>
58 <para>See <xref linkend='dbdoclet.50438216_46279'/> and <xref linkend="dbdoclet.50438216_31414"/>Setting the LNET Module ip2nets Parameter for more details.</para>
59       <para>To set up routing between networks, use:</para>
60       <itemizedlist><listitem>
61           <para>routes  - Lists networks and the NIDs of routers that forward to them.</para>
62         </listitem>
63 </itemizedlist>
64 <para>See <xref linkend="dbdoclet.50438216_71227"/> for more details.</para>
65       <para>A router checker can be configured to enable Lustre nodes to detect router health status, avoid routers that appear dead, and reuse those that restore service after failures. See <xref linkend="dbdoclet.50438216_35668"/> for more details.</para>
66       <para>For a complete reference to the LNET module parameters, see <emphasis><xref linkend="configurationfilesmoduleparameters"/>LNET Options</emphasis>.</para>
67
68       <note>
69 <para>We recommend that you use 'dotted-quad' notation for IP addresses rather than host names to make it easier to read debug logs and debug configurations with multiple interfaces.</para>
70 </note>
71
72       <section remap="h3">
73         <title>9.1.1 Using a Lustre Network Identifier (NID) to Identify a Node</title>
74         <para>A Lustre network identifier (NID) is used to uniquely identify a Lustre network endpoint by node ID and network type. The format of the NID is:</para>
75         <screen>&lt;<emphasis>network</emphasis><emphasis>id</emphasis>&gt;@&lt;<emphasis>network</emphasis><emphasis>type</emphasis>&gt;</screen>
76         <para>Examples are:</para>
77         <screen>10.67.73.200@tcp010.67.75.100@o2ib</screen>
78         <para>The first entry above identifes a TCP/IP node, while the second entry identifies an InfiniBand node.</para>
79         <para>When a mount command is run on a client, the client uses the NID of the MDS to retrieve configuration information. If an MDS has more than one NID, the client should use the appropriate NID for its local network.</para>
80         <para>To determine the appropriate NID to specify in the mount command, use the lctl command. To display MDS NIDs, run on the MDS :</para>
81         <screen>lctl list_nids
82 </screen>
83         <para>To determine if a client can reach the MDS using a particular NID, run on the client:</para>
84         <screen>lctl which_nid &lt;<emphasis>MDS NID</emphasis>&gt;<anchor xml:id="dbdoclet.50438216_14112" xreflabel=""/></screen>
85       </section>
86     </section>
87     <section xml:id="dbdoclet.50438216_46279">
88       <title>9.2 Setting the LNET Module networks Parameter</title>
89       <para>If a node has more than one network interface, you'll typically want to dedicate a specific interface to Lustre. You can do this by including an entry in the modprobe.conf file on the node that sets the LNET module networks parameter:</para>
90       <screen>options lnet networks=&lt;<emphasis>comma-separated list of networks</emphasis>&gt;
91 </screen>
92       <para>This example specifies that a Lustre node will use a TCP/IP interface and an InfiniBand interface:</para>
93       <screen>options lnet networks=tcp0(eth0),o2ib(ib0)
94 </screen>
95       <para>This example specifies that the Lustre node will use the TCP/IP interface eth1:</para>
96       <screen>options lnet networks=tcp0(eth1)
97 </screen>
98       <para>Depending on the network design, it may be necessary to specify explicit interfaces. To explicitly specify that interface eth2 be used for network tcp0 and eth3 be used for tcp1 , use this entry:</para>
99       <screen>options lnet networks=tcp0(eth2),tcp1(eth3)
100 </screen>
101       <para>When more than one interface is available during the network setup, Lustre chooses the best route based on the hop count. Once the network connection is established, Lustre expects the network to stay connected. In a Lustre network, connections do not fail over to another interface, even if multiple interfaces are available on the same node.</para>
102
103       <note>
104 <para>LNET lines in modprobe.conf are only used by the local node to determine what to call its interfaces. They are not used for routing decisions.</para>
105 </note>
106
107       <section remap="h3">
108         <title>9.2.1 <anchor xml:id="dbdoclet.50438216_74334" xreflabel=""/>Multihome Server Example</title>
109         <para>If a server with multiple IP addresses (multihome server) is connected to a Lustre network, certain configuration setting are required. An example illustrating these setting consists of a network with the following nodes:</para>
110         <itemizedlist><listitem>
111             <para> Server svr1 with three TCP NICs (eth0, eth1, and eth2) and an InfiniBand NIC.</para>
112           </listitem>
113 <listitem>
114             <para> Server svr2 with three TCP NICs (eth0, eth1, and eth2) and an InfiniBand NIC. Interface eth2 will not be used for Lustre networking.</para>
115           </listitem>
116 <listitem>
117             <para> TCP clients, each with a single TCP interface.</para>
118           </listitem>
119 <listitem>
120             <para> InfiniBand clients, each with a single Infiniband interface and a TCP/IP interface for administration.</para>
121           </listitem>
122 </itemizedlist>
123         <para>To set the networks option for this example:</para>
124         <itemizedlist><listitem>
125             <para> On each server, svr1 and svr2, include the following line in the modprobe.conf file:</para>
126           </listitem>
127 </itemizedlist>
128         <screen>options lnet networks=tcp0(eth0),tcp1(eth1),o2ib
129 </screen>
130         <itemizedlist><listitem>
131             <para> For TCP-only clients, the first available non-loopback IP interface is used for tcp0. Thus, TCP clients with only one interface do not need to have options defined in the modprobe.conf file.</para>
132           </listitem>
133 <listitem>
134             <para> On the InfiniBand clients, include the following line in the modprobe.conf file:</para>
135           </listitem>
136 </itemizedlist>
137         <screen>options lnet networks=o2ib
138 </screen>
139
140 <note>
141     <para>By default, Lustre ignores the loopback (lo0) interface. Lustre does not ignore IP addresses aliased to the loopback. If you alias IP addresses to the loopback interface, you must specify all Lustre networks using the LNET networks parameter.</para></note>
142
143 <note>
144     <para>If the server has multiple interfaces on the same subnet, the Linux kernel will send all traffic using the first configured interface. This is a limitation of Linux, not Lustre. In this case, network interface bonding should be used. For more information about network interface bonding, see <xref linkend='settingupbonding'/>.</para>
145 </note>
146
147       </section>
148     </section>
149     <section xml:id="dbdoclet.50438216_31414">
150       <title>9.3 Setting the LNET Module ip2nets Parameter</title>
151       <para>The ip2nets option is typically used when a single, universal modprobe.conf file is run on all servers and clients. Each node identifies the locally available networks based on the listed IP address patterns that match the node&apos;s local IP addresses.</para>
152       <para>Note that the IP address patterns listed in the ip2nets option are <emphasis>only</emphasis> used to identify the networks that an individual node should instantiate. They are <emphasis>not</emphasis> used by LNET for any other communications purpose.</para>
153       <para>For the example below, the nodes in the network have these IP addresses:</para>
154       <itemizedlist><listitem>
155           <para> Server svr1: eth0 IP address 192.168.0.2, IP over Infiniband (o2ib) address 132.6.1.2.</para>
156         </listitem>
157 <listitem>
158           <para> Server svr2: eth0 IP address 192.168.0.4, IP over Infiniband (o2ib) address 132.6.1.4.</para>
159         </listitem>
160 <listitem>
161           <para> TCP clients have IP addresses 192.168.0.5-255.</para>
162         </listitem>
163 <listitem>
164           <para> Infiniband clients have IP over Infiniband (o2ib) addresses 132.6.[2-3].2, .4, .6, .8.</para>
165         </listitem>
166 </itemizedlist>
167       <para>The following entry is placed in the modprobe.conf file on each server and client:</para>
168       <screen>options lnet &apos;ip2nets=&quot;tcp0(eth0) 192.168.0.[2,4]; \
169 tcp0 192.168.0.*; o2ib0 132.6.[1-3].[2-8/2]&quot;&apos;
170 </screen>
171       <para>Each entry in ip2nets is referred to as a 'rule'.</para>
172       <para>The order of LNET entries is important when configuring servers. If a server node can be reached using more than one network, the first network specified in modprobe.conf will be used.</para>
173       <para>Because svr1 and svr2 match the first rule, LNET uses eth0 for tcp0 on those machines. (Although svr1 and svr2 also match the second rule, the first matching rule for a particular network is used).</para>
174       <para>The [2-8/2] format indicates a range of 2-8 stepped by 2; that is 2,4,6,8. Thus, the clients at 132.6.3.5 will not find a matching o2ib network.</para>
175     </section>
176     <section xml:id="dbdoclet.50438216_71227">
177       <title>9.4 Setting the LNET Module routes Parameter</title>
178       <para>The LNET module routes parameter is used to identify routers in a Lustre configuration. These parameters are set in modprob.conf on each Lustre node.</para>
179       <para>The LNET routes parameter specifies a colon-separated list of router definitions. Each route is defined as a network number, followed by a list of routers:</para>
180       <screen>routes=&lt;<emphasis>net type</emphasis>&gt; &lt;<emphasis>router NID(s)</emphasis>&gt;
181 </screen>
182       <para>This example specifies bi-directional routing in which TCP clients can reach Lustre resources on the IB networks and IB servers can access the TCP networks:</para>
183       <screen>options lnet &apos;ip2nets=&quot;tcp0 192.168.0.*; \
184 o2ib0(ib0) 132.6.1.[1-128]&quot;&apos; &apos;routes=&quot;tcp0 132.6.1.[1-8]@o2ib0; \o2ib0 192.16\
185 8.0.[1-8]@tcp0&quot;&apos;
186 </screen>
187       <para>All LNET routers that bridge two networks are equivalent. They are not configured as primary or secondary, and the load is balanced across all available routers.</para>
188       <para>The number of LNET routers is not limited. Enough routers should be used to handle the required file serving bandwidth plus a 25 percent margin for headroom.</para>
189       <section remap="h3">
190         <title>9.4.1 <anchor xml:id="dbdoclet.50438216_34481" xreflabel=""/><anchor xml:id="dbdoclet.50438216_56435" xreflabel=""/>Routing Example</title>
191         <para>On the clients, place the following entry in the modprobe.conf file</para>
192         <screen>lnet networks=&quot;tcp&quot; routes=&quot;o2ib0 192.168.0.[1-8]@tcp0&quot;
193 </screen>
194         <para>On the router nodes, use:</para>
195         <screen>lnet networks=&quot;tcp o2ib&quot; forwarding=enabled 
196 </screen>
197         <para>On the MDS, use the reverse as shown below:</para>
198         <screen>lnet networks=&quot;o2ib0&quot; rountes=&quot;tcp0 132.6.1.[1-8]@o2ib0&quot; 
199 </screen>
200         <para>To start the routers, run:</para>
201         <screen>modprobe lnet
202 lctl network configure
203 </screen>
204       </section>
205     </section>
206     <section xml:id="dbdoclet.50438216_10523">
207       <title>9.5 Testing the LNET Configuration</title>
208       <para>After configuring Lustre Networking, it is highly recommended that you test your LNET configuration using the LNET Self-Test provided with the Lustre software. For more information about using LNET Self-Test, see <xref linkend='lnetselftest'/>.</para>
209     </section>
210     <section xml:id="dbdoclet.50438216_35668">
211       <title>9.6 Configuring the Router Checker</title>
212       <para>In a Lustre configuration in which different types of networks, such as a TCP/IP network and an Infiniband network, are connected by routers, a router checker can be run on the clients and servers in the routed configuration to monitor the status of the routers. In a multi-hop routing configuration, router checkers can be configured on routers to monitor the health of their next-hop routers.</para>
213       <para>A router checker is configured by setting lnet parameters in modprobe.conf by including an entry in this form:</para>
214       <screen>options lnet &lt;<emphasis>router checker parameter</emphasis>&gt;=&lt;<emphasis>parameter value</emphasis>&gt;
215 </screen>
216       <para>The router checker parameters are:</para>
217       <itemizedlist><listitem>
218           <para>live_router_check_interval  - Specifies a time interval in seconds after which the router checker will ping the live routers. The default value is 0, meaning no checking is done. To set the value to 60, enter:</para>
219         </listitem>
220 </itemizedlist>
221       <screen>options lnet live_router_check_interval=60
222 </screen>
223       <itemizedlist><listitem>
224           <para>dead_router_check_interval  - Specifies a time interval in seconds after which the router checker will check for dead routers. The default value is 0, meaning no checking is done. To set the value to 60, enter:</para>
225         </listitem>
226 </itemizedlist>
227       <screen>options lnet dead_router_check_interval=60
228 </screen>
229       <itemizedlist><listitem>
230           <para>auto_down  - Enables/disables (1/0) the automatic marking of router state as up or down. The default value is 1. To disable router marking, enter:</para>
231         </listitem>
232 </itemizedlist>
233       <screen>options lnet auto_down=0
234 </screen>
235       <itemizedlist><listitem>
236           <para>router_ping_timeout  - Specifies a timeout for the router checker when it checks live or dead routers. The router checker sends a ping message to each dead or live router once every dead_router_check_interval or live_router_check_interval respectively. The default value is 50. To set the value to 60, enter:</para>
237         </listitem>
238 </itemizedlist>
239       <screen>options lnet router_ping_timeout=60
240 </screen>
241
242 <note>
243 <para>The router_ping_timeout is consistent with the default LND timeouts. You may have to increase it on very large clusters if the LND timeout is also increased. For larger clusters, we suggest increasing the check interval.</para>
244 </note>
245
246
247        <itemizedlist><listitem>
248           <para>check_routers_before_use  - Specifies that routers are to be checked before use. Set to off by default. If this parameter is set to on, the dead_router_check_interval parameter must be given a positive integer value.</para>
249         </listitem>
250 </itemizedlist>
251       <screen>options lnet check_routers_before_use=on
252 </screen>
253       <para>The router checker obtains the following information from each router:</para>
254       <itemizedlist><listitem>
255           <para> Time the router was disabled</para>
256         </listitem>
257 <listitem>
258           <para> Elapsed disable time</para>
259         </listitem>
260 </itemizedlist>
261       <para>If the router checker does not get a reply message from the router within router_ping_timeout seconds, it considers the router to be down.</para>
262       <para>If a router is marked 'up' and responds to a ping, the timeout is reset.</para>
263       <para>If 100 packets have been sent successfully through a router, the sent-packets counter for that router will have a value of 100.</para>
264     </section>
265     <section xml:id="dbdoclet.50438216_15200">
266       <title>9.7 Best Practices for LNET Options</title>
267       <para>For the networks, ip2nets, and routes options, follow these best practices to avoid configuration errors.</para>
268       <section remap="h5">
269         <title>Escaping commas with quotes</title>
270         <para>Depending on the Linux distribution, commas may need to be escaped using single or double quotes. In the extreme case, the options entry would look like this:</para>
271         <para>options lnet&apos;networks=&quot;tcp0,elan0&quot;&apos; &apos;routes=&quot;tcp [2,10]@elan0&quot;&apos;</para>
272         <para>Added quotes may confuse some distributions. Messages such as the following may indicate an issue related to added quotes:</para>
273         <para>lnet: Unknown parameter &apos;networks&apos;</para>
274         <para>A 'Refusing connection - no matching NID' message generally points to an error in the LNET module configuration.</para>
275       </section>
276       <section remap="h5">
277         <title>Including comments</title>
278         <para><emphasis>Place the semicolon terminating a comment immediately after the comment.</emphasis> LNET silently ignores everything between the # character at the beginning of the comment and the next semicolon.</para>
279         <para>In this <emphasis>incorrect</emphasis> example, LNET silently ignores pt11 192.168.0.[92,96], resulting in these nodes not being properly initialized. No error message is generated.</para>
280         <screen>options lnet ip2nets=</screen>
281       </section>
282   </section>
283 </chapter>