B2-负载均衡基本原理_第1页
B2-负载均衡基本原理_第2页
B2-负载均衡基本原理_第3页
B2-负载均衡基本原理_第4页
B2-负载均衡基本原理_第5页
已阅读5页,还剩38页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

负载均衡基本原理王文angwnb@单台服务器到多台服务器的转变InternetBIG-IPLTMsClientsServersClientsInternetServers什么是服务器负载均衡12345678ClientsClientsInternet虚拟服务器与网络地址转换

VirtualServer&NAT真实服务器RealServer网络地址转换VirtualServerAddress7:80Internet:8080:8080:8080:8080RealServerAddress7:80Internet虚拟服务器数据流-Packet#1Internet:8080:8080:808:8080域名IP地址7VirtualServerAddress7:80数据流-Packet#1LTM根据负载均衡把数据包的目的地址转换成Node的地址InternetPacket#1Src-0:4003Dest–7:80:8080:8080:8080:8080Packet#1Src–0:4003Dest–:808007:80数据流–Packet#1响应包

LTM把数据包的源地址转换成VirtualServer地址InternetPacket#1-returnDest-0:4003Src–7:80:8080Packet#1-returnDest–0:4003Src–:808007:80:8080:8080:8080数据流-Packet#2InternetPacket#2Src-1:4003Dest–7:80:8080Packet#2Src–1:4003Dest–:808017:80:8080:8080:8080数据流–Packet#2回包

InternetPacket#2-returnDest-1:4003Src–7:80:8080Packet#2-returnDest–1:4003Src–:808017:80:8080:8080:8080数据流-Packet#3InternetPacket#3Src-5:4003Dest–7:80:8080Packet#3Src–5:4003Dest–:808057:80:8080:8080:8080数据流–Packet#3回包

InternetPacket#3-returnDest-5:4003Src–7:80:8080Packet#3-returnDest–5:4003Src–:808057:8080:8080:8080ConnectionTable连接表SrcIPAddressVirtualServerRealServer0:40037:80:80801:40037:80:8080………0:40057:80:80801:40087:80:80805:40037:80:8080SrcIPAddressVirtualServer0:40037:801:40037:80……0:40057:801:40087:805:40037:80客户端Netstat-na负载均衡器BconnConnectionTable连接表SrcIPAddressVirtualServerRealServer0:40037:80:80801:40037:80:8080………0:40057:80:80801:40087:80:80805:40037:80:8080SrcIPAddressRealServer0:4003:80801:4003:8080……0:4005:80801:4008:80805:4003:8080服务器端Netstat-na负载均衡器BconnF5负载均衡的基本构件

Pool、PoolMembers与NodesInternet:8080:80:4002:80PoolMembersNodes是指PoolMembers的IPAddressPools,PoolMembersandNodesNode=IPaddress:80:80:80PoolMember

=Node+PortPool

=GroupofpoolmembersPoolMembers的端口与地址问题Internet:8080:80:4002VirtualServer7:80PoolMembers注意:1、PoolMember的端口可以不一样2、PoolMember不一定需要与BIG-IP相连或在同一网段3、一个Pool中PoolMember的数量不受限,现网有达上百个的实例:80/24/24路由器虚拟服务器VirtualServerInternet:8080:4002:80VirtualServerIPAddress+Service(Port)区分端口可以为Any(0)准备了负载均衡器是否需要对流过的网络流量作处理一般与Pool相关联一台负载均衡器支持的Virtualserver的数量不受限,现网有达上千个的实例7:80如何选择服务器--负载均衡算法RoundRobinRatioLeastConnectionsFastestObservedPredictiveDynamicRatioPriorityGroupActivationFallbackHostStaticDynamicFailureMechanisms轮询--RoundRobinClientsRouterBIG-IPLTMControllerServersClientrequestsaredistributedevenly12345678Internet比率--RatioClientsRouterBIG-IPLTMControllerServersAdministratorsetsratiofordistributingClientrequests3:2:1:11234891011Internet571214613最小连接数--LeastConnectionsClientsRouterBIG-IPLTMControllerServers12InternetNextrequestsgoestoNodewithfewestopenconnections459460461470CurrentConnections3456最小连接数--LeastConnectionsClientsRouterBIG-IPLTMControllerServersInternetSometimelater,numberofconnectionschange6163280290111112CurrentConnections62最快回应--FastestClientsRouterBIG-IPLTMControllerServersNextrequestsgotoNodewithfastestresponsetime25Internet10ms10ms10ms17msCurrentResponseTimes1436最快回应--FastestClientsRouterBIG-IPLTMControllerServersSometimelater,responsetimeschange102104Internet10ms10ms7ms7msCurrentResponseTimes101103服务器健康检查HealthMonitors

