ArrayAPV配置操作手册-SLB功能配置_第1页
ArrayAPV配置操作手册-SLB功能配置_第2页
免费预览已结束,剩余22页可下载查看

下载本文档

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

文档简介

1、Array APV工程安装配置手册服务器负载均衡功能配置Array APV服务器负载均衡架构介绍Array APV的服务器负载均衡功能由三部分组成,通过策略和算法的应用将 此三部分结合为统一的整理,从而实现服务器负载均衡功能。第一部分:Real SerivceReal Service是提供服务的服务器的IP地址和端口的集合。Real Service (Real) Represents a physical sen ice which will handle client requestsInternet义Real Service的同时,不仅需要指定后台提供服务的服务器的IP地址和端口, 还可以

2、个性化的指定每个Real Service能够处理的并发连接数、对Real Service进行的健康检查方式等。* Real Senice = Real Sener IP : Port在进行APV服务器负载均衡功能实现时,首先需要定义Real Service。在定第二部分: Real Serivce Group(Group)Real Service组是提供相同服务的Real Service的集合。同一台服务器,由于其可能同时提供多个服务,可以同时属于多个Real Service Group。Real Service Group (Group)在创建Group的同时,就需要定义Group中的Rea

3、l Service处理用户访问请求的方式(Method),且可以通过加权的方式来分担不同比重的负载到相应的Real Service上。第三部分: Virtual Service ( Virtual )Virtual Service是对外提供服务的IP地址和端口的集合。用户通过向Virtual Service发起访问就能够实现所需功能Mrtual Service (VirtuaF)i Represents a irfual r ice that clieats can connect to Virtual Servke二4rtualIP : PortInternet* RtprtsGnts a

4、group oT ralwhirhtraffic will be distributed toFTP GroupHTTP GroupInter net同一个Virtual IP地址可以属于不同的Virtual Service通过Real Service、Real Service Group禾口Virtual Service的定义,和Policy(策略)、Method(算法)的应用,能够方便的实现服务器负载均衡功能。SLBTerminoios5rArroy Networ ks+The Application Nefworking CompanyRepresents a physical seni

5、ce u hich will handle clientrequestsRepresents a group of real services which traffic will be distributed toRepresents a virtual ser ice that clients can conuect to其中Policy用来定义Virtual禾口Group之间的关系,Method用来定义Real和Group之间的关系。二、Array APV服务器负载均衡功能配置无论是串连连接方式还是旁路连接方式,服务器负载均衡功能配置方式相同,唯一需要注意的是工作模式。Array APV

6、的服务器负载均衡功能有两种工作InternetReal 5Real 4ReauJ ReaisVirtual 1Vinual2PolicvMethodReal 1Rea 2Defines which load balancingalgorithm to useAssociates real sen ice grovirtual sen ices模式,反向代理模式和透明模式(具体说明见网络架构设计书)。当选择应用串连连接方式时,某些较特殊的应用需要Real Service能够得知客户端真实IP地址,需要使用透明模式(tran spare nt mode)。系统默认工作模式为反向代理模式(rever

7、se mode)。如需更改为透明模式,命令为:AN(c on fig)#system mode tran spare nt如需更改到反向代理模式,命令为:AN(c on fig)#system mode reverse查看当前系统运行模式,命令为AN(c on fig)#system mode reverse在通常情况下,使用默认Reverse模式即可,特别在旁路连接方式下,建议应用Reverse模式。现以旁路接入方式(Reverse模式)为例讲解服务器负载均衡的配置方式, 下图为旁路接入方式拓扑结构图。图中显示有4台Http服务器,分别为App1,App2,App3和App4假定4台服务器的

8、IP地址和提供服务的端口如下表所示:App1App2App3App4IP地址34Serive Port80700800900假定通过APV对这4台服务器实现负载均衡功能,对外提供服务的IP地址和端口(Virtual Service)为00,80端口现以以上假定为例,进行配置说明。配置服务器负载均衡功能总共分为以下4个步骤:步骤一、定义Real Service步骤二、定义Real Service Group,并将Real Service添加到Group中步骤三、定义Virtual Service步骤四、定义Pol

9、icy,并通过policy将Virtual Service禾口Group绑定下面分别详细说明各个步骤的具体配置命令,其中应用的算法为最小相应时间基础上的会话保持算法,会话保持算法的session timeoute时间设置为1分钟。注:所有设备配置命令,均需现登陆到配置模式下才能够执行。配置符号说明:符号表示是必须配置部分,否则配置提示错误。符号表示是可选配置部分,如没有配置则使用默认值步骤一、定义Real Service命令:sib real real_portmax_c onnhc_type hc_up hc_dow n timeoutprotocol服务器提供服务的协议:dns, ftp,

10、 http, https, tcp, tcps, or udj”eal_ nameReal service的名称标注,可随意制定,但不可重名ealp服务器的IP地址*eal port服务器提供服务的端口(Http协议默认端口为80)max_conn并发最大连接数,默认为1000。既每台服务器只允许并发处理1000个连接hc_type所应用的健康检查类型:tcp, http, icmp,d ns, or off(可选配置,对http应用默认为tcp协议).hc_up连续健康检查几次都通过才认为服务是健康的,默认为1hc_dow n连续健康检查几次都没有通过才认为服务是不健康的,默认为1timeo

11、ut对UDP服务的timeout时间设置,默认为60秒配置实例:创建4个Real Service,命令如下AN(config)# slb real http R_1 1AN(co nfig)# slb real http R_2 2 700AN(co nfig)# slb real http R_3 3 800AN(co nfig)# slb real http R_4 4 900AN(co nfig)#查看命令:AN(co nfig)#show slb allslb realhttp R_1 80 1000 t

12、cp 1 1slb realhttp R_27001000tcp1 1slb realhttp R_338001000tcp1 1slb realhttp R_449001000tcp1 1AN(co nfig)#需要注意的几个方面:诵常情况下,需要注意的是对max_conn(最大并发连接数)的调整和健康检查方式的调整。max_conn表示每个Real Service最大并发处理的connection数,默认为1000,此设置目的是为了对Real Service进行过载保护,有 时需要对此数值进行调整。如需要对Http服务器在实现服务器负载均衡

13、的基础上,实现其它性能增强功能如(Cache功能,Http压缩功能,SSL加速功能)则必须将Real Service的协议定义为Http协议。Virtual Service使用的协议必须和Real Service使用的协议一致。例如,Virtual Service应用的是Http协议,则Real Service也必须应用Http协议。步骤二、定义 Group,并将 Real Service 添加到 Group 中配置命令:定义group,同时指定算法sib group method method other_parmsgroup _n ame组名,可以随意定义,但不可以与其它组重名method

14、负载均衡算法,用来指疋在同一组中的ReaiService的工作方式。包括:rr (round rob in), pc (persiste nt cookie), pi(persistent IP), hi (hash IP), chi (con siste nt hash IP),he (hash cookie), ph (persiste nthost name), pu (persiste ntURL), ic (insert cookie*), rc (rewrite cookie*), ic (least conn ecti on s*),hh (hash header*), ssis

15、id(SSL sessi on ID)other_parms在method的基础上的扩展选项。如选择method为基于原IP地址的保持性算法(PI),则同时可以指定第一 个数据包的负载分担方式为sr(最短相应时间)。则配置命令为:Sib group method gg pi 32 sr配置命令:定义group member,将Real Service加入到Group中sib group member | group_ name将Real Service力口入至U group的group name”eal_ nameReal service的名称Weight权重,当method是rr, pi,

16、ph, hh, hc, ic, rc, or ssisid有效,默认为1。时param_stri ngCookie值,当method为pc.URL值,当method为pu.配置实例:创建一个组,组名为gg,将前面创建的4个real Service添加到这个组中。选用的算法为基于原IP的保持性算法,同时指定客户端发起首次请求时采用服务器最小响应时间的算法。Method为PI 32 sr命令如下:AN(c on fig)#slb group method gg pi 32 srAN(c on fig)#slb group member gg R_1AN(c on fig)#slb group me

17、mber gg R_2AN(c on fig)#slb group member gg R_3AN(c on fig)#slb group member gg R 4查看命令:AN(c on fig)#show run slb group#slb con figurati onslb group method gg pi 32 srslb group member gg R_1 1slb group member gg R_2 1slb group member gg R_3 1slb group member gg R 4 1如需要配置基于原IP地址的保持性算法的会话timeout时间命令为

18、:slb persistenee timeout :其中时间单位为分钟,是从1-50000的整数,配置实例:设置session timeout为1分钟AN (con fig) #slb persiste nee timeout 1步骤三、定义 Virtual Service配置命令:定义Virtual Service,protocol应用协议类型:dns, ftp, http, https, tcp, tcps, or udp/irtual_ nameVirtual Service的名称,不能与其它Virtual Server相同virtualp对外提供服务的IP地址virtual_portT

19、CP/UDP对外提供服务的端口(如HTTP协议,则默认为80).配置实例:定义对外提供服务的协议为HTTP协议,IP地址为00,端口为80端口。命令如下:AN(co nfig)#slb virtual http Vip 00查看命令:AN(co nfig)#show run slb virtual#slb con figurati onslbvirtualhttp2VipJ01X10080步骤四、定义 Policy, 并将 Virtual Service 和 Group 绑定配置命令:slb policy vparam_args* Dolicy_type策略类型

20、:default, backup, persistent cookie, persistent url, qos cookie,qos host name, qos n etwork, qos url, cookie, rcookie, regex, header, orstatic./irtual name某些Policy需要指定eal or groupGroup名称,或者Real Service名称param_args附加参数:persistent cookie (cookiename), persistenturl:url n ame), qos cookie (cookie n ame

21、=value), qos hostname:host name), qos url (url), qos n etwork (n etwork,n etmask),regex (regexpatter n),header (headern ame, headerpattern).precedeneeThe precede nee of this policy; policies are checked inorder of in creas ing precedenee.通常情况下,仅使用default策略,结合method的应用就能够满足需求配置实例:定义对外提供服务的协议为HTTP协议,I

22、P地址为00,端口为80端口,并将此Virtual Server和gg组进行绑定。命令如下:AN(c on fig)#slb policy default Vip gg查看命令:AAN(config)#show run slb policy#slb con figurati onslb policy default Vip gg至此,针对4台HTTP服务器的服务器负载均衡功能配置完毕。通过查看命 令可显示所有服务器负载均衡配置:AN(co nfig)#show slb allslb real http R_1 1 80 1000 tcp 1 1slb real

23、http R_2 27001000 tcp1 1slb real http R_3 38001000 tcp1 1slb real http R_4 49001000 tcp1 1slb group method gg pi 32 srslb group member gg R_1 1slb group member gg R_2 1slb group member gg R 3 1slb group member gg R_4 1 slb virtual http Vip 0080 #default policy order:#

24、qos-clie ntport 1#qos-n etwork 2#pu 3#rc 4#ic 5#pc 6#qos-cookie 7#qos-host name 8#qos-url 9#regex 10#header 11slb policy default Vip ggslb persiste nee timeout 1绝大多数情况下,如应用需求和此需求相同,在原有配置示例的基础上可以直接更改Real Service的IP地址和Virtual Service的IP地址,进行复制粘 贴配置,即可。三、Array APV服务器负载均衡功能维护1、Real Service管理维护在对应用实现服务器负

25、载均衡功能时,通常会需要对Real Service进行管理和维护,此时可以通过APV提供的停止某个Real Service的服务的方式来实现。APV在中止Real Service的过程中,不将新的访问请求分发到这台RealService上,仅允许Real Service处理已经接收的访问请求,直至所有请求处理完毕。中止服务命令:sib real disable启动服务命令:sib real en able确认Real Service的服务状态命令:Show slb real allAN(config)#slb real disab R_1AN(c on fig)#show slb real a

26、llslb real http R_1 1 80 1000 tcp 1 1slb real disable R_1slb real http R_2 2 700 1000 tcp 1 1slb real http R_3 3 800 1000 tcp 1 1slb real http R_4 4 900 1000 tcp 1 12、Virtual Service管理维护中止服务命令:Slb virtual disable启动服务命令:Slb virtual en able 确认Real Service的服务状态命令:show sl

27、b virtual allAN(c on fig)#slb virtual disable VipAN(co nfig)#show slb virtual allslb virtual http Vip 00 80slb virtual disable Vip3、服务器负载均衡功能状态查看查看所有服务器负载均衡功能配置命令:命令:Show slb all查看当前服务器负载均衡功能运行详细状态命令:命令:Show stati slb all示例:Real service R_1 1 80 UP ACTIVE Main health check: 1

28、 80 tcp UPConn ecti on Count:38Outsta nding Request Count: 12 Total Hits: 1120Average Resp onse time: 0.010 msReal service R_2 2 700 UP ACTIVE Main health check: 2 700 tcp UPConn ection Cou nt:100Outsta nding Request Count: 80 Total Hits: 1230Average Resp onse time: 0.010 msReal serv

29、ice R_3 3 800 UP ACTIVEMain health check: 3 800 tcp UPCo nn ection Cou nt:11Outsta nding Request Count: 2 Total Hits:1210Average Resp onse time: 0.010 msReal service R_4 4 900 DOWN INACTIVE Main health check: 4 900tcp DOWN Conn ecti on Count: 0Outsta nding Request Cou

30、nt: 0 Total Hits:1230Average Resp onse time: 0.010 msGroup Name Method Hits ggpi 3560http virtual service Vip (00:80)qos clie ntport hits : 0qos n etwork hits : 0 persiste nt url hits : 0 rcookie hits : 0 icookie hits : 0 persiste ntcookie hits : 0 qos cookie hits : 0 qos host name hits : 0

31、qos url hits : 0 regex hits :0 header hits : 0 redirect hits : 0 default hits : 3560 static hits : 0 backup hits : 0cache hits : 0default policy for http virtual service Vip has been matched 3560 times从中可以看到每个Real Service当前的状态(UP or DOWN),每个realservice总共处理的访问请求数仃otalHits:),当前正在处理的情况(Connection Count

32、:、Outstanding Request Count:),健康检查类型等信息。四、Array APV服务器负载均衡健康检查功能在实现服务器负载均衡功能中,APV提供以下健康检查方式:ICMP:通过ping提供服务的IP来进行确认TCP:通过与Real Service进行TCP握手进行确认DNS:通过发送DNS请求的方式进行确认HTTP:通过发起标准HTTP GET请求方式进行确认默认请求内容为:“HEAD / HTTP/1.0n”.默认比对响应内容为:“200 OK”个性化HTTP通过预定制的Request和Response,通过检查比对进行确认个性化定制HTTP健康检查,包括定制Reque

33、st和口Response。Http Request定制命令:health request Http Respo nse定制命令:health resp onse 定制完成Request和口Response后,将定制的内容与Real Service绑定:health server equesti ndexRequest table entry nu mber (value betwee n 0 and 999) to store therequest string in.equest_stri ngString to use in the HTTPrequest sent to the real

34、 service.esp onse_in dexResp onse table entry nu mber (value betwee n 0 and 999) tostore the response string in.esp on se_stri ngStri ng to search for in the HTTP resp onse sent from the real service.real_ nameReal servicename to bind a request/responsehealth checkto.示例:假设需要通过定制HTTP健康检查方式,仅当检查到Real Service Http根目录下具有health.html文件时,才认为这个Real Service能够正常提供服务。否则认为此Real Service不能提供服务。首先,配置或修改健康检查方式为HTTPslb real http R_1 1 80 1000 http 1 1slb real http R_2 2 70

温馨提示

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

评论

0/150

提交评论