Experiment of Linux LVS cluster Dr model

Source: Internet
Author: User
Tags curl

LVS-DR model implements HTTP Load Balancing cluster, VIP and Dip/rip are not on the same network.

No nonsense principle, a bunch of online piles. Directly on the topology and configuration scripts.

The network topology is as follows:

1.DR configuration script:
1#!/bin/Bash2 #3 # dr Configuration Script4 5vip='10.0.0.200'6Iface='eth1:0'7mask='255.255.255.255'8port=' the'9rs1='172.16.0.101'TenRs2='172.16.0.102' OneScheduler='WRR' AType='- G' -  -  Case$1 inch the start) -     ifconfig$iface $vip netmask $mask -Iptables-F -   +Ipvsadm-a-T ${vip}:${port}-s $scheduler -Ipvsadm-a-T ${vip}:${port}-R ${rs1} $type-W 1 +Ipvsadm-a-T ${vip}:${port}-R ${rs2} $type-W 1 A     Echo "The VS Server is ready!" at     ;; - stop) -Ipvsadm-C -     ifconfig$iface Down -     Echo "The VS Server is canceled!" -     ;; in*) -     Echo "Usage: $ (basename $) start|stop" toExit1 +     ;; - Esac
2.RS configuration script:
1#!/bin/Bash2 #3 #RS配置脚本4 5vip=10.0.0.2006mask='255.255.255.255'7Dev=lo:18  Case$1 inch9 start)Ten     Echo 1>/proc/sys/net/ipv4/conf/all/Arp_ignore One     Echo 1>/proc/sys/net/ipv4/conf/lo/Arp_ignore A     Echo 2>/proc/sys/net/ipv4/conf/all/arp_announce -     Echo 2>/proc/sys/net/ipv4/conf/lo/arp_announce -     ifconfig$dev $vip netmask $mask the     Echo "The RS Server is ready!" -     ;; - stop) -     ifconfig$dev Down +     Echo 0>/proc/sys/net/ipv4/conf/all/Arp_ignore -     Echo 0>/proc/sys/net/ipv4/conf/lo/Arp_ignore +     Echo 0>/proc/sys/net/ipv4/conf/all/arp_announce A     Echo 0>/proc/sys/net/ipv4/conf/lo/arp_announce at     Echo "The RS Server is canceled!" -     ;; -*)  -     Echo "Usage: $ (basename $) start|stop" -Exit1 -     ;; in Esac
 3. Experimental results
 1  [[email protected] ~] #curl 10.0 . 0.200  2  rs_1  3  [[email protected] ~] #curl 10.0 . 0.200  4  rs_2  5  [[email protected] ~] #curl 10.0 . 0.200  6  rs_1  7  [[email protected] ~] #curl 10.0 . 0.200  8  rs_2  9  [[email protected] ~]# 

Experiment of Linux LVS cluster Dr model

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.