- 論壇徽章:
- 0
|
剛剛按照上述步驟進行LVS+KEEPALIVED的安裝配置,但是訪問VIP時出現(xiàn)"無法顯示網(wǎng)頁"現(xiàn)象.
我是安裝上面的步驟來的,我來說一下我配置的環(huán)境:
1.Master: centos5.2
Backup: 沒有. 先用一臺LVS+KEEPALIVED做為負載均衡器
realserver1: centos5.2 (安裝有httpd-2.2.9)
realserver2: centos5.2 (安裝有httpd-2.2.9)
VIP:192.168.1.183
realserver1:192.168.1.181
realserver2: 192.168.1.96
2.keepalived的配置文件如下:
[root@test-server keepalived]# more keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 3
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.1.183/24
}
}
virtual_server 192.168.1.183 80 {
delay_loop 6
lb_algo rr
lb_kind DR
persistence_timeout 50
protocol TCP
real_server 192.168.1.181 80 {
weight 1
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 192.168.1.96 80 {
weight 1
TCP_CHECK{
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}
3.然后啟動keepalived.
用ipvsadm -ln命令查看也是正常的
[root@test-server 01]# ipvsadm -ln
IP Virtual Server version 1.2.0 (size=4096)
Prot LocalAddress ort Scheduler Flags
-> RemoteAddress ort Forward Weight ActiveConn InActConn
TCP 192.168.1.183:80 rr persistent 50
-> 192.168.1.96:80 Route 1 0 0
-> 192.168.1.181:80 Route 1 0 0
但是訪問http://192.168.1.183出現(xiàn)"無法顯示網(wǎng)頁"現(xiàn)象.好像keepalived沒有將請求轉(zhuǎn)過去
請有配置成功過的高手賜教!!thanks |
|