LVS cluster configuration-Nat implementation configuration

Source: Internet
Author: User

Nat implementation process. Because it is an experimental environment, the network topology is relatively simple.



650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/41/66/wKioL1PVCxLDTvz7AAF6vS8I9Po085.jpg "Title =" topological structure .png "alt =" wkiol1pvcxldtvz7aaf6vs8i9po085.jpg "/>

Experiment with Web Services

The client does not need any configuration.

On the server side, real server1 and real server2 can install the required httpd services. If a firewall is configured, the firewall will be switched off if no firewall is configured.


Let's take a look at Director's configuration.

First install ipvsadm Software

You can use RPM or the source code package for installation.

Here I use the RPM package for installation. The RPM package used this time is not in the usual package directory, but in the loadbalance directory. You can directly switch to the loadbalance directory and

Rpm-ihv ipvsadm-xxxxx.rpm

You can also configure the loadbalance directory to the yum repository. This is omitted ............

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/41/66/wKioL1PVBTHDdQolAACHR5hP9Rk372.jpg "Title =" oy ~ %} Lcu3) P {5oog $ ~ 9{[ek.jpg "alt =" wkiol1pvbthddqolaachr5hp9rk372.jpg "/>

Then use the ipvsadm command to configure LVS

Ipvsadm usage

Create a virtual server

-A: Add a virtual server

-D. delete a virtual server.

-E. Modify the scheduling algorithm.

-T set the cluster address (VIP)

-S: Specify the Load Scheduling Algorithm

Add or delete server nodes

-A: Add a Real Server

-D. Delete the Real Server.

-R specifies the Real Server IP address rip

-M uses the NAT Mode

-G uses Dr Mode

-I use the Tun Mode

-W: Set the weight

The scheduling algorithm we use here is RR, which is the polling mode. You can define the mode yourself.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/41/65/wKiom1PVBhzCoktMAACUeVQdalw260.jpg "style =" float: none; "Title =" P {EBR] L (P} ts2czo ~ Export xuzlq.jpg "alt =" wkiom1pvbhzcoktmaacuevqdalw260.jpg "/>

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/41/66/wKioL1PVBzaQH8QZAAHPcxdRkn8594.jpg "style =" float: none; "Title =" co1h] c4edxs_pi1} k] 5f ~ 3k.jpg "alt =" wkiol1pvbzaqh8qzaahpcxdrkn8594.jpg "/>

The default weight is 1. You can set it by yourself. After-M, add-W 2 to set the weight to 2.



Enable Director ip_forward. The default value is 0 and 650 is not enabled.) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/41/65/wKiom1PVB1GBUOdHAAMcrAZgw1M683.jpg "Title =" hgeigaduw0njtt0tj8jwltk9.jpg "alt =" yellow "/>

Then reload the configuration file.

Sysctl-P



Okay. If you want to save it, save it, similar to the iptables mechanism.

Service ipvsadm save


You can test it from the client.

Http: // 192.168.20.1


There was an episode in the middle of the configuration.


650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/41/66/wKioL1PVCZSQlB8fAABNEGWQV28382.jpg "Title ="} 2 @ f33uw4) 7 lffw [F $ mu7 ~ 2. jpg "alt =" wkiol1pvczsqlb8faabnegwqv28382.jpg "/>

Now we can see it at a glance. Yes, the port is missing behind the IP address ........................ 650) This. width = 650; "src =" http://img.baidu.com/hi/jx2/j_0016.gif "alt =" j_0016.gif "/>

This article from the "Linux cainiao" blog, please be sure to keep this source http://ludihua.blog.51cto.com/4601284/1531027

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.