심히 걱정된다 - 2008/08/20 10:00
LVS Setup
===============================================================================
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/index.html 참고
http://www.linuxvirtualserver.org/VS-DRouting.html 참고
┌--------┐
│ client │ (local or on internet)
└--------┘
CIP
│
(router)
DGW
│ outside network
│
VIP
│
┌----┴----┐
│ director │(director can have 1 or 2 NICs)
└----------┘
DIP (and PIP)
│
│ DRIP network
┌---------------┼------------------┐
│ │ │
│ │ │
RIP1 RIP2 RIP3
┌------------┐ ┌------------┐ ┌------------┐
│ realserver │ │ realserver │ │ realserver │
└------------┘ └------------┘ └------------┘
===============================================================================
┌---------------------------------------------------------------------------┐
│Director 설정 │
└---------------------------------------------------------------------------┘
1. yum install ipvsadm
2. 패킷포워딩 ON
vi /etc/sysctl.conf
-----------------------------------------------------
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
-----------------------------------------------------
sysctl -p
3. VIP 세팅
ifconfig eth0:0 61.32.177.160 netmask 255.255.255.128
4. LVS 세팅
VIP:61.32.177.160 / Port:80 /스캐줄링:wlc / Gate방식
------------------------------------------------------
ipvsadm -C
ipvsadm -A -t 61.32.177.160:80 -s wlc
ipvsadm -a -t 61.32.177.160:80 -r 61.32.177.162:80 -g
ipvsadm -a -t 61.32.177.160:80 -r 61.32.177.163:80 -g
------------------------------------------------------
5. 서버리부팅시 IP 설정을 위하여 /root/ip.sh 로 저장
---------------------------------------------------
#!bin/sh
ifconfig eth0:0 61.32.177.160 netmask 255.255.255.128
------------------------------------------------------
vi /etc/rc.d/rc.local
------------------------------------------------------
/root/ip.sh 추가
================================================================================
┌----------------------------------------------------------------------------┐
│realserver 1 setup │
└----------------------------------------------------------------------------┘
1. yum install arptables_jf
2. arptalbes 세팅
arptables -A IN -j DROP -d 61.32.177.160
arptables -A OUT -j mangle -o eth0 -s 61.32.177.160 --mangle-ip-s 61.32.177.162
service arptalbes_jf save ==> /etc/sysconfig/arptables 에 저장
---------------------------------------------------------------------------------
# Generated by arptables-save v0.0.8 on Mon Jul 14 14:03:44 2008
*filter
:IN ACCEPT [2:56]
:OUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
[0:0] -A IN -d 61.32.177.160 -j DROP
[0:0] -A OUT -s 61.32.177.160 -o eth0 -j mangle --mangle-ip-s 61.32.177.162
COMMIT
# Completed on Mon Jul 14 14:03:44 2008
---------------------------------------------------------------------------------
3. VIP 세팅
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
4. 서버리부팅시 IP 설정을 위하여 /root/ip.sh 로 저장
---------------------------------------------------------------------------------
#!bin/sh
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
---------------------------------------------------------------------------------
vi /etc/rc.d/rc.local
------------------------------------------------------------------------------
/root/ip.sh 추가
=================================================================================
┌-----------------------------------------------------------------------------┐
│realserver 2 setup │
└-----------------------------------------------------------------------------┘
1. yum install arptables_jf
2. arptalbes 세팅
arptables -A IN -j DROP -d 61.32.177.160
arptables -A OUT -j mangle -o eth0 -s 61.32.177.160 --mangle-ip-s 61.32.177.163
service arptalbes_jf save ==> /etc/sysconfig/arptables 에 저장
----------------------------------------------------------------------------------
# Generated by arptables-save v0.0.8 on Mon Jul 14 14:03:44 2008
*filter
:IN ACCEPT [2:56]
:OUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
[0:0] -A IN -d 61.32.177.160 -j DROP
[0:0] -A OUT -s 61.32.177.160 -o eth0 -j mangle --mangle-ip-s 61.32.177.163
COMMIT
# Completed on Mon Jul 14 14:03:44 2008
----------------------------------------------------------------------------------
3. VIP 세팅
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
4. 서버리부팅시 IP 설정을 위하여 /root/ip.sh 로 저장
----------------------------------------------------------------------------------
#!bin/sh
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
----------------------------------------------------------------------------------
vi /etc/rc.d/rc.local
----------------------------------------------------------------------------------
/root/ip.sh 추가
================================================================================END
===============================================================================
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/index.html 참고
http://www.linuxvirtualserver.org/VS-DRouting.html 참고
┌--------┐
│ client │ (local or on internet)
└--------┘
CIP
│
(router)
DGW
│ outside network
│
VIP
│
┌----┴----┐
│ director │(director can have 1 or 2 NICs)
└----------┘
DIP (and PIP)
│
│ DRIP network
┌---------------┼------------------┐
│ │ │
│ │ │
RIP1 RIP2 RIP3
┌------------┐ ┌------------┐ ┌------------┐
│ realserver │ │ realserver │ │ realserver │
└------------┘ └------------┘ └------------┘
===============================================================================
┌---------------------------------------------------------------------------┐
│Director 설정 │
└---------------------------------------------------------------------------┘
1. yum install ipvsadm
2. 패킷포워딩 ON
vi /etc/sysctl.conf
-----------------------------------------------------
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
-----------------------------------------------------
sysctl -p
3. VIP 세팅
ifconfig eth0:0 61.32.177.160 netmask 255.255.255.128
4. LVS 세팅
VIP:61.32.177.160 / Port:80 /스캐줄링:wlc / Gate방식
------------------------------------------------------
ipvsadm -C
ipvsadm -A -t 61.32.177.160:80 -s wlc
ipvsadm -a -t 61.32.177.160:80 -r 61.32.177.162:80 -g
ipvsadm -a -t 61.32.177.160:80 -r 61.32.177.163:80 -g
------------------------------------------------------
5. 서버리부팅시 IP 설정을 위하여 /root/ip.sh 로 저장
---------------------------------------------------
#!bin/sh
ifconfig eth0:0 61.32.177.160 netmask 255.255.255.128
------------------------------------------------------
vi /etc/rc.d/rc.local
------------------------------------------------------
/root/ip.sh 추가
================================================================================
┌----------------------------------------------------------------------------┐
│realserver 1 setup │
└----------------------------------------------------------------------------┘
1. yum install arptables_jf
2. arptalbes 세팅
arptables -A IN -j DROP -d 61.32.177.160
arptables -A OUT -j mangle -o eth0 -s 61.32.177.160 --mangle-ip-s 61.32.177.162
service arptalbes_jf save ==> /etc/sysconfig/arptables 에 저장
---------------------------------------------------------------------------------
# Generated by arptables-save v0.0.8 on Mon Jul 14 14:03:44 2008
*filter
:IN ACCEPT [2:56]
:OUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
[0:0] -A IN -d 61.32.177.160 -j DROP
[0:0] -A OUT -s 61.32.177.160 -o eth0 -j mangle --mangle-ip-s 61.32.177.162
COMMIT
# Completed on Mon Jul 14 14:03:44 2008
---------------------------------------------------------------------------------
3. VIP 세팅
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
4. 서버리부팅시 IP 설정을 위하여 /root/ip.sh 로 저장
---------------------------------------------------------------------------------
#!bin/sh
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
---------------------------------------------------------------------------------
vi /etc/rc.d/rc.local
------------------------------------------------------------------------------
/root/ip.sh 추가
=================================================================================
┌-----------------------------------------------------------------------------┐
│realserver 2 setup │
└-----------------------------------------------------------------------------┘
1. yum install arptables_jf
2. arptalbes 세팅
arptables -A IN -j DROP -d 61.32.177.160
arptables -A OUT -j mangle -o eth0 -s 61.32.177.160 --mangle-ip-s 61.32.177.163
service arptalbes_jf save ==> /etc/sysconfig/arptables 에 저장
----------------------------------------------------------------------------------
# Generated by arptables-save v0.0.8 on Mon Jul 14 14:03:44 2008
*filter
:IN ACCEPT [2:56]
:OUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
[0:0] -A IN -d 61.32.177.160 -j DROP
[0:0] -A OUT -s 61.32.177.160 -o eth0 -j mangle --mangle-ip-s 61.32.177.163
COMMIT
# Completed on Mon Jul 14 14:03:44 2008
----------------------------------------------------------------------------------
3. VIP 세팅
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
4. 서버리부팅시 IP 설정을 위하여 /root/ip.sh 로 저장
----------------------------------------------------------------------------------
#!bin/sh
ifconfig lo:0 61.32.177.160 netmask 255.255.255.255 broadcast 61.32.177.160 up
route add -host 61.32.177.160 dev lo:0
----------------------------------------------------------------------------------
vi /etc/rc.d/rc.local
----------------------------------------------------------------------------------
/root/ip.sh 추가
================================================================================END
TAG
Trackback Address ::
http://blog.jinbo.net/manim/trackback/26