如何识别不可用的服务器

Internet:80服务健康检查MonitorConcepts网络连通性检查AddressCheckNode–IPAddress端口ServiceCheckIP:port内容检查ContentCheckIP:portpluscheckdatareturned交互式检查InteractiveCheck网络连通性检查--AddressCheckStepsPacketssenttoIPAddressesIfnoresponse,thennotrafficsenttomembersusingthatnodeaddressExample-ICMPInternetICMP服务端口检查--ServiceCheckStepsOpensTCPconnection(IPAddress:service)ConnectionclosedIfTCPconnectionfails,thennotrafficsenttoassociatedMembersExample–TCPInternet:80:80:80TCPConnection内容检查--ContentCheckInternet:80:80:80StepsOpensTCPconnection(IPAddress:service)SendsarequestResponsereturnsdataConnectionclosedIfReceiveRulenotfoundindata,thennotrafficsenttoassociatedMembersExample–httphttpGET/交互式检查--InteractiveCheckInternet:80:80:80StepsOpensTCPconnection(IPAddress:service)Interactiveconversationtosimulatereal-worldConnectionclosedIfexpectedresultsdonotoccur,thennotrafficsenttoassociatedMembersExample–SQLrequestconversation会话保持Persistence123123ConnectionTable连接表SrcIPAddressVirtualServerRealServer0:40037:80:80801:40037:80:8080………0:40057:80:80801:40087:80:80805:40037:80:8080SrcIPAddressRealServer0:4003:80801:4003:8080……0:4005:80801:4008:80805:4003:8080服务器端Netstat-na负载均衡器BconnSourceAddressPersistenceTableSrcIPAddressVirtualServerRealServer0:40037:80:80801:40037:80:8080………0:40057:80:8080???1:40087:80:8080???5:40037:80:8080SrcIPAddressRealServer01……5PersistenceTable负载均衡器源地址会话保持--SourceAddressPersistence根据client的源P地址Netmask->AddressRange12312301IfNetmaskis07CookiePersistenceInsertmodeBIG-IPLTMInsertsacookieintothestreamRewritemodeWebservercreatescookieandBIG-IPLTMchangesitPassivemodeWebservercreatescookieandBIG-IPLTMreadsitClientServerHTTPrequest(nospecialcookie)TCPhandshakeTCPhandshakeHTTPrequest(nospecialcookie)HTTPreply(nospecialcookie)HTTPreply(withinsertedcookie)pick

serverHTTPrequest(withsamecookie)TCPhandshakeTCPhandshakeHTTPrequest(nospecial

cookie)HTTPreply(nospecialcookie)HTTPreply(updatedcookie)cookie

specifies

serverFirstHitSecondHitCookieInsertMode源地址转换SNATs

Internet02多对一的转换Many-to-onemappingTraffictoSNATAddressisrefusedCanshareIPwithVirtualServerSNATs–典型数据流

Internet02:400103:8002:3300103:80源地址会转换成SNAT的地址请注意源端口Server03:80SNATs–数据流的回包

InternetSNATIPAddress0203:80:400103:80

02:33001数据流的回应包地址会转换回来Server03:80SNATTable

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论