




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Array APV工程安裝配置手冊服務器負載均衡功能配置一、 Array APV 服務器負載均衡架構(gòu)介紹Array APV的服務器負載均衡功能由三部分組成,通過策略和算法的應用將此三部分結(jié)合為統(tǒng)一的整理,從而實現(xiàn)服務器負載均衡功能。第一部分:Real SerivceReal Service是提供服務的服務器的IP地址和端口的集合。在進行APV服務器負載均衡功能實現(xiàn)時,首先需要定義Real Service。在定義Real Service的同時,不僅需要指定后臺提供服務的服務器的IP地址和端口,還可以個性化的指定每個Real Service能夠處理的并發(fā)連接數(shù)、對Real Service進行的健康
2、檢查方式等。第二部分:Real Serivce Group(Group)Real Service組是提供相同服務的Real Service的集合。同一臺服務器,由于其可能同時提供多個服務,可以同時屬于多個Real Service Group。在創(chuàng)建Group的同時,就需要定義Group中的Real Service處理用戶訪問請求的方式(Method),且可以通過加權(quán)的方式來分擔不同比重的負載到相應的Real Service上。第三部分:Virtual Service(Virtual)Virtual Service是對外提供服務的IP地址和端口的集合。用戶通過向Virtual Service發(fā)起
3、訪問就能夠?qū)崿F(xiàn)所需功能。同一個Virtual IP地址可以屬于不同的Virtual Service。通過Real Service 、Real Service Group和Virtual Service的定義,和Policy(策略)、Method(算法)的應用,能夠方便的實現(xiàn)服務器負載均衡功能。其中Policy用來定義Virtual和Group之間的關(guān)系,Method用來定義Real和Group之間的關(guān)系。二、 Array APV服務器負載均衡功能配置無論是串連連接方式還是旁路連接方式,服務器負載均衡功能配置方式相同,唯一需要注意的是工作模式。Array APV的服務器負載均衡功能有兩種工作模式
4、,反向代理模式和透明模式(具體說明見網(wǎng)絡(luò)架構(gòu)設(shè)計書)。當選擇應用串連連接方式時,某些較特殊的應用需要Real Service能夠得知客戶端真實IP地址,需要使用透明模式(transparent mode)。系統(tǒng)默認工作模式為反向代理模式(reverse mode)。如需更改為透明模式,命令為:AN(config)#system mode transparent如需更改到反向代理模式,命令為:AN(config)#system mode reverse查看當前系統(tǒng)運行模式,命令為:AN(config)#system mode reverse在通常情況下,使用默認Reverse模式即可,特別在旁路
5、連接方式下,建議應用Reverse模式。現(xiàn)以旁路接入方式(Reverse模式)為例講解服務器負載均衡的配置方式,下圖為旁路接入方式拓撲結(jié)構(gòu)圖。圖中顯示有4臺Http服務器,分別為App1,App2,App3和App4。假定4臺服務器的IP地址和提供服務的端口如下表所示:App1App2App3App4IP地址101111101112101113101114Serive Port80700800900假定通過APV對這4臺服務器實現(xiàn)負載均衡功能,對外提供服務的IP地址和端口(Virtual Service)為00,80端口。現(xiàn)以以上假定為例,進行配置說明。配置服務器負載均衡功能總
6、共分為以下4個步驟:步驟一、定義Real Service步驟二、定義Real Service Group,并將Real Service添加到Group中步驟三、定義Virtual Service步驟四、定義Policy,并通過policy將Virtual Service和Group綁定。下面分別詳細說明各個步驟的具體配置命令,其中應用的算法為最小相應時間基礎(chǔ)上的會話保持算法,會話保持算法的session timeoute時間設(shè)置為1分鐘。注:所有設(shè)備配置命令,均需現(xiàn)登陸到配置模式下才能夠執(zhí)行。配置符號說明: 符號表示是必須配置部分,否則配置提示錯誤。 符號表示是可選配置部分,如沒有配置則使用默
7、認值。步驟一、定義Real Service 命令:slb real real_port max_conn hc_type hc_up hc_down timeoutprotocol服務器提供服務的協(xié)議: dns, ftp, http, https, tcp, tcps, or udpreal_nameReal service的名稱標注,可隨意制定,但不可重名real_ip服務器的IP地址real_port服務器提供服務的端口(Http協(xié)議默認端口為80)max_conn并發(fā)最大連接數(shù),默認為1000。既每臺服務器只允許并發(fā)處理1000個連接hc_type所應用的健康檢查類型: tcp, htt
8、p, icmp,dns, or off(可選配置, 對http應用默認為 tcp協(xié)議).hc_up連續(xù)健康檢查幾次都通過才認為服務是健康的,默認為1hc_down連續(xù)健康檢查幾次都沒有通過才認為服務是不健康的,默認為1timeout對UDP服務的timeout時間設(shè)置,默認為60秒配置實例:創(chuàng)建4個Real Service,命令如下。AN(config)#AN(config)#slb real http R_2 2 700AN(config)#slb real http R_3 3 800AN(config)#slb real http R_4
9、4 900AN(config)#查看命令:AN(config)#show slb allslb real http R_1 1 80 1000 tcp 1 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 1AN(config)#需要注意的幾個方面:l 通常情況下,需要注意的是對max_conn(最大并發(fā)連接數(shù))的調(diào)整和健康檢查方式的調(diào)整。max_conn表示每個Re
10、al Service最大并發(fā)處理的connection數(shù),默認為1000,此設(shè)置目的是為了對Real Service進行過載保護,有時需要對此數(shù)值進行調(diào)整。l 如需要對Http服務器在實現(xiàn)服務器負載均衡的基礎(chǔ)上,實現(xiàn)其它性能增強功能如(Cache功能,Http壓縮功能,SSL加速功能)則必須將Real Service的協(xié)議定義為Http協(xié)議。l Virtual Service使用的協(xié)議必須和Real Service使用的協(xié)議一致。例如,Virtual Service應用的是Http協(xié)議,則Real Service也必須應用Http協(xié)議。步驟二、定義Group,并將Real Service添加到
11、Group中配置命令:定義group,同時指定算法slb group method method other_parmsgroup_name組名,可以隨意定義,但不可以與其它組重名method負載均衡算法,用來指定在同一組中的RealService的工作方式。包括: rr (round robin), pc (persistent cookie), pi (persistent IP), hi (hash IP), chi (consistent hash IP), hc (hash cookie), ph (persistent hostname), pu (persistent URL),
12、 ic (insert cookie*), rc (rewrite cookie*), lc (least connections*), hh (hash header*), sslsid (SSL session ID)other_parms在method的基礎(chǔ)上的擴展選項。如選擇method為基于原IP地址的保持性算法(PI),則同時可以指定第一個數(shù)據(jù)包的負載分擔方式為sr(最短相應時間)。則配置命令為: Slb group method gg pi 32 sr配置命令:定義group member,將Real Service加入到Group中slb group member | grou
13、p_name將Real Service加入到group的group namereal_nameReal service 的名稱Weight權(quán)重,當method是rr, pi, ph, hh, hc, ic, rc, or sslsid 時有效,默認為1。param_stringCookie 值,當method 為 pc.URL值,當method 為pu.配置實例:創(chuàng)建一個組,組名為gg,將前面創(chuàng)建的4個real Service添加到這個組中。選用的算法為基于原IP的保持性算法,同時指定客戶端發(fā)起首次請求時采用服務器最小響應時間的算法。 Method 為 PI 32 sr命令如下:AN(conf
14、ig)#slb group method gg pi 32 srAN(config)#slb group member gg R_1AN(config)#slb group member gg R_2AN(config)#slb group member gg R_3AN(config)#slb group member gg R_4查看命令:AN(config)#show run slb group#slb configurationslb group method gg pi 32 srslb group member gg R_1 1slb group member gg R_2 1sl
15、b group member gg R_3 1slb group member gg R_4 1如需要配置基于原IP地址的保持性算法的會話timeout時間。命令為:slb persistence timeout :其中單位為分鐘,是從150000的整數(shù),配置實例:設(shè)置session timeout為1分鐘AN (config) #slb persistence timeout 1步驟三、定義Virtual Service配置命令:定義Virtual Service,slb virtual protocol應用協(xié)議類型: dns, ftp, http, https, tcp, tcps, or
16、 udpvirtual_nameVirtual Service的名稱,不能與其它Virtual Server相同virtual_ip對外提供服務的IP地址virtual_portTCP/UDP 對外提供服務的端口(如HTTP協(xié)議,則默認為 80).配置實例:定義對外提供服務的協(xié)議為HTTP協(xié)議,IP地址為00,端口為80端口。命令如下:AN(config)#slb virtual http Vip 00 查看命令:AN(config)#show run slb virtual #slb configurationslb virtual http Vip 10.1
17、.1.100 80步驟四、定義Policy,并將Virtual Service和Group綁定配置命令:slb policy Policy_type策略類型: default, backup, persistent cookie, persistent url, qos cookie, qos hostname, qos network, qos url, icookie, rcookie, regex, header, or static.virtual_name某些Policy需要指定real or groupGroup名稱,或者Real Service名稱param_args附加參數(shù):
18、persistent cookie (cookie name), persistent url (url name), qos cookie (cookie name=value), qos hostname (hostname), qos url (url), qos network (network, netmask), regex (regex pattern), header (header name, header pattern).precedenceThe precedence of this policy; policies are checked in order of in
19、creasing precedence.通常情況下,僅使用default策略,結(jié)合method的應用就能夠滿足需求。配置實例:定義對外提供服務的協(xié)議為HTTP協(xié)議,IP地址為00,端口為80端口,并將此Virtual Server和gg組進行綁定。命令如下:AN(config)#slb policy default Vip gg 查看命令:A AN(config)#show run slb policy#slb configurationslb policy default Vip gg至此,針對4臺HTTP服務器的服務器負載均衡功能配置完畢。通過查看命令可顯示所有服務器負載均
20、衡配置:AN(config)#show slb all slb real http R_1 1 80 1000 tcp 1 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 1slb group method gg pi 32 srslb group member gg R_1 1slb group member gg R_2 1slb group member gg
21、 R_3 1slb group member gg R_4 1slb virtual http Vip 00 80#default policy order:# qos-clientport 1# qos-network 2# pu 3# rc 4# ic 5# pc 6# qos-cookie 7# qos-hostname 8# qos-url 9# regex 10# header 11slb policy default Vip ggslb persistence timeout 1絕大多數(shù)情況下,如應用需求和此需求相同,在原有配置示例的基礎(chǔ)上可以直接更改Real Se
22、rvice的IP地址和Virtual Service的IP地址,進行復制粘貼配置,即可。三、 Array APV服務器負載均衡功能維護1、 Real Service管理維護在對應用實現(xiàn)服務器負載均衡功能時,通常會需要對Real Service進行管理和維護,此時可以通過APV提供的停止某個Real Service的服務的方式來實現(xiàn)。APV在中止Real Service的過程中,不將新的訪問請求分發(fā)到這臺Real Service上,僅允許Real Service處理已經(jīng)接收的訪問請求,直至所有請求處理完畢。中止服務命令:slb real disable 啟動服務命令:slb real enabl
23、e 確認Real Service的服務狀態(tài)命令:Show slb real allAN(config)#slb real disab R_1AN(config)#show slb real allslb 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、 Virt
24、ual Service管理維護中止服務命令:Slb virtual disable 啟動服務命令:Slb virtual enable 確認Real Service的服務狀態(tài)命令:show slb virtual allAN(config)#slb virtual disable VipAN(config)#show slb virtual allslb virtual http Vip 00 80slb virtual disable Vip3、 服務器負載均衡功能狀態(tài)查看 查看所有服務器負載均衡功能配置命令:命令:Show slb all 查看當前服務器負載均衡功能運行詳細
25、狀態(tài)命令:命令:Show stati slb all示例:Real service R_1 1 80 UP ACTIVE Main health check: 1 80 tcp UP Connection Count: 38 Outstanding Request Count: 12 Total Hits: 1120 Average Response time: 0.010 msReal service R_2 2 700 UP ACTIVE Main health check: 2 700 tcp UP Connection C
26、ount: 100 Outstanding Request Count: 80 Total Hits: 1230 Average Response time: 0.010 msReal service R_3 3 800 UP ACTIVE Main health check: 3 800 tcp UP Connection Count: 11 Outstanding Request Count: 2 Total Hits: 1210 Average Response time: 0.010 msReal service R_4 4 900 DO
27、WN INACTIVE Main health check: 4 900 tcp DOWN Connection Count: 0 Outstanding Request Count: 0 Total Hits: 1230 Average Response time: 0.010 msGroup Name Method Hitsgg pi 3560http virtual service Vip (00:80) qos clientport hits : 0 qos network hits : 0 persistent url hits : 0 rcookie
28、 hits : 0 icookie hits : 0 persistent cookie hits : 0 qos cookie hits : 0 qos hostname hits : 0 qos url hits : 0 regex hits : 0 header hits : 0 redirect hits : 0 default hits : 3560 static hits : 0 backup hits : 0 cache hits : 0default policy for http virtual service Vip has been matched 3560 times從
29、中可以看到每個Real Service當前的狀態(tài)(UP or DOWN),每個real service總共處理的訪問請求數(shù)(Total Hits:),當前正在處理的情況(Connection Count:、Outstanding Request Count:),健康檢查類型等信息。四、 Array APV服務器負載均衡健康檢查功能在實現(xiàn)服務器負載均衡功能中,APV提供以下健康檢查方式:l ICMP:通過ping提供服務的IP來進行確認l TCP:通過與Real Service進行TCP握手進行確認l DNS:通過發(fā)送DNS請求的方式進行確認l HTTP:通過發(fā)起標準HTTP GET請求方式進行
30、確認默認請求內(nèi)容為:“HEAD / HTTP/1.0rnrn”.默認比對響應內(nèi)容為:“200 OK”l 個性化HTTP:通過預定制的Request和Response,通過檢查比對進行確認個性化定制HTTP健康檢查,包括定制Request和Response。Http Request定制命令:health request Http Response定制命令:health response 定制完成Request和Response后,將定制的內(nèi)容與Real Service綁定:health server request_indexRequest table entry number (value b
31、etween 0 and 999) to store the request string in.request_stringString to use in the HTTP request sent to the real service.response_indexResponse table entry number (value between 0 and 999) to store the response string in.response_stringString to search for in the HTTP response sent from the real se
32、rvice.real_nameReal service name to bind a request/response health check to.示例:假設(shè)需要通過定制HTTP健康檢查方式,僅當檢查到Real Service Http根目錄下具有health.html文件時,才認為這個Real Service能夠正常提供服務。否則認為此Real Service不能提供服務。首先,配置或修改健康檢查方式為HTTP:slb real http R_1 1 80 1000 http 1 1slb real http R_2 2 700 1000 http 1 1slb real http R_3 3 800 1000 http 1 1slb real http R_4 4 900 1000 http 1 1然后定制健康檢查Request和Response:AN(config)# health request 2 “GET /health.html HTTP/1
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 睡眠心理測試題庫及答案
- 系統(tǒng)集成項目管理過程試題及答案
- MS Office整合使用的效率試題及答案
- 多媒體網(wǎng)站設(shè)計基本要求試題及答案
- 信息設(shè)計技能測試及答案
- 新疆油田公司井控管理規(guī)定試題復習測試附答案
- 站長資格證考試復習試題及答案
- 硬件開發(fā)面試題庫及答案
- 交通試題及答案簡單題
- 評測師考試中重要文件的準備與審查試題及答案
- 唐宋名家詩詞鑒賞學習通超星期末考試答案章節(jié)答案2024年
- 儲備土地管護巡查方案
- 電子政務概論-形考任務5(在線測試權(quán)重20%)-國開-參考資料
- 古代小說戲曲專題-形考任務2-國開-參考資料
- 24個專業(yè)105個病種中醫(yī)臨床路徑
- 裝配式建筑練習測試題附答案
- 遼寧省大連市金普新區(qū)2023-2024學年部編版七年級下學期期末歷史試卷
- 加工紙張合同協(xié)議書
- 智聯(lián)國企行測筆試真題
- 概率論在實際生活中的應用
- 醫(yī)療科研成果的轉(zhuǎn)化與應用
評論
0/150
提交評論