ipvsadm
ipvsadm/QuickStart ¶1.1. Notice ¶
1.2. ±¸Çö ȯ°æ ¶1. ¼¹ö
=============================================================== | | | +-------------------------------+------------------- Client | 192.168.0.50:eth0:1 dummy0:192.168.0.50 | ======== | 192.168.0.10:eth0 eth0:192.168.0.11 |/---- | | | /-------------\ / ======== | ==================== ==================== /| | | | Linux Box Master | | Linux Box Slave | / | | | | Direct Routing | | | / | | | | | | |/ | | | | RealServer 1 | | RealServer 2 | | | | ==================== ==================== | | | +---------------------------------------------------------+ | hosts: cnode1 hosts: cnode2 | | | =============================================================== 1.3.1. Whatis ipvsadm ¶
¡ØÂü°í : http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.ipvsadm.html 1.3.2. Install ipvsadm ¶1. RPM ¼³Ä¡
ÀÛ¾÷ ¼¹ö [Master] =================================================================================== [root@cnode1 ~]# rpm -Uvh ipvsadm-1.24-6.i386.rpm warning: ipvsadm-1.24-6.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821 Preparing... ########################################### [100%] 1:ipvsadm ########################################### [100%] [root@cnode1 ~]# [root@cnode1 ~]# ipvsadm -version ipvsadm v1.24 2003/06/07 (compiled with popt and IPVS v1.2.0) // ¼³Ä¡¸¦ È®ÀÎ ÇÑ´Ù. [root@cnode1 ~]# _ 1.3.3. Conguration - ipvsadm ¶
ÀÛ¾÷ ¼¹ö [Master] =================================================================================== [root@cnode1 ~]# ipvsadm -A -t 192.168.0.50:80 -s wlc [root@cnode1 ~]# ipvsadm -a -t 192.168.0.50:80 -r 192.168.0.11:80 -g -w 1 [root@cnode1 ~]# ipvsadm -a -t 192.168.0.50:80 -r 192.168.0.10:80 -g -w 1 [root@cnode1 ~]# /etc/init.d/ipvsadm save [root@cnode1 ~]# _ 1.3.4. Conguration - ip_forward ¶
ÀÛ¾÷ ¼¹ö [Master] =================================================================================== [root@cnode1 ~]# vi /etc/sysctl.conf net.ipv4.ip_forward = 1 // 0 ¿¡¼ 1·Î ¼öÁ¤ [root@cnode1 ~]# sysctl -p net.ipv4.ip_forward = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 [root@cnode1 ~]#_ 1.4.2. Install arptables_jf ¶1. RPM ¼³Ä¡
ÀÛ¾÷ ¼¹ö [Slave] =================================================================================== [root@cnode2 ~]# rpm -Uvh arptables_jf-0.0.8-2.i386.rpm warning: arptables_jf-0.0.8-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e Preparing... ########################################### [100%] 1:arptables_jf-0.0.8-2 ########################################### [100%] [root@cnode2 ~]# [root@cnode2 ~]# arptables -V arptables v0.0.8 // ¼³Ä¡¸¦ È®ÀÎ ÇÑ´Ù. [root@cnode2 ~]# _ 1.4.3. Configuration - arptables ¶1. 192.168.0.50 ¸¦ ¿äûÇÏ´Â ³ª¸¥ ³ëµåÀÇ "Arp Request" ÆÐŶÀº ¸ðµÎ ¹«½ÃÇÑ´Ù.
ÀÛ¾÷ ¼¹ö [Slave] =================================================================================== [root@cnode2 ~]# arptables -A IN -j DROP -d 192.168.0.50 [root@cnode2 ~]# /etc/init.d/arptables_jf save Saving current rules to /etc/sysconfig/arptables: [ OK ] [root@cnode2 ~]# _ 1.4.4. Configuration - Set virtual IP ¶
ÀÛ¾÷ ¼¹ö [Slave] =================================================================================== [root@cnode2 ~]# ifconfig dummy0 192.168.0.50 netmask 255.255.255.255 broadcast 192.168.0.50 up [root@cnode2 ~]# ifconfig dummy0 Link encap:Ethernet HWaddr 00:01:02:03:04:03 inet addr:192.168.0.50 Bcast:192.168.0.120 Mask:255.255.255.255 UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:210 (210.0 b) eth0 Link encap:Ethernet HWaddr 00:01:02:03:04:02 inet addr:192.168.0.11 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:54613114 errors:0 dropped:0 overruns:0 frame:0 TX packets:154669808 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4190538150 (3.9 GiB) TX bytes:524576645 (500.2 MiB) Interrupt:11 Base address:0xc000 [root@cnode2 ~]# 1.5. Test ¶
|
The luck that is ordained for you will be coveted by others. |