中的LVS网络负载技术介绍.docVIP

  • 4
  • 0
  • 约1.05万字
  • 约 10页
  • 2018-08-24 发布于贵州
  • 举报
中的LVS网络负载技术介绍

入门。笔记。 PAGE \* MERGEFORMAT 2 Chenyp1023@ LVS集群中的IP负载均衡技术介绍 NLB是Windows下网络负载平衡技术。它可以保证几台win机器之间,通过配置后,利用广播或组播方式,使得虚拟ip 地址同时均匀的分布在每台或者指定的几台win机器上,从而实服务器现网络负载。相信这个大家都比较熟。但我们今天讨论的是Linux下的情况。问题就在于:Linux中有类似windows的nlb的技术吗?有又如何实现的呢? 答案肯定是肯定的。不但有,而且很多。除了我们今天要讲的LVS外,还有LNLB、HAproxy、Pound等第三方Linux软件。接下来我们来看一幅LVS虚拟服务拓扑图: 这张图所展示的,内容很简单的:就是终端通过网络连接到一台平衡服务器上,然后平衡服务器将终端的连接,转发给LAN网或WAN网中服务器。简单的说,这就是LVS的基本原理。LVS简单吧!在LVS项目中,把图中的前置平衡服务器称之为Director Server (DR),后置的实际服务器称之为Real Server (RS)。 看着这拓扑案例图,也许,大家很快就想到一个问题:DR机宕了怎么办?不就OVER了吗?是啊!这涉及到一个HA(High-Availability?)高可用性问题。要保证DR服务器的冗余安全,可采用Heartbeat建主备来解决此问题。但HA的问题,我们不打算在这里讨论。另外一个问题也许你想到了,也许你还没留意到。那就是重定向问题,如何保证Director Service能将来自同一个Client的请求发给同一个RealServer呢?LVS可通过服务Persistent参数来设置。那问题是,“来自同一个客户”是基于IP的客户端还是基于浏览器客户端的Cookie呢?LVS还有另一参数[-M netmask]。所以说应该是基于源地址.它指出源地址的匹配方式。-p 900 -M 就是掩码后网络地址相同的请求使用同一个模板。 *********************************************************************************** 关于MAN命令中对-P和-M参数的说明。 ipvsadm -A -t vip:port -s scheduler -p persisten-time -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 Rout- ing or Tunnelling is used as the forwarding mechanism. If Mas- querading is used in conjunction with an FTP service than per- sistence is not necessary, but the ip_vs_ftp kernel module must be used. This module may be manually inserted into the kernel u

文档评论(0)

1亿VIP精品文档

相关文档