LVS+keepalived+squid+nginx 无法访问问题。小菜鸟请大家帮忙

我的架构是这样LVS+keepalived+squid+nginx
lvs1 172.16.3.196
lvs2 172.16.3.197
VIP: 172.16.3.198
squid1:172.16.3.92
squid2:172.16.3.199
nginx: 172.16.3.240
squid 可以访问到nginx,然后squid两台也绑定的ARP。现在问题是配置出来的虚拟IP172.16.3.198不能访问到nginx WEB网站.不知道是为什么。请高手解答
lvs上ipvsadm显示,也会正常的切换。
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.16.3.198:http wrr persistent 60
-> 172.16.3.92:http Route 3 0 0
-> 172.16.3.199:http Route 3 0 0
TCP 172.16.3.198:squid wrr persistent 60

keepalived配置如下
! Configuration File for keepalived

global_defs {
notification_email {
admin@163.com
}
notification_email_from admin@163.com
smtp_server 127.0.0.1
# smtp_connect_timeout 30
router_id LVS1
}

vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.16.3.198

}
}

virtual_server 172.16.3.198 80 {
delay_loop 6
lb_algo wlc
lb_kind DR
persistence_timeout 60
real_server 172.16.3.92 80 {
weight 3
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 172.16.3.199 80 {
weight 3
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}

squid配置
http_port 172.16.3.92:80 vhost vport defaultsite=172.16.3.198
cache_mem 64 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 20 MB
minimum_object_size 0 KB
maximum_object_size_in_memory 5 MB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024

acl gsrc src 172.16.3.92 172.16.3.199 172.16.3.240 172.16.3.198 172.16.3.197 192.16.3.196
http_access allow gsrc

acl Manager proto cache_object
acl Localhost src 127.0.0.1
http_access allow Manager Localhost

acl Safe_ports port 3128 80 3130 3131 255
http_access allow !Safe_ports
http_access allow all

visible_hostname test3
cache_mgr admin@163.com

cache_effective_user squid
cache_effective_group squid
tcp_recv_bufsize 65536 bytes

cache_peer 172.16.3.199 sibling 3128 3131
cache_peer_access 172.16.3.199 allow all
cache_peer test.com parent 80 0 no-query originserver no-digest

access_log /usr/local/squid/logs/access.log
cache_dir diskd /cache 256 16 256 Q1=60 Q2=50

#error_directory /usr/local/squid/errors/Simplify_Chinese

icp_port 3130
htcp_port 0
icp_query_timeout 2000
icp_access allow all
digest_generation on
log_icp_queries on
icp_hit_stale on

Forums:

您怎么确认“配置出来的虚拟IP172.16.3.198不能访问到nginx WEB网站”呢?用什么方法?
您的squid.conf中http_port 172.16.3.92:80 vhost vport defaultsite=172.16.3.198的defaultsite=172.16.3.198到底想干什么?您的拓扑图是什么样的?

你好,是这样的。172.16.3.198是虚拟出来的IP。与squid两台绑定了ARP。
squid+nginx 访问到nginx
LVS+NGINX 访问到nginx
但LVS+squid+nginx 不能访问到nginx。不知道是什么原因。我感觉问题应该是出在squid上。但不知道是什么原因。
squid.conf中http_port 172.16.3.92:80 vhost vport defaultsite=172.16.3.198的defaultsite=172.16.3.198这条我是绑定nginx上的域名。这里贴出来的是不对的呵。是我病急乱投医。试试看这样行不行

randomness