keepalived+lvs无法访问vip或访问超时

您所在的位置:网站首页 网页显示访问超时 keepalived+lvs无法访问vip或访问超时

keepalived+lvs无法访问vip或访问超时

2024-05-30 02:06| 来源: 网络整理| 查看: 265

1. 在访问vip的时候,连接被拒绝,但是可以ping通:

[kiosk@foundation67 Desktop]$ curl -I 172.25.67.200 curl: (7) Failed connect to 172.25.67.200:80; Connection refused [kiosk@foundation67 Desktop]$ ping 172.25.67.200 PING 172.25.67.200 (172.25.67.200) 56(84) bytes of data. 64 bytes from 172.25.67.200: icmp_seq=1 ttl=64 time=0.160 ms 64 bytes from 172.25.67.200: icmp_seq=2 ttl=64 time=0.207 ms ^C 检查配置文件首先检查防火墙和selinux,都是关闭的。 查看RS端的arptables的策略。 # arptables --list Chain IN (policy ACCEPT) target source-ip destination-ip source-hw destination-hw hlen op hrd pro DROP anywhere 172.25.67.200 anywhere anywhere any any any any Chain OUT (policy ACCEPT) target source-ip destination-ip source-hw destination-hw hlen op hrd pro mangle 172.25.67.200 anywhere anywhere anywhere any any any any --mangle-ip-s server3 Chain FORWARD (policy ACCEPT) target source-ip destination-ip source-hw destination-hw hlen op hrd pro

2. 访问VIP超时,但是可以ping通:

客户端返回内容: [root@foundation67 Desktop]# curl 172.25.67.200 curl: (7) Failed connect to 172.25.67.200:80; Connection timed out 在调度端: [root@server1 ~]# ipvsadm -l IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 172.25.67.200:http rr -> server3:http Route 1 0 0 -> server4:http Route 1 0 1 [root@server1 ~]# ipvsadm -lnc IPVS connection entries pro expire state source virtual destination TCP 00:53 SYN_RECV 172.25.67.250:51808 172.25.67.200:80 172.25.67.4:80

LVS端看到状态是SYN_RECV,说明请求已经到达LVS,但是在发给后端Real Server的时候出现问题。

数据包的进出策略是正确的,但依然无法处理数据包。数据包出去只是发送,肯定是好的,那么就只能是数据包解析出错。数据包在传给RS后,解析ip,如果发现自己的VIP且和解析出的IP一致,那么就没有问题,说明vip和解析的ip不一致,但访问的是VIP,解析出的目的IP一定是VIP,那么只有RS上的VIP有问题,查看的时候发现没有VIP,是因为添加VIP是通过 ‘ip addr add 172.25.67.200/24 dev eth0’命令,而重启两台RS后VIP就没了。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3