zoukankan      html  css  js  c++  java
  • LVS ARP广播产生的问题和处理方式【转】

    转自

    LVS ARP广播产生的问题和处理方式-htckiller2010-ChinaUnix博客
    http://blog.chinaunix.net/uid-24960107-id-193084.html

    图 

     
    1. ARP广播会产生的问题(以上图为例)
     
    当客户端发起访问VIP 对应的域名的请求时,根据网络通信原理会产生ARP 广播,因为负载均衡器和真实的服务器在同一网络并且VIP设置在集群中的每个节点上,此时集群内的真实服务器会尝试回答来自客户端计算机的查找VIP的ARP广播,这就会产生问题,大家都说我是"VIP"。
     
    2. 为了达到负载均衡的目的,必须想法办让真实服务器忽略来自客户端计算机的ARP广播请求
    方法一:在真实服务器上设置lo 忽略ARP 广播
    net.ipv4.conf.lo.arp_ignore = 1
    net.ipv4.conf.lo.arp_announce = 2
    net.ipv4.conf.all.arp_ignore = 1
    net.ipv4.conf.all.arp_announce = 2 
     
     如果VIP 是设置在真实服务器的非lo接口,那么做如下设置
    net.ipv4.conf.ethN.arp_ignore = 1 
    net.ipv4.conf.ethN.arp_announce = 2 (N 为网卡接口)
    net.ipv4.conf.all.arp_ignore = 1 
    net.ipv4.conf.all.arp_announce = 2 
     
    方法二: 隐藏真实服务器上VIP 的网络接口
     
    #to activate the hidden feature 
     echo 1 > /proc/sys/net/ipv4/conf/all/hidden
    #to make lo:0 not arp, put lo here 
     echo 1 > /proc/sys/net/ipv4/conf/<interface_name>/hidden
     
    二.LVS arp how-to


     
    值得注意的一句话:
     
    On the realservers the VIP will still be on lo (as for the hidden method). If the reply packets to the client are routed through eth0, then the arp announcements/requests are made through eth0 and you will apply the arp_ignore/arp_announce sysctls to eth0, not to lo (you cannot use arp_ignore/arp_announce on lo).
     
     
    官方的没有看完全明白!!!
  • 相关阅读:
    启动Mysql后找不到服务或出现找不到指定文件
    WEB-MVC模式图示
    Java中Map集合的遍历方式
    sun.misc.BASE64Encoder找不到jar包的解决方法
    Tomcat常用的网站发布方式
    Sql Server查询行号
    Mysql下载安装问题
    【数学】环逆序
    【搜索】【the first editoral】OpenJudge 我是最快的马
    The First Blog
  • 原文地址:https://www.cnblogs.com/paul8339/p/6744406.html
Copyright © 2011-2022 走看看