LVSポーリングサーバセット


クラスタ
a)              ,             
b)            ,       ,                
c)                、   、             
d)               
  
1)    
2)    
3)     
4)     

      (LB)  LVS   Haproxy
     (HA)  keepalived   RHCS

LVSアプリケーションクラスタ
配置NATモード
[     ] 192.168.2.253       CIP:   IP
        192.168.2.50    VIP:      IP(       IP)
[   ]   
        192.168.4.50    DIP: RIP  (       IP)
        192.168.4.51
[     ]             RIP:      IP
        192.168.4.52
    :
      ,  IP VIP, IP CIP,    VIP ,        IP   RIP,  IP  ,  DIP        ,            , IP RIP,  IP CIP,  DIP ,        IP   VIP,    VIP    CIP         
a)        
#/etc/sysctl.conf
sed -i '7s/0/1/' /etc/sysctl/conf
#sysctl -p       
b)     ipvsadm
yum -y install ipvsadm...
c)      
[   ]
#route add default gw 192.168.2.50   /sed -i '$aGAETWAY=192.168.2.50' /etc/sysconfig/network-scripe/ifc-eth0
[     ]
#route add default gw 192.168.4.50
d)      
#ipvsadm -A -t 192.168.2.50:80 -s rr    
    -E                              
#ipvsadm -a -t 192.168.2.50:80 -r 192.168.4.51:80 -m   
    -e                               nat  
#ipvsadm -a -t 192.168.2.50:80 -r 192.168.4.52:80 -m
#service ipvsadm save         
#cat /etc/sysconfig/ipvsadm
#ipvsadm -ln --stats          
#watch -d 1 ipvsadm -ln -stats      

配備DRモード
[     ] 192.168.4.253       CIP:   IP
        192.168.4.252   VIP:      IP(       IP)
[   ]   
        192.168.4.50    DIP: RIP  (       IP)
        192.168.4.51                        192.168.4.252
[     ]             RIP:      IP                    VIP
        192.168.4.52                        192.168.4.252

    :
         lo      VIP   ,      IP VIP ,       
       VIP
        ,        RIP, RIP      ,  lo   VIP    。

[     51/52]   VIP  ,      
ifconfig lo:1 192.168.4.252/32
  /proc/sys/net/ipv4/conf/lo/
echo 1 > arp_ignore     arp_ignore:    arp       
echo 2 > arp_announce       arp_announce:      
  /proc/sys/net/ipv4/conf/all/
echo 1 > arp_ignore
echo 2 > arp_announce

[   ]  VIP  
ifconfig eth0:1 192.168.4.252/32
    : 
#service network restart

#ipvsadm -A -t 192.168.4.252:80 -s rr
#ipvsadm -a -t 192.168.4.252:80 -r 192.168.4.51:80       ,   DR  
#ipvsadm -a -t 192.168.4.252:80 -r 192.168.4.52:80 
#service ipvsadm save
#watch -d 1 ipvsadm -ln -stats