RS1(RealServer1)的配置
Linux Realserver 配置的关键之一在于关闭 arp,这要配置/etc/sysctl.conf如下
[code:1]…
#f o r i p v s
n e t . ip v 4 . c o n f . l o . a r p i g n o r e = 1
n e t . ip v 4 . c o n f . l o . a rp announ c e = 2
n e t . ip v 4 . c o n f . a l l . a r p i g n o r e = 1
n e t . ip v 4 . c o n f . a l l . a rp announ c e = 2
n e t . ip v 4 . c o n f . d e f a u l t . r p f i l t e r = 1
#end o f i p v s
…[/code:1]
在/etc/sysconfig/network-scripts/ifcfg-eth0 中配置 ip 地址和网关。
[code:1]DEVICE=e th 0
ONBOOT=y e s
BOOTPROTO= s t a t i c
IPADDR= 1 9 2 . 1 6 8 . 11 . 21
NETMASK= 2 5 5 . 2 5 5 . 2 5 5 . 0
BROADCAST= 1 9 2 . 1 6 8 . 11. 2 5 5[/code:1]
新建VIP 的网卡配置文件为/etc/sysconfig/network-scripts/ifcfg-lo:0。
[code:1]DEVICE=l o : 0
ONBOOT=y e s
IPADDR= 1 9 2 . 1 6 8 . 11 . 2 0 0
NETMASK= 2 5 5 . 2 5 5 . 2 5 5 . 2 5 5[/code:1]
RS2(RealServer2)的配置
Linux Realserver 配置的关键之一在于关闭 arp,这要配置/etc/sysctl.conf如下
[code:1]…
#f o r i p v s
n e t . ip v 4 . c o n f . l o . a r p i g n o r e = 1
n e t . ip v 4 . c o n f . l o . a rp announ c e = 2
n e t . ip v 4 . c o n f . a l l . a r p i g n o r e = 1
n e t . ip v 4 . c o n f . a l l . a rp announ c e = 2
n e t . ip v 4 . c o n f . d e f a u l t . r p f i l t e r = 1
#end o f i p v s
…[/code:1]
在/etc/sysconfig/network-scripts/ifcfg-eth0 中配置 ip 地址和网关。
[code:1]DEVICE=e th 0
ONBOOT=y e s
BOOTPROTO= s t a t i c
IPADDR= 1 9 2 . 1 6 8 . 11 . 22
NETMASK= 2 5 5 . 2 5 5 . 2 5 5 . 0
BROADCAST= 1 9 2 . 1 6 8 . 11. 2 5 5[/code:1]
新建VIP 的网卡配置文件为/etc/sysconfig/network-scripts/ifcfg-lo:0。
[code:1]DEVICE=l o : 0
ONBOOT=y e s
IPADDR= 1 9 2 . 1 6 8 . 11 . 2 0 0
NETMASK= 2 5 5 . 2 5 5 . 2 5 5 . 2 5 5[/code:1]