[클러스터] LVS-Tun 방식 설치 초 간단 정리
###### Director 및 Real Server의 kernel compile ######
* /usr/src/ 경로에 linux-2.4.26.tar.gz 파일이 있다고 가정 ( ftp://ftp.kernel.org/pub/linux/kernel/v2.4/ )
# tar xvfzp linux-2.4.26.tar.gz ==> 압축해제
# ln -s linux-2.4.26 linux ==> linux 로 심볼릭 링크
# cd /usr/include
# mv asm asm_backup ==> 기존의 헤더 파일을 새로운 헤더파일로 참조하도록 변경
# mv scsi scsi_backup
# mv linux linux_backup
# mv net net_backup
# ln -s /usr/src/linux/include/asm-i386 asm
# ln -s /usr/src/linux/include/asm-generic
# ln -s /usr/src/linux/include/linux
# ln -s /usr/src/linux/include/scsi
# cd /usr/src
* lvs-tun 방식은 arp 문제가 있으므로 2.4.x 커널은 hidden-patch를 적용해야 한다.
(다운로드 : http://www.ssi.bg/~ja/)
# patch -p0 < hidden-2.4.26-1.diff
# make menuconfig
* 커널 옵션 필수 선택 사항입니다.
– Networking options
CONFIG_PACKET=y
CONFIG_NETFILTER=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_NET_IPIP=y
– IP: Virtual Server Configuration
CONFIG_IP_VS=y
CONFIG_IP_VS_DEBUG=y
CONFIG_IP_VS_TAB_BITS=12
CONFIG_IP_VS_WLC=y (알고리즘은 wlc를 사용)
# nice –adjustment=-20 make dep clean bzImage modules modules_install
* nice는…… 쬠이라도 빨랑 컴파일하도록… ^^;;;
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.26
# cp System.map /boot/System.map-2.4.26
* grub나 lilo를 적용하신후 재부팅~
#### Director 설치
* VIP : 192.168.0.251
* Director : 192.168.0.250
* Real 1 : 192.168.0.200
* Real 2 : 192.168.0.100
라고 가정합니다.
1. ipvsadm 설치
# tar xvfzp ipvsadm-1.21.9.tar.gz
# cd ipvsadm-1.21.9
# make all
# make install
# ipvsadm
IP Virtual Server version 1.0.11 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
* 이렇게 나오면 성공
2. VIP 설정
# ifconfig eth0:0 192.168.0.251 netmask 255.255.255.255 broadcast 192.168.0.251 up
# route add -host 192.168.0.251 dev eth0:0
# echo 1 > /proc/sys/net/ipv4/ip_forward
3. ipvsadm 설정
# ipvsadm -A -t 192.168.0.251:80 -s wlc
# ipvsadm -a -t 192.168.0.251:80 -r 192.168.0.200 -i
# ipvsadm -a -t 192.168.0.251:80 -r 192.168.0.100 -i
# ipvsadm
IP Virtual Server version 1.0.11 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.0.251:http wlc
-> 192.168.0.100:http Tunnel 1 0 0
-> 192.168.0.200:http Tunnel 1 0 0
###### Real Server 설정 ######
# echo “net.ipv4.conf.all.rp_filter = 1” >> /etc/sysctl.conf
# echo “net.ipv4.conf.lo.hidden = 1” >> /etc/sysctl.conf
# echo “net.ipv4.conf.default.hidden = 1” >> /etc/sysctl.conf
# echo “net.ipv4.conf.all.hidden = 1” >> /etc/sysctl.conf
# /sbin/sysctl -p
# ifconfig tunl0 192.168.0.251 netmask 255.255.255.255 broadcast 192.168.0.255 up
# route add -host 192.168.0.251 dev tunl0
# echo 0 > /proc/sys/net/ipv4/conf/tunl0/rp_filter
## 위의 과정으로 LVS-Tun 방식을 테스트 했습니다.
5 Responses
… [Trackback]
[…] Find More on on that Topic: nblog.syszone.co.kr/archives/643 […]
… [Trackback]
[…] Information to that Topic: nblog.syszone.co.kr/archives/643 […]
… [Trackback]
[…] Read More Info here to that Topic: nblog.syszone.co.kr/archives/643 […]
… [Trackback]
[…] Read More here on that Topic: nblog.syszone.co.kr/archives/643 […]
… [Trackback]
[…] Find More Info here to that Topic: nblog.syszone.co.kr/archives/643 […]