LVS/DR Configuration

Source: Internet
Author: User

LVS/DR Configuration

Three machines:
director (eth0192.168.31.166, VIP eth0:0: 192.168.31.110)
Real Server1 (eth0 rip:192.168 31.100, VIP lo:0:192.168.31.110)
Real Server2 (eth0 rip:192.168.31.101, VIP lo:0:192.168.31.110)


Director on vim/usr/local/sbin/lvs_dr.sh//increase


#!/bin/bash
echo 1 >/proc/sys/net/ipv4/ip_forward
Ipv=/sbin/ipvsadm
vip=192.168.31.110
rs1=192.168.31.100

Rs2=192.168.31.101

Ifconfig eth0:0 down-----After modifying the parameters, you need to join this

ifconfig eth0:0 $VIP broadcast $VIP netmask 255.255.255.255 up
Route add-host $vip Dev eth0:0
$IPV-C
$IPV-A-T $VIP: 80-s RR
$IPV-A- t $vip: 80-r $rs 1:80-g-W 1
$IPV-A- t $vip: 80-r $rs 2:80-g-W 1


two RS on: vim/usr/local/sbin/lvs_dr_rs.sh
#!/bin/bash
vip=192.168.31.110
ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up
Route add-host $vip lo:0
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore

echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce


LVS/DR Configuration

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.