doc-exports/docs/elb/umn/elb_qs_0003.html
zhoumeng 58b2c5fa4f elb_umn_20230303
Reviewed-by: Hajba, László Antal <laszlo-antal.hajba@t-systems.com>
Co-authored-by: zhoumeng <zhoumeng35@huawei.com>
Co-committed-by: zhoumeng <zhoumeng35@huawei.com>
2023-03-03 16:05:26 +00:00

174 lines
43 KiB
HTML

<a name="elb_qs_0003"></a><a name="elb_qs_0003"></a>
<h1 class="topictitle1">Using Dedicated Load Balancers (Advanced Level)</h1>
<div id="body0000001080005612"><div class="section" id="elb_qs_0003__section18950295143553"><h4 class="sectiontitle">Scenarios</h4><p id="elb_qs_0003__p13318235811">You have two web applications that are deployed on separated ECSs but use the same domain name for access. You can set different URLs to process requests.</p>
<p id="elb_qs_0003__p14697175632114">To forward requests based on URLs, you need to create a load balancer, add an HTTP or HTTPS listener, and add forwarding policies to specify the URLs.</p>
<p id="elb_qs_0003__p66625093192530">An HTTP listener is used as an example to describe how to route requests from two URLs (<strong id="elb_qs_0003__en-us_elb_02_0001_b019135712397">/ELB01</strong> and <strong id="elb_qs_0003__en-us_elb_02_0001_b12208357183914">/ELB02</strong>) of the same domain name (www.example.com) to different backend servers.</p>
</div>
<div class="section" id="elb_qs_0003__section3453061616119"><h4 class="sectiontitle">Prerequisites</h4><ul id="elb_qs_0003__ul15892133835819"><li id="elb_qs_0003__li169934443213">You have added security group rules to allow traffic from the ports used by the two ECSs. (Alternatively, you can enable all ports first and then disable the ports that are no longer used after service deployment.)</li><li id="elb_qs_0003__li16288402223">You have verified that the security group containing the ECSs allows access traffic from the VPC where the load balancer works and that the health check function is normal.<div class="note" id="elb_qs_0003__note2297145295010"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="elb_qs_0003__elb_qs_0002_p1297043018186">Dedicated load balancers: If <strong id="elb_qs_0003__elb_qs_0002_b176297540264">IP as a Backend</strong> is not enabled for a load balancer that has a TCP or UDP listener, there is no need to configure security group rules to allow traffic from the VPC where the load balancer works to the backend servers associated with TCP or UDP listener.</p>
</div></div>
</li></ul>
</div>
<div class="section" id="elb_qs_0003__section29839590578"><h4 class="sectiontitle">Creating ECSs</h4><p id="elb_qs_0003__en-us_elb_02_0001_p17398174135812">ECSs are used as backend servers to process requests. Each ECS needs an EIP for accessing the Internet and configuring the application on the ECS.</p>
</div>
<ol id="elb_qs_0003__ol09857595579"><li id="elb_qs_0003__en-us_elb_02_0001_li18503134213513">Log in to the management console.</li><li id="elb_qs_0003__en-us_elb_02_0001_li1658495082510">In the upper left corner of the page, click <span><img id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_image397247655" src="en-us_image_0000001211126503.png"></span> and select the desired region and project.</li><li id="elb_qs_0003__en-us_elb_02_0001_li1561583452013">Hover on <span><img id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_image2280134131215" src="en-us_image_0000001206511791.png"></span> in the upper left corner to display <strong id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_b441019121229">Service List</strong> and choose <strong id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_b24131012142211">Computing</strong> &gt; <strong id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_b2416012112212">Elastic Cloud Server</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li12985204673513"><p id="elb_qs_0003__en-us_elb_02_0001_p09941142915"><a name="elb_qs_0003__en-us_elb_02_0001_li12985204673513"></a><a name="en-us_elb_02_0001_li12985204673513"></a>Click <strong id="elb_qs_0003__en-us_elb_02_0001_b189237920521">Create ECS</strong>, configure the parameters, and click <strong id="elb_qs_0003__en-us_elb_02_0001_b892318955211">Create Now</strong>.</p>
<p id="elb_qs_0003__en-us_elb_02_0001_p1745011147553"></p>
<div class="p" id="elb_qs_0003__en-us_elb_02_0001_p1745013149557">The following table lists the specifications of the two ECSs.
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="elb_qs_0003__en-us_elb_02_0001_table169305003620" frame="border" border="1" rules="all"><caption><b>Table 1 </b>ECS specifications</caption><thead align="left"><tr id="elb_qs_0003__en-us_elb_02_0001_row1926804361"><th align="left" class="cellrowborder" valign="top" width="46.949999999999996%" id="mcps1.3.4.4.3.1.2.3.1.1"><p id="elb_qs_0003__en-us_elb_02_0001_p1892518019366"><strong id="elb_qs_0003__en-us_elb_02_0001_b19953103985013">Item</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.05%" id="mcps1.3.4.4.3.1.2.3.1.2"><p id="elb_qs_0003__en-us_elb_02_0001_p992515013615"><strong id="elb_qs_0003__en-us_elb_02_0001_b173134916507">Example Value</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="elb_qs_0003__en-us_elb_02_0001_row1592617014367"><td class="cellrowborder" valign="top" width="46.949999999999996%" headers="mcps1.3.4.4.3.1.2.3.1.1 "><p id="elb_qs_0003__en-us_elb_02_0001_p6926904361">Name</p>
</td>
<td class="cellrowborder" valign="top" width="53.05%" headers="mcps1.3.4.4.3.1.2.3.1.2 "><p id="elb_qs_0003__en-us_elb_02_0001_p11926180193617">ECS01 and ECS02</p>
</td>
</tr>
<tr id="elb_qs_0003__en-us_elb_02_0001_row1692618015368"><td class="cellrowborder" valign="top" width="46.949999999999996%" headers="mcps1.3.4.4.3.1.2.3.1.1 "><p id="elb_qs_0003__en-us_elb_02_0001_p99262003618">OS</p>
</td>
<td class="cellrowborder" valign="top" width="53.05%" headers="mcps1.3.4.4.3.1.2.3.1.2 "><p id="elb_qs_0003__en-us_elb_02_0001_p4926180103613">CentOS 7.2 64bit</p>
</td>
</tr>
<tr id="elb_qs_0003__en-us_elb_02_0001_row192710163612"><td class="cellrowborder" valign="top" width="46.949999999999996%" headers="mcps1.3.4.4.3.1.2.3.1.1 "><p id="elb_qs_0003__en-us_elb_02_0001_p892618033614">vCPUs</p>
</td>
<td class="cellrowborder" valign="top" width="53.05%" headers="mcps1.3.4.4.3.1.2.3.1.2 "><p id="elb_qs_0003__en-us_elb_02_0001_p5927180103614">2</p>
</td>
</tr>
<tr id="elb_qs_0003__en-us_elb_02_0001_row1592812043617"><td class="cellrowborder" valign="top" width="46.949999999999996%" headers="mcps1.3.4.4.3.1.2.3.1.1 "><p id="elb_qs_0003__en-us_elb_02_0001_p129271407366">Memory</p>
</td>
<td class="cellrowborder" valign="top" width="53.05%" headers="mcps1.3.4.4.3.1.2.3.1.2 "><p id="elb_qs_0003__en-us_elb_02_0001_p9927301368">4 GB</p>
</td>
</tr>
<tr id="elb_qs_0003__en-us_elb_02_0001_row392816093610"><td class="cellrowborder" valign="top" width="46.949999999999996%" headers="mcps1.3.4.4.3.1.2.3.1.1 "><p id="elb_qs_0003__en-us_elb_02_0001_p139281709369">System disk</p>
</td>
<td class="cellrowborder" valign="top" width="53.05%" headers="mcps1.3.4.4.3.1.2.3.1.2 "><p id="elb_qs_0003__en-us_elb_02_0001_p199287015363">40 GB</p>
</td>
</tr>
<tr id="elb_qs_0003__en-us_elb_02_0001_row159291018368"><td class="cellrowborder" valign="top" width="46.949999999999996%" headers="mcps1.3.4.4.3.1.2.3.1.1 "><p id="elb_qs_0003__en-us_elb_02_0001_p1992870163612">Data disk</p>
</td>
<td class="cellrowborder" valign="top" width="53.05%" headers="mcps1.3.4.4.3.1.2.3.1.2 "><p id="elb_qs_0003__en-us_elb_02_0001_p3929207369">100 GB</p>
</td>
</tr>
<tr id="elb_qs_0003__en-us_elb_02_0001_row2092917063616"><td class="cellrowborder" valign="top" width="46.949999999999996%" headers="mcps1.3.4.4.3.1.2.3.1.1 "><p id="elb_qs_0003__en-us_elb_02_0001_p13929906362">Bandwidth</p>
</td>
<td class="cellrowborder" valign="top" width="53.05%" headers="mcps1.3.4.4.3.1.2.3.1.2 "><p id="elb_qs_0003__en-us_elb_02_0001_p1892918013619">5 Mbit/s</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li98881217183519">Submit your request.</li></ol>
<div class="section" id="elb_qs_0003__section12375217165718"><h4 class="sectiontitle">Deploying the Application</h4><p id="elb_qs_0003__en-us_elb_02_0001_p19652191111417">Deploy Nginx on the two ECSs and edit two HTML pages so that a page with message "Welcome to ELB test page one!" is returned when ECS01 is accessed, and the other page with message "Welcome to ELB test page two!" is returned when ECS02 is accessed.</p>
<ol id="elb_qs_0003__en-us_elb_02_0001_ol1137531718571"><li id="elb_qs_0003__en-us_elb_02_0001_li7185175234820">Log in to the ECSs.</li><li id="elb_qs_0003__en-us_elb_02_0001_li417184819279">Install and start Nginx.<ol type="a" id="elb_qs_0003__en-us_elb_02_0001_ol38581142815"><li id="elb_qs_0003__en-us_elb_02_0001_li12862142143913">Run the <strong id="elb_qs_0003__en-us_elb_02_0001_b1247732183211">wget</strong> command to download the Nginx installation package for your operating system in use. CentOS 7.6 is used as an example here.<pre class="screen" id="elb_qs_0003__en-us_elb_02_0001_screen74712157217">wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm</pre>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li259319516119">Run the following command to create the Nginx yum repository:<pre class="screen" id="elb_qs_0003__en-us_elb_02_0001_screen1528319398215">rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm</pre>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li1142112271116">Run the following command to install Nginx:<pre class="screen" id="elb_qs_0003__en-us_elb_02_0001_screen9609175010218">yum -y install nginx</pre>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li197081130018">Run the following commands to start Nginx and configure automatic Nginx enabling upon ECS startup:<pre class="screen" id="elb_qs_0003__en-us_elb_02_0001_screen175165111635">systemctl start nginx
systemctl enable nginx</pre>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li10124171615285">Enter <strong id="elb_qs_0003__en-us_elb_02_0001_b8878139865">http://</strong><em id="elb_qs_0003__en-us_elb_02_0001_i118921439266">EIP bound to the ECS</em> in the address box of your browser. If the following page is displayed, Nginx has been installed.<div class="fignone" id="elb_qs_0003__en-us_elb_02_0001_fig137471211561"><span class="figcap"><b>Figure 1 </b>Nginx installed successfully</span><br><span><img id="elb_qs_0003__en-us_elb_02_0001_image1074715213563" src="en-us_image_0000001206435130.png"></span></div>
</li></ol>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li5437706117">Modify the HTML page of ECS01.<div class="p" id="elb_qs_0003__en-us_elb_02_0001_p1751133519291"><a name="elb_qs_0003__en-us_elb_02_0001_li5437706117"></a><a name="en-us_elb_02_0001_li5437706117"></a>Move the <strong id="elb_qs_0003__en-us_elb_02_0001_b582120535347">index.html</strong> file from the default root directory of Nginx <strong id="elb_qs_0003__en-us_elb_02_0001_b18822125303414">/usr/share/nginx/html</strong> to the <strong id="elb_qs_0003__en-us_elb_02_0001_b582216534348">ELB01</strong> directory and modify the file to identify access to ECS01.<ol type="a" id="elb_qs_0003__en-us_elb_02_0001_ol17991841818"><li id="elb_qs_0003__en-us_elb_02_0001_li73061128217">Create the <strong id="elb_qs_0003__en-us_elb_02_0001_b111981836445">ELB01</strong> directory and copy the <strong id="elb_qs_0003__en-us_elb_02_0001_b1523113411246">index.html</strong> file to this directory:<p id="elb_qs_0003__en-us_elb_02_0001_p173003321518"><strong id="elb_qs_0003__en-us_elb_02_0001_b110913141263">mkdir /usr/share/nginx/html/ELB01</strong></p>
<p id="elb_qs_0003__en-us_elb_02_0001_p1130613127218"><strong id="elb_qs_0003__en-us_elb_02_0001_b1770484313713">cp <strong id="elb_qs_0003__en-us_elb_02_0001_b983391711810">/usr/share/nginx/html/</strong>index.html /usr/share/nginx/html/ELB01</strong>/</p>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li43715036155356">Open the <strong id="elb_qs_0003__en-us_elb_02_0001_b108801613204212">index.html</strong> file.<p id="elb_qs_0003__en-us_elb_02_0001_p57891004155356"><strong id="elb_qs_0003__en-us_elb_02_0001_b1282164811124">vim /usr/share/nginx/html<strong id="elb_qs_0003__en-us_elb_02_0001_b445614535191">/ELB01</strong>/index.html</strong></p>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li58659743155356">Press <strong id="elb_qs_0003__en-us_elb_02_0001_b21631824154011">i</strong> to enter editing mode.</li><li id="elb_qs_0003__en-us_elb_02_0001_li53818751155356">Modify the <strong id="elb_qs_0003__en-us_elb_02_0001_b1381499314202545">index.html</strong> file to be as follows:<pre class="screen" id="elb_qs_0003__en-us_elb_02_0001_screen42293086155356"> ...
&lt;body&gt;
&lt;h1&gt;Welcome to &lt;strong&gt;ELB&lt;/strong&gt; test page one!&lt;/h1&gt;
&lt;div class="content"&gt;
&lt;p&gt;This page is used to test the &lt;strong&gt;ELB&lt;/strong&gt;!&lt;/p&gt;
&lt;div class="alert"&gt;
&lt;h2&gt;ELB01&lt;/h2&gt;
&lt;div class="content"&gt;
&lt;p&gt;&lt;strong&gt;ELB test (page one)!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ELB test (page one)!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ELB test (page one)!&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;</pre>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li5284577155356">Press <strong id="elb_qs_0003__en-us_elb_02_0001_b1198904442202845_1">Esc</strong> to exit editing mode. Then, enter <strong id="elb_qs_0003__en-us_elb_02_0001_b201364315920295_1">:wq</strong> to save the settings and exit the file.</li></ol>
</div>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li0811151216197">Modify the HTML page of ECS02.<div class="p" id="elb_qs_0003__en-us_elb_02_0001_p98116128199"><a name="elb_qs_0003__en-us_elb_02_0001_li0811151216197"></a><a name="en-us_elb_02_0001_li0811151216197"></a>Move the <strong id="elb_qs_0003__en-us_elb_02_0001_b852213201664">index.html</strong> file from the default root directory of Nginx <strong id="elb_qs_0003__en-us_elb_02_0001_b12677410172514">/usr/share/nginx/html</strong> to the <strong id="elb_qs_0003__en-us_elb_02_0001_b179101139132510">ELB02</strong> directory and modify the file to identify access to ECS02.<ol type="a" id="elb_qs_0003__en-us_elb_02_0001_ol78111712121918"><li id="elb_qs_0003__en-us_elb_02_0001_li981115126194">Create the <strong id="elb_qs_0003__en-us_elb_02_0001_b175231561769">ELB02</strong> directory and copy the <strong id="elb_qs_0003__en-us_elb_02_0001_b205241756365">index.html</strong> file to this directory:<p id="elb_qs_0003__en-us_elb_02_0001_p68111412151912"><strong id="elb_qs_0003__en-us_elb_02_0001_b88113123191">mkdir /usr/share/nginx/html/ELB02</strong></p>
<p id="elb_qs_0003__en-us_elb_02_0001_p4811212191917"><strong id="elb_qs_0003__en-us_elb_02_0001_b3812912161910">cp <strong id="elb_qs_0003__en-us_elb_02_0001_b16812171217192">/usr/share/nginx/html/</strong>index.html /usr/share/nginx/html/ELB02</strong>/</p>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li6812121219197">Open the <strong id="elb_qs_0003__en-us_elb_02_0001_b143589415716">index.html</strong> file.<p id="elb_qs_0003__en-us_elb_02_0001_p1881241241910"><strong id="elb_qs_0003__en-us_elb_02_0001_b17812212181915">vim /usr/share/nginx/html<strong id="elb_qs_0003__en-us_elb_02_0001_b1794479197">/ELB02</strong>/index.html</strong></p>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li1812121217199">Press <strong id="elb_qs_0003__en-us_elb_02_0001_b161511671718">i</strong> to enter editing mode.</li><li id="elb_qs_0003__en-us_elb_02_0001_li12812912161915">Modify the <strong id="elb_qs_0003__en-us_elb_02_0001_b169873713714">index.html</strong> file to be as follows:<pre class="screen" id="elb_qs_0003__en-us_elb_02_0001_screen074901414420">...
&lt;body&gt;
&lt;h1&gt;Welcome to &lt;strong&gt;ELB&lt;/strong&gt; test page two!&lt;/h1&gt;
&lt;div class="content"&gt;
&lt;p&gt;This page is used to test the &lt;strong&gt;ELB&lt;/strong&gt;!&lt;/p&gt;
&lt;div class="alert"&gt;
&lt;h2&gt;ELB02&lt;/h2&gt;
&lt;div class="content"&gt;
&lt;p&gt;&lt;strong&gt;ELB test (page two)!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ELB test (page two)!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ELB test (page two)!&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;</pre>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li1431755212157">Press <strong id="elb_qs_0003__en-us_elb_02_0001_b1448510141770">Esc</strong> to exit editing mode. Then, enter <strong id="elb_qs_0003__en-us_elb_02_0001_b1448611148719">:wq</strong> to save the settings and exit the file.</li></ol>
</div>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li187810381119">Use your browser to access <strong id="elb_qs_0003__en-us_elb_02_0001_b161936112081">http://</strong><em id="elb_qs_0003__en-us_elb_02_0001_i15657926283">ECS01 EIP</em><strong id="elb_qs_0003__en-us_elb_02_0001_b674019320820">/ELB01/</strong> and <strong id="elb_qs_0003__en-us_elb_02_0001_b77684717818">http://</strong><em id="elb_qs_0003__en-us_elb_02_0001_i1040845515810">ECS02 EIP</em><strong id="elb_qs_0003__en-us_elb_02_0001_b13738411911">/ELB02/</strong> to verify that Nginx has been deployed.<p id="elb_qs_0003__en-us_elb_02_0001_p12966153132218">If the modified HTML pages are displayed, Nginx has been deployed.</p>
<ul id="elb_qs_0003__en-us_elb_02_0001_ul117591613242"><li id="elb_qs_0003__en-us_elb_02_0001_li1275991102411">HTML page of ECS01<div class="fignone" id="elb_qs_0003__en-us_elb_02_0001_fig1823119513251"><span class="figcap"><b>Figure 2 </b>Nginx successfully deployed on ECS01</span><br><span><img id="elb_qs_0003__en-us_elb_02_0001_image162241919366" src="en-us_image_0166358924.png"></span></div>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li1049422182416">HTML page of ECS02<div class="fignone" id="elb_qs_0003__en-us_elb_02_0001_fig17457132212516"><span class="figcap"><b>Figure 3 </b>Nginx successfully deployed on ECS02</span><br><span><img id="elb_qs_0003__en-us_elb_02_0001_image122741811610" src="en-us_image_0166358926.png"></span></div>
</li></ul>
</li></ol>
</div>
<div class="section" id="elb_qs_0003__section15436447172917"><h4 class="sectiontitle">Creating a Load Balancer</h4><p id="elb_qs_0003__p229893917615">The load balancer needs an EIP to access the application deployed on the ECSs over the Internet. You can determine whether to bind an EIP to the load balancer based on your requirements. For details, see <a href="elb_pro_01_0004.html">Load Balancing on a Public or Private Network</a>.</p>
<ol id="elb_qs_0003__ol353744134512"><li id="elb_qs_0003__li1131682861711">In the upper left corner of the page, click <span><img id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_image1851513211124" src="en-us_image_0000001211126503.png"></span> and select the desired region and project.</li><li id="elb_qs_0003__li17301740102218">Hover on <span><img id="elb_qs_0003__en-us_topic_0052569751_image762510132322" src="en-us_image_0000001417088430.png"></span> in the upper left corner to display <strong id="elb_qs_0003__en-us_topic_0052569751_b9121102522212">Service List</strong> and choose <strong id="elb_qs_0003__en-us_topic_0052569751_b61222025142217">Network</strong> &gt; <strong id="elb_qs_0003__en-us_topic_0052569751_b4124425142210">Elastic Load Balancing</strong>.</li><li id="elb_qs_0003__li59220156440">Click <strong id="elb_qs_0003__b16789101818419">Create Elastic Load Balancer</strong> and then configure the parameters.</li><li id="elb_qs_0003__li18940143983112">Click <strong id="elb_qs_0003__en-us_elb_02_0001_b1091017182520">Create Now</strong>.</li><li id="elb_qs_0003__li9984122593614">Confirm the configuration and submit your request.</li><li id="elb_qs_0003__li15984202593610">View the newly created load balancer in the load balancer list.</li></ol>
<div class="note" id="elb_qs_0003__note171711554395"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="elb_qs_0003__elb_qs_0002_p817755163912">After you create a dedicated load balancer, configure the security group that contains the ECSs to allow traffic from the VPC where the load balancer works.</p>
</div></div>
</div>
<div class="section" id="elb_qs_0003__section26032025134916"><h4 class="sectiontitle">Procedure</h4><ol id="elb_qs_0003__elb_ug_hd_0007_ol198141563813"><li id="elb_qs_0003__elb_ug_hd_0007_li677391520332">Log in to the management console.</li><li id="elb_qs_0003__elb_ug_hd_0007_li675519100420">In the upper left corner of the page, click <span><img id="elb_qs_0003__elb_ug_hd_0007_en-us_topic_0240829509_image1542118117117" src="en-us_image_0000001211126503.png"></span> and select the desired region and project.</li><li id="elb_qs_0003__elb_ug_hd_0007_en-us_topic_0029320966_li50026016224047">Hover on <span><img id="elb_qs_0003__elb_ug_hd_0007_image2028816163126" src="en-us_image_0000001167495475.png"></span> in the upper left corner to display <strong id="elb_qs_0003__elb_ug_hd_0007_b2027155551116">Service List</strong> and choose <strong id="elb_qs_0003__elb_ug_hd_0007_b060433420256">Computing</strong> &gt; <strong id="elb_qs_0003__elb_ug_hd_0007_b1606334112520">Elastic Cloud Server</strong>.</li><li id="elb_qs_0003__elb_ug_hd_0007_li34401539214315">In the ECS list, locate the ECS and click its name.<p id="elb_qs_0003__elb_ug_hd_0007_p19982029214319"><a name="elb_qs_0003__elb_ug_hd_0007_li34401539214315"></a><a name="elb_ug_hd_0007_li34401539214315"></a>The ECS details page is displayed.</p>
</li><li id="elb_qs_0003__elb_ug_hd_0007_li18750165432511">Click <strong id="elb_qs_0003__elb_ug_hd_0007_b8423527069595">Security Groups</strong>, locate the security group, and view security group rules.</li><li id="elb_qs_0003__elb_ug_hd_0007_li45534692214355">Click the security group rule ID or <strong id="elb_qs_0003__elb_ug_hd_0007_b156915342119">Modify Security Group Rule</strong>. The security group details page is displayed.</li><li id="elb_qs_0003__elb_ug_hd_0007_en-us_topic_0029320966_li46525942225810">Under <strong id="elb_qs_0003__elb_ug_hd_0007_b9614133719114">Inbound Rules</strong>, click <strong id="elb_qs_0003__elb_ug_hd_0007_b2917144512114">Add Rule</strong>.<p id="elb_qs_0003__elb_ug_hd_0007_p4142315143212"><strong id="elb_qs_0003__elb_ug_hd_0007_b31272371231">TCP, HTTP, or HTTPS listeners</strong></p>
<ul id="elb_qs_0003__elb_ug_hd_0007_ul432212011336"><li id="elb_qs_0003__elb_ug_hd_0007_li632211204331">If the health check port is not the one used by each backend server, add an inbound rule to allow TCP traffic over the health check port and the ports used by backend servers.</li><li id="elb_qs_0003__elb_ug_hd_0007_li4322172093312">If you do not specify a health check port, add inbound rules to allow TCP traffic over the ports used by backend servers.</li><li id="elb_qs_0003__elb_ug_hd_0007_li7827112682715">To ensure normal health checks, ensure that security group rules allow traffic from the CIDR block of the subnet where the load balancer resides and traffic from the health check port and from the ports used by backend servers.</li></ul>
<p id="elb_qs_0003__elb_ug_hd_0007_p115214116334"><strong id="elb_qs_0003__elb_ug_hd_0007_b1725184415317">UDP listeners</strong></p>
<ul id="elb_qs_0003__elb_ug_hd_0007_ul166533361923"><li id="elb_qs_0003__elb_ug_hd_0007_li46536362215">If the health check port is not the one used by each backend server, add an inbound rule to allow UDP traffic over the health check port and the ports used by backend servers.</li><li id="elb_qs_0003__elb_ug_hd_0007_li116531636426">If you do not specify a health check port, add inbound rules to allow UDP traffic over the ports used by backend servers.</li><li id="elb_qs_0003__elb_ug_hd_0007_li17595112922814">To ensure normal health checks, ensure that security group rules allow traffic from the CIDR block of the subnet where the load balancer resides and traffic from the health check port and from the ports used by backend servers.</li><li id="elb_qs_0003__elb_ug_hd_0007_li106545361424">You need also to add an inbound rule to allow ICMP traffic.</li></ul>
</li><li id="elb_qs_0003__elb_ug_hd_0007_li1030715242413">Click <strong id="elb_qs_0003__elb_ug_hd_0007_b8423527061928">OK</strong>.</li></ol>
</div>
<div class="section" id="elb_qs_0003__section1261104918577"><h4 class="sectiontitle">Firewall Rules</h4><p id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_p3997193819710">To control traffic in and out of a subnet, you can associate a <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph1934982914313">firewall</span> with the subnet. Similar to security groups, <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph3501184023112">firewall</span>s control access to subnets and add an additional layer of defense to your subnets. Default <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph548414447310">firewall</span> rules reject all inbound and outbound traffic. If the subnet of a load balancer or associated backend servers has a <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph25361348193120">firewall</span> associated, the load balancer cannot receive traffic from the Internet or route traffic to backend servers, and backend servers cannot receive traffic from and respond to the load balancer.</p>
<p id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_p79433211595">Configure an inbound <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph13483315193217">firewall</span> rule to allow traffic from the VPC where the load balancer works to backend servers.</p>
<ol id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ol17965143881417"><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li20860192818532">Log in to the management console.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li1486022812537">In the upper left corner of the page, click <span><img id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_en-us_topic_0240829509_image1542118117117" src="en-us_image_0000001211126503.png"></span> and select the desired region and project.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li59941052152319">Click <span><img id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_en-us_topic_0052569751_image762510132322" src="en-us_image_0000001508946757.png"></span> in the upper left corner of the page and choose <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b25374601717">Network</strong> &gt; <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b162201329201711">Virtual Private Cloud</strong>.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li47160469161557">In the navigation pane on the left, choose <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b59331338171717">Access Control</strong> &gt; <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b29361638161712"><span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph293519386171">Firewall</span></strong>.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li30045754154757">In the <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph1592150133217">firewall</span> list, click the name of the <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph181401455183218">firewall</span> to switch to the page showing its details.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li1976338154757">On the <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b16992330173711">Inbound Rules</strong> or <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b1499353014377">Outbound Rules</strong> tab page, click <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b7993030143715">Add Rule</strong> to add a rule.<ul id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ul185172012178"><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li4511820191719"><strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b103837331378">Action</strong>: Select <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b11383173311379">Allow</strong>.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li8626942141716"><strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b145321729111419">Protocol</strong>: The protocol must be the same as the one you selected for the listener.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li9500202313188"><strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b597212111711">Source</strong>: Set it to the VPC CIDR block.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li66251610162417"><strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b27061041103719">Source Port Range</strong>: Select a port range.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li7464162916350"><strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b176581841131420">Destination</strong>: If you keep the default value, <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b12659154112143">0.0.0.0/0</strong>, traffic will be allowed for all destination IP addresses.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li5915133319341"><strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b2408174419143">Destination Port Range</strong>: Select a port range.</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li75457153520">(Optional) <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b1732114010406">Description</strong>: Describe the <span id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_ph171149155338">firewall</span> rule.</li></ul>
</li><li id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_li162953310168">Click <strong id="elb_qs_0003__elb_qs_0002_elb_ug_hd_0007_b1590315817230">OK</strong>.</li></ol>
</div>
<div class="section" id="elb_qs_0003__section184861920245"><h4 class="sectiontitle">Adding a Listener</h4><p id="elb_qs_0003__en-us_elb_02_0001_p845424162316">Add a listener to the created load balancer. When you add the listener, create a backend server group, configure a health check, and add the two ECSs to the created backend server group.</p>
<div class="p" id="elb_qs_0003__en-us_elb_02_0001_p174950177514">Configure two forwarding policies to forward HTTP requests to the two ECSs, for example, requests from <strong id="elb_qs_0003__en-us_elb_02_0001_b313723134313">www.example.com/ELB01/</strong> to ECS01, and those from <strong id="elb_qs_0003__en-us_elb_02_0001_b1313783194314">www.example.com/ELB02/</strong> to ECS02.<div class="fignone" id="elb_qs_0003__en-us_elb_02_0001_fig1585611052513"><span class="figcap"><b>Figure 4 </b>Traffic forwarding</span><br><span><img class="vsd" id="elb_qs_0003__en-us_elb_02_0001_image115200401353" src="en-us_image_0198607881.png"></span></div>
</div>
<ol id="elb_qs_0003__en-us_elb_02_0001_ol5476154122712"><li id="elb_qs_0003__en-us_elb_02_0001_li122074130268">Hover on <span><img id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_image762510132322" src="en-us_image_0000001417088430.png"></span> in the upper left corner to display <strong id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_b9121102522212">Service List</strong> and choose <strong id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_b61222025142217">Network</strong> &gt; <strong id="elb_qs_0003__en-us_elb_02_0001_en-us_topic_0052569751_b4124425142210">Elastic Load Balancing</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li44618046152949">Locate the created load balancer and click its name.</li><li id="elb_qs_0003__en-us_elb_02_0001_li13174175374113">Under <strong id="elb_qs_0003__en-us_elb_02_0001_b1155619280162">Listeners</strong>, click <strong id="elb_qs_0003__en-us_elb_02_0001_b8558152814164">Add Listener</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li3525459183317">Configure the listener and click <strong id="elb_qs_0003__en-us_elb_02_0001_b7315836111710">Next</strong>.<ul id="elb_qs_0003__en-us_elb_02_0001_ul19799192211283"><li id="elb_qs_0003__en-us_elb_02_0001_li1680042242817"><strong id="elb_qs_0003__en-us_elb_02_0001_b11154920174012">Name</strong>: Enter a name, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b1315572024011">listener-HTTP</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li361710862912"><strong id="elb_qs_0003__en-us_elb_02_0001_b10904329184017">Frontend Protocol/Port</strong>: Select a protocol and enter a port for the load balancer to receive requests. For example, set it to <strong id="elb_qs_0003__en-us_elb_02_0001_b4905329154010">HTTP</strong> and <strong id="elb_qs_0003__en-us_elb_02_0001_b69062293400">80</strong>.</li></ul>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li446913175196">Create a backend server group, configure a health check, and click <strong id="elb_qs_0003__en-us_elb_02_0001_b1488914161912">Finish</strong>.<ul id="elb_qs_0003__en-us_elb_02_0001_ul12469417191910"><li id="elb_qs_0003__en-us_elb_02_0001_li74691170194">Backend server group<ul id="elb_qs_0003__en-us_elb_02_0001_ul1346941761917"><li id="elb_qs_0003__en-us_elb_02_0001_li7469161717192"><strong id="elb_qs_0003__en-us_elb_02_0001_b1871985617407">Name</strong>: Enter a name, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b157312563402">server_group-ELB</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li94694172199"><strong id="elb_qs_0003__en-us_elb_02_0001_b13427203134119">Load Balancing Algorithm</strong>: Select an algorithm that the load balancer will use to route requests, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b94422354118">Weighted round robin</strong>.</li></ul>
</li></ul>
<ul id="elb_qs_0003__en-us_elb_02_0001_ul1646920173194"><li id="elb_qs_0003__en-us_elb_02_0001_li846910176194">Health check<ul id="elb_qs_0003__en-us_elb_02_0001_ul046931771916"><li id="elb_qs_0003__en-us_elb_02_0001_li1646931771918"><strong id="elb_qs_0003__en-us_elb_02_0001_b16173141134118">Protocol</strong>: Select a protocol for the load balancer to perform health checks on backend servers. If the load balancer uses TCP, HTTP, or HTTPS to receive requests, the health check protocol can be TCP or HTTP. Here we use HTTP as an example. Note that the protocol cannot be changed after the listener is added.</li><li id="elb_qs_0003__en-us_elb_02_0001_li104691517151910"><strong id="elb_qs_0003__en-us_elb_02_0001_b197234311812">Domain Name</strong>: Enter a domain name that will be used for health checks, for example, www.example.com.</li><li id="elb_qs_0003__en-us_elb_02_0001_li546971711191"><strong id="elb_qs_0003__en-us_elb_02_0001_b92914183911">Port</strong>: Enter a port for the load balancer to perform health checks on backend servers, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b174010189913">80</strong>.</li></ul>
</li></ul>
</li></ol>
</div>
<div class="section" id="elb_qs_0003__section6778123018276"><h4 class="sectiontitle">Adding Forwarding Policies</h4><ol id="elb_qs_0003__en-us_elb_02_0001_ol16279105810277"><li id="elb_qs_0003__en-us_elb_02_0001_li1279175813279"><a name="elb_qs_0003__en-us_elb_02_0001_li1279175813279"></a><a name="en-us_elb_02_0001_li1279175813279"></a>Click the name of the newly added listener and then click <strong id="elb_qs_0003__en-us_elb_02_0001_b9882400396">Add</strong> next to <strong id="elb_qs_0003__en-us_elb_02_0001_b86040264407">Forwarding Policies</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li42791058102718">Configure the forwarding policy and click <strong id="elb_qs_0003__en-us_elb_02_0001_b10444112104111">Next</strong>.<ul id="elb_qs_0003__en-us_elb_02_0001_ul4782734162215"><li id="elb_qs_0003__en-us_elb_02_0001_li197823348223"><strong id="elb_qs_0003__en-us_elb_02_0001_b4608566412">Name</strong>: Enter a name for the forwarding policy, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b44183274611">forwarding_policy-ELB01</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li2078323419221"><strong id="elb_qs_0003__en-us_elb_02_0001_b12425142215413">Domain Name</strong>: Enter a domain name that will be used to forward the requests, for example, www.example.com. The domain name in the request must exactly match that specified in the forwarding policy.</li><li id="elb_qs_0003__en-us_elb_02_0001_li2739202722519"><strong id="elb_qs_0003__en-us_elb_02_0001_b123583411346">URL</strong>: You can also specify a URL to forward the requests, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b148561716482">/ELB01/</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li66261226102716"><strong id="elb_qs_0003__en-us_elb_02_0001_b79391032104812">URL Matching Rule</strong>: Select a rule for matching the specified URL string with the URL in the request. Three options are available, <strong id="elb_qs_0003__en-us_elb_02_0001_b15790544155219">Exact match</strong>, <strong id="elb_qs_0003__en-us_elb_02_0001_b7835482526">Prefix match</strong>, and <strong id="elb_qs_0003__en-us_elb_02_0001_b1216005235216">Regular expression match</strong>. <strong id="elb_qs_0003__en-us_elb_02_0001_b7615161517535">Exact match</strong> enjoys the highest priority, and <strong id="elb_qs_0003__en-us_elb_02_0001_b115315113531">Regular expression match</strong> the lowest priority. Select <strong id="elb_qs_0003__en-us_elb_02_0001_b133317381237">Exact match</strong> here.</li></ul>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li12748141114321">Add the backend <span id="elb_qs_0003__en-us_elb_02_0001_text21372058191113">server</span> group and configure a health check.<ul id="elb_qs_0003__en-us_elb_02_0001_ul1274861111325"><li id="elb_qs_0003__en-us_elb_02_0001_li11748611203214">Backend <span id="elb_qs_0003__en-us_elb_02_0001_text1968719251596">server</span> group<ul id="elb_qs_0003__en-us_elb_02_0001_ul17748131123211"><li id="elb_qs_0003__en-us_elb_02_0001_li15748191119321"><strong id="elb_qs_0003__en-us_elb_02_0001_b19948129125418">Name</strong>: Enter a name, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b2324520125414">server_group-ELB01</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li1374821120322"><strong id="elb_qs_0003__en-us_elb_02_0001_b189541551103819">Load Balancing Algorithm</strong>: Select an algorithm that the load balancer will use to route requests, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b16955105119388">Weighted round robin</strong>.</li></ul>
</li></ul>
<ul id="elb_qs_0003__en-us_elb_02_0001_ul1574861111327"><li id="elb_qs_0003__en-us_elb_02_0001_li374812116329">Health check<ul id="elb_qs_0003__en-us_elb_02_0001_ul16748141112321"><li id="elb_qs_0003__en-us_elb_02_0001_li1574819117322"><strong id="elb_qs_0003__en-us_elb_02_0001_b178964583387">Protocol</strong>: Select a protocol for the load balancer to perform health checks on backend servers. If the load balancer uses TCP, HTTP, or HTTPS to receive requests, the health check protocol can be TCP or HTTP. Here we use HTTP as an example. Note that the protocol cannot be changed after the listener is added.</li><li id="elb_qs_0003__en-us_elb_02_0001_li1174891118325"><strong id="elb_qs_0003__en-us_elb_02_0001_b6493182083918">Domain Name</strong>: Enter a domain name that will be used for health checks, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b134946203393">www.example.com</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li574820119321"><strong id="elb_qs_0003__en-us_elb_02_0001_b19139102715398">Port</strong>: Enter a port for the load balancer to perform health checks on backend servers, for example, <strong id="elb_qs_0003__en-us_elb_02_0001_b9150627143917">80</strong>.</li></ul>
</li></ul>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li614204520397">Select the newly added forwarding policy. On the <strong id="elb_qs_0003__en-us_elb_02_0001_b77345913115">Backend Server Groups</strong> tab page on the right, click <strong id="elb_qs_0003__en-us_elb_02_0001_b18473129812">Add</strong>.</li><li id="elb_qs_0003__en-us_elb_02_0001_li19903154544217"><a name="elb_qs_0003__en-us_elb_02_0001_li19903154544217"></a><a name="en-us_elb_02_0001_li19903154544217"></a>Select the server you want to add, set the backend port, and click <strong id="elb_qs_0003__en-us_elb_02_0001_b161061650880">Finish</strong>.<ul id="elb_qs_0003__en-us_elb_02_0001_ul19482182214415"><li id="elb_qs_0003__en-us_elb_02_0001_li2048352284418">Backend server: ECS01</li><li id="elb_qs_0003__en-us_elb_02_0001_li6483922104411">Backend port: Set it to <strong id="elb_qs_0003__en-us_elb_02_0001_b197391301571">80</strong>. Backend servers will use this port to communicate with the load balancer.</li></ul>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li1423765125218">Repeat <a href="#elb_qs_0003__en-us_elb_02_0001_li1279175813279">1</a> to <a href="#elb_qs_0003__en-us_elb_02_0001_li19903154544217">5</a> to add another forwarding policy, create a backend server group, and add ECS02 to the backend server group. Configure the parameters.</li></ol>
</div>
<div class="section" id="elb_qs_0003__section164467272278"><h4 class="sectiontitle">Verifying Load Balancing</h4><p id="elb_qs_0003__en-us_elb_02_0001_p159413171688">After the load balancer is configured, you can access the domain name or the specified URL to check whether the two ECSs are accessible.</p>
<ol id="elb_qs_0003__en-us_elb_02_0001_ol1177812309272"><li id="elb_qs_0003__en-us_elb_02_0001_li10778123092715">Modify the <strong id="elb_qs_0003__en-us_elb_02_0001_b663814318134">C:\Windows\System32\drivers\etc\hosts</strong> file on your PC to map the domain name to the load balancer EIP.<div class="p" id="elb_qs_0003__en-us_elb_02_0001_p1439294619610">View the load balancer EIP on the <strong id="elb_qs_0003__en-us_elb_02_0001_b137343111319">Basic Information</strong> page of the load balancer.<div class="fignone" id="elb_qs_0003__en-us_elb_02_0001_fig9717114412612"><span class="figcap"><b>Figure 5 </b><strong id="elb_qs_0003__en-us_elb_02_0001_b15771175144311">hosts</strong> file on your PC</span><br><span><img id="elb_qs_0003__en-us_elb_02_0001_image67171744569" src="en-us_image_0166358967.png"></span></div>
</div>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li1677863072715">On the CLI of your PC, run the following command to check whether the domain name is mapped to the load balancer EIP:<p id="elb_qs_0003__en-us_elb_02_0001_p141804481111"><a name="elb_qs_0003__en-us_elb_02_0001_li1677863072715"></a><a name="en-us_elb_02_0001_li1677863072715"></a><strong id="elb_qs_0003__en-us_elb_02_0001_b099542951110">ping www.example.com</strong></p>
<p id="elb_qs_0003__en-us_elb_02_0001_p081752681216">If data packets are returned, the domain name has been mapped to the load balancer EIP.</p>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li4888169202412">Use your browser to access <strong id="elb_qs_0003__en-us_elb_02_0001_b920312301919">http://www.example.com/ELB01/</strong>. If the following page is displayed, the load balancer has routed the request to ECS01.<div class="fignone" id="elb_qs_0003__en-us_elb_02_0001_fig174313116258"><span class="figcap"><b>Figure 6 </b>Accessing ECS01</span><br><span><img id="elb_qs_0003__en-us_elb_02_0001_image1262314345916" src="en-us_image_0166358972.png"></span></div>
<div class="note" id="elb_qs_0003__en-us_elb_02_0001_note7365102853611"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="elb_qs_0003__en-us_elb_02_0001_p1687510552309"><strong id="elb_qs_0003__en-us_elb_02_0001_b5500632182014">ELB01/</strong> indicates that the default directory named <strong id="elb_qs_0003__en-us_elb_02_0001_b137021434103312">ECS01</strong> is accessed, while <strong id="elb_qs_0003__en-us_elb_02_0001_b666117341212">ELB01</strong> indicates the file name. Therefore, the slash (/) following <strong id="elb_qs_0003__en-us_elb_02_0001_b354832612210">ELB01</strong> must be retained.</p>
</div></div>
</li><li id="elb_qs_0003__en-us_elb_02_0001_li1497010584220">Use your browser to access <strong id="elb_qs_0003__en-us_elb_02_0001_b6514135572416">http://www.example.com/ELB02/</strong>. If the following page is displayed, the load balancer has routed the request to ECS02.<div class="fignone" id="elb_qs_0003__en-us_elb_02_0001_fig897020534220"><span class="figcap"><b>Figure 7 </b>Accessing ECS02</span><br><span><img id="elb_qs_0003__en-us_elb_02_0001_image139479102108" src="en-us_image_0166358975.png"></span></div>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="elb_qs_0000.html">Getting Started</a></div>
</div>
</div>