LVS解决无法访问httpd或者访问无响应问题

    LVS调度器的配置如下

  1. [root@proxy ~]# ipvsadm -C  
  2. [root@proxy ~]# ipvsadm -A -t 192.168.4.5:80 -s wrr  
  3. [root@proxy ~]# ipvsadm -a -t 192.168.4.5:80 -r 192.168.2.100 -w 1 -m
  4. [root@proxy ~]# ipvsadm -a -t 192.168.4.5:80 -r 192.168.2.200 -w 1 -m

问题:客户端访问web2有响应而访问web1没有响应

[root@client ~]# curl http://192.168.4.5:80

-->this is Page2 

-->无响应.....

 

[root@web2 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.2.5     0.0.0.0         UG    104    0        0 eth1
192.168.2.0     0.0.0.0         255.255.255.0   U     104    0        0 eth1

[root@web1 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     0.0.0.0         255.255.255.0   U     104    0        0 eth1
 

解决方法

1.检查web1和web2的路由配置发现了问题,web1没有配默认路由

[root@web1 ~]# route add -net 0.0.0.0 gw 192.168.2.5  //添加一个默认路由即可,路由地址填写为调度器的接口ip

2.iptables -F 刷新防火墙缓存

[root@web1 ~]#iptables -F

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值