Linux LVS load Balancing NAT mode

Source: Internet
Author: User

The Linux LVs load Balancing is mainly used to improve the processing power of the server, improve the corresponding ability of the server, improve the concurrency processing ability, and reasonable resource allocation.

Address translation: referred to as NAT mode, similar to the firewall of the private network structure, the load scheduler as a gateway to all server nodes, that is, as a client access to the portal, but also the nodes to respond to the client's access exits. The server node uses a private IP address. In the same physical network as the load scheduler, security is superior to the other two , but performance is not very good because the scheduler provides both ingress and egress.

LVS is now part of the LINUX kernel, which is compiled by default as a ip_vs module, manually loading IP _vs module and view The version information of the Ip_vs module in the current system.


650) this.width=650; "title=" 1 "alt=" wkiom1vijicg9mcgaae9jmjkcdo422.jpg "src=" http://s3.51cto.com/wyfs02/M01/6C/61 /wkiom1vijicg9mcgaae9jmjkcdo422.jpg "/>

Install the ipvsadm-1.25-9 package.

650) this.width=650; "title=" 2 "alt=" Wkiol1vikeqal31zaadak3_bhzy506.jpg "src=" Http://s3.51cto.com/wyfs02/M00/6C/5D /wkiol1vikeqal31zaadak3_bhzy506.jpg "/>

Configure the SNAT forwarding policy: Modify the sysctl.conf file, turn on routing forwarding, and make the changes effective in Nat of the table postrouting create on Rule chain SNAT policy.


650) this.width=650; "title=" 3 "style=" Float:none; "alt=" wkiol1vikbstzpohaabmoqap_ca870.jpg "src="/HTTP/ S3.51cto.com/wyfs02/m01/6c/5d/wkiol1vikbstzpohaabmoqap_ca870.jpg "/>

650) this.width=650; "title=" 4 "style=" Float:none; "alt=" wkiom1vikewreuv2aaakke-n0l0226.jpg "src="/HTTP/ S3.51cto.com/wyfs02/m01/6c/61/wkiom1vikewreuv2aaakke-n0l0226.jpg "/>

650) this.width=650; "title=" 5 "style=" Float:none; "alt=" wkiol1vikbxzsj38aabbxccw0du657.jpg "src="/HTTP/ S3.51cto.com/wyfs02/m02/6c/5d/wkiol1vikbxzsj38aabbxccw0du657.jpg "/>




1) To Configure a load distribution policy:


650) this.width=650; "title=" 1.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/6C/68/ Wkiom1vijujxxyisaaa8a2kvceg468.jpg "alt=" Wkiom1vijujxxyisaaa8a2kvceg468.jpg "/>

650) this.width=650; "title=" 2.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/6C/64/ Wkiol1vijrndxbpdaabgguxlzqc438.jpg "alt=" Wkiol1vijrndxbpdaabgguxlzqc438.jpg "/>


2) Configure the shared storage service on the shared storage device host (using the NFS Publishing Sharing service here), as follows:

nfs Implementation of the service depends on rpc ( remote   Process  call rhel6 system, you need to install   Span style= "FONT-FAMILY:CALIBRI;" >nfs-utils rpcbind Span style= "font-family: ' The song Body '; > package to provide nfs Shared service, which is used for Span style= "FONT-FAMILY:CALIBRI;" >nfs shared publishing and access, which is used for rpc Span style= "font-family: ' The song Body '; > support

650) this.width=650; "title=" 3.png "src=" Http://s3.51cto.com/wyfs02/M01/6C/64/wKioL1VIj8viou2cAAAnCFNdt2E172.jpg " alt= "Wkiol1vij8viou2caaancfndt2e172.jpg"/>

The specific configuration of the/etc/exports configuration file is as follows:

650) this.width=650; "title=" 4.png "src=" Http://s3.51cto.com/wyfs02/M02/6C/68/wKiom1VIjpzzbQdXAAAnO5ustQY058.jpg " alt= "Wkiom1vijpzzbqdxaaano5ustqy058.jpg"/>

  where the client address can be a hostname, ip address, network segment address, allow use * wildcard; in the permissions option, RW means allow read and write ( ro sync means synchronous writing, no_root_squash root identity access is given to the local root permissions


Restart Rpcbind and NFS services:

650) this.width=650; "title=" 5.png "src=" Http://s3.51cto.com/wyfs02/M00/6C/68/wKiom1VIj2aCVZLCAADm612zsdk767.jpg " alt= "Wkiom1vij2acvzlcaadm612zsdk767.jpg"/>


The two node servers only need to install the Apacheck server and connect to the shared storage to save the Web page to the shared storage

650) this.width=650; "title=" 6.png "src=" Http://s3.51cto.com/wyfs02/M01/6C/65/wKioL1VIkevxKtJEAAA9Uf1jtN4077.jpg " alt= "Wkiol1vikevxktjeaaa9uf1jtn4077.jpg"/>


The LVS Load Balancer configuration for NAT mode is complete!

Linux LVS load Balancing NAT mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.