LVS集群调度之持久连接问题

LVS集群调度之持久连接问题

问题:
对于后台多个RS调度,可能页面刷新一次,又需要重新调度,session无法绑定。
解决方案
lvs sh算法(源地址哈希),基本不适用,因为很多客户端可能都是通过nat上网,使用同一个公网ip,使用sh调度算法,会导致流量分配不均衡
使用LVS persistence:实现无论使用任何调度算法,在默认时间内(360s),能够实现将来自同一个地址的请求始终发往同一个RS。
[root@lvs ~]# man ipvsadm

   -p, --persistent [timeout]
          Specify that a virtual service is persistent. If this option is specified, multiple requests from a client are redirected to the same real server selected for the first request.  Optionally, the timeout of persistent sessions may be specified given in seconds, otherwise the default of 300 seconds will be
          used. This option may be used in conjunction with protocols such as SSL or FTP where it is important that clients consistently connect with the same real server.

          Note:  If  a virtual service is to handle FTP connections then persistence must be set for the virtual service if Direct Routing or Tunnelling is used as the forwarding mechanism. If Masquerading is used in conjunction with an FTP service than persistence is not necessary, but the ip_vs_ftp kernel module
          must be used.  This module may be manually inserted into the kernel using insmod(8).
ipvsadm -A|E -t|-u|-f   service-address [-s scheduler]  [-p (360)]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值