세이박스

'Load'에 해당되는 글 1건

  1. L4 Switch Server Load Balancing방법

L4 Switch Server Load Balancing방법

서버,보안

L4 Switch Server Load Balancing방법

1. Server Load Balancing 의 필요성
2. Server Load Balancing 의 이해
3. Server Load Balancing 기본구성
4. Terminology
5. Load Balancing Algorithm
6. Server Load Balancing Processing
7. Server Load Balancing Configuration
8. Information / Statistics View
9. 점검사항
10. Redundancy SLB 구현사례

1. Server load Balancing의 필요성
Internet Server Traffic 의 급증
- Internet 응답속도 지연
- Server 효율성 저하
- Service 신뢰성 상실

Internet Traffic 극복
- Server Load Balancing 필요성 제기

2. Server load Balancing의 이해
기존 Server Load Balancing 방법
- DNS Round-Robin을 이용한 Server Load Balancing

L4를 통한 Server Load Balancing
- TCP session관리가 Layer 4 장비를 통하여 가능하게 됨에 따라 다양하고 확실한 Load Balancing 구현
- Client가 웹 브라우저 상에서 URL을 입력하여 DNS로 하여금 얻어지는 Ip address값 (L4에서는 Virtual IP :VIP 이라고 말한다.) 을 통하여 L4의 Virtual Server로 접속.
- Virtual Serve의r로 접속하게된 http request는 Vip로 mapping되어있는 실제서버(real server) Group matching.
- Server group으로 Matching 시키는 기법은 L4가 가지고 있는 여러 가지 분산 알고리즘에 의해 작동하게 되는데 사이트의 성격에 따라 알맞게 선택.

3. Server Load Balancing의 기본구성

4. Terminology

Client ports
- Client processing을 적용할 수 있는 switch port
- 각각의 session을 server로 할당 / VIP를 RIP로 변환

Server ports
- Server processing을 적용할 수 있는 switch port / RIP를 VIP로 변환
Health Check
- Server의 이상유무를 수시로 점검하는 기능 ( http, tcp, ftp, icmp ...)

5. Load Balancing Algorithm

Round Robin
- Real server로 session을 순차적을 맺어주는 방식

Least Connection
- real server의 open 세션 수를 고려한 다음, 가장 적은 수의 open
session을 가진 real server로 session을 맺어 주는 방식.

- 각 real server들이 서로 상이한 resource와 connection에 부수되는 시간과 데이터 양이 서로 다른 환경에서 활용할 수 있다.

Hash
- Clients와 Server 간에 한번 성립된 session을 계속해서 유지해 주는 방식으로 특정 client는 특정 server로만 접속하게 된다.
- 이 방식은 clients source IP address (32 bit) 값을 real server의 대수로 나눈 나머지 값으로 connection할 server 결정

Minimum Missies
- Hash Algorithm과 거의 유사

- 역시 clients source IP address (32 bit) 값을 real server의 대수로 나눈 나머지 값으로 connection할 server 결정

- 그러나, 이 Algorithm은 Cache Redirection에 주로 사용하도록 권장

6. Server Load Balancing processing
Client Processing

- VIP (Virtual IP address)를 RIP (Real IP address)로 변환하는 작업

Server Processing

- RIP (Real IP address)를 VIP (Virtual IP address)로 변환하는 작업

7. Server Load Balancing Configuration

Alteon L4 command
[Main Menu] ; L4 booting시 최초 menu
info - Information Menu
stats - Statistics Menu
cfg - Configuration Menu
oper - Operations Command Menu
boot - Boot Options Menu
maint - Maintenance Menu
diff - Show pending config changes [global command]
apply - Apply pending config changes [global command]
save - Save updated config to FLASH [global command]
revert - Revert pending or applied changes [global command]
exit - Exit [global command, always available]
>> Main#

interface IP address / mask / broad

>> Main# /cfg/ip/if 1
------------------------------------------------------------
[IP Interface 1 Menu]
addr - Set IP address
mask - Set subnet mask
broad - Set broadcast address
ena - Enable IP interface
cur - Display current interface configuration

>> IP Interface 1# ma 255.255.255.128/addr 210.219.67.120/broad 210.219.67.127/ena

>> IP Interface 1# cur
Current interface 1:
210.219.67.120, 255.255.255.128, 210.219.67.127, vlan 1, enabled

default gateway

>> IP Interface 1# /cfg/ip/gw 1
------------------------------------------------------------
[Default gateway 1 Menu]
addr - Set IP address
ena - Enable default gateway
cur - Display current default gateway configuration

>> Default gateway 1# addr 210.219.67.128/ena

>> Default gateway 1# cur
Current default gateway 1:
addr 210.219.67.126, intr 2, retry 8, arp disabled, enabled

• Real Ip address

>> Default gateway 1# /cfg/slb/re 1
[Real server 1 Menu]
rip - Set IP addr of real server
ena - Enable real server
cur - Display current real server configuration

>> Real server 1 # rip 210.219.67.121/ena
>> Real server 1 # ../re 2
>> Real server 2 # rip 210.219.67.122/ena
>> Real server 2 # ../re 3
>> Real server 3 # rip 210.219.67.123/ena

Group / Metric / Health Check

>> Real server 3 # /cfg/slb/gr 1
------------------------------------------------------------
[Real server group 1 Menu]
metric - Set metric used to select next server in group
health - Set health check type
add - Add real server
cur - Display current group configuration

>> Real server group 1# add 1/add 2/add 3/metric leastconn/health tcp

>> Real server group 1# cur
Current real server group 1:
name , metric leastconns, backup none, realthr 0
health tcp, content
real servers:

1: 210.219.67.121, enabled, name , weight 1, timeout 10, maxcon 200000
backup none, inter 2, retry 4, restr 8

2: 210.219.67.122, enabled, name , weight 1, timeout 10, maxcon 200000
backup none, inter 2, retry 4, restr 8

3: 210.219.67.123, enabled, name , weight 1, timeout 10, maxcon 200000
backup none, Inter 2, retry 4, restr 8
remote disabled, proxy enabled, submac disabled

Vitual Ip address / Virtual port / group

>> Default gateway 1# /cfg/slb/vi 1
------------------------------------------------------------
[Virtual Server 1 Menu]
service - Virtual Service Menu
vip - Set IP addr of virtual server
ena - Enable virtual server
cur - Display current virtual configuration

>> Virtual Server 1# vip 210.219.67.124/ena
>> Virtual Server 1# service
Enter virtual port: 80
------------------------------------------------------------
[Virtual Server 1 http Service Menu]
group - Set real server group number
cur - Display current virtual service configuration
>> Virtual Server 1 http Service# gr 1
Current real server group: 1
New pending real server group: 1

>> Virtual Server 1# ../cur
Current virtual server 1:
0.0.0.0, disabled, ftpp disabled
virtual ports:
http: rport http, group 1, frags
real servers:
1: 210.219.67.121, weight 1, enabled, backup none
2: 210.219.67.122, weight 1, enabled, backup none
3: 210.219.67.123, weight 1, enabled, backup none

Client processing, server processing

>> Layer 4# po 1
------------------------------------------------------------
[SLB port 1 Menu]
client - Enable/disable client processing
server - Enable/disable server processing
cur - Display current port configuration

>> SLB port 1# client enable
>> SLB port 1# ../po 2
>> SLB port 2# server enable
>> SLB port 2# ../po 3
>> SLB port 3# server enable
>> SLB port 3# ../po 4
>> SLB port 4# server enable

SLB on/off

>> SLB port 4# /cfg/slb/
>> Layer 4# .
------------------------------------------------------------
[Layer 4 Menu]
real - Real Server Menu
group - Real Server Group Menu
virt - Virtual Server Menu
filt - Filtering Menu
port - Layer 4 Port Menu
gslb - Global SLB Menu
url - URL Resource Definition Menu
sync - Config Synch Menu
adv - Layer 4 Advanced Menu
on - Globally turn Layer 4 processing ON
off - Globally turn Layer 4 processing OFF
cur - Display current Layer 4 configuration

>> Layer 4# on

Information / statistics View - Telnet or Console

; Server Load Balancing을 위한 Setting이 끝난 후에 Telnet / Console /
Web Browser를 통하여 다양한 정보를 확인할 수 있다.

Link Information
; 각 port의 link상태를 확인할 수 있다.
>> Information# li
------------------------------------------------------------------
Port Speed Duplex Flow Ctrl Link
---- ----- -------- --TX-----RX-- ------
1 100* full* yes yes up
2 100 full yes yes up
3 100 full yes yes up
4 100 full yes yes up
5 100 full yes yes up
6 10/100 any yes yes down
7 10/100 any yes yes down
8 10/100 any yes yes down
* = value set by configuration; not autonegotiated.

ARP Information
; port에 물려있는 장비들의 Mac address값을 확인 할 수 있다.

>> Information / Address Resolution Protocol# d
IP address Flags MAC address VLAN Port Referenced ports
--------------- ----- ----------------- ---- ---- ----------------
210.219. 67.121 P 00:50:8b:69:82:57 1 2 1-8
210.219. 67.122 00:50:8b:69:82:56 1 4 empty
210.219. 67.123 00:50:8b:69:82:d9 1 3 empty
210.219. 67.124 P 4 00:60:cf:42:70:ee 1-8
210.219. 67.126 00:e0:2b:df:99:00 1 1 empty

IP Information
; L4의 Interface상태 / gateway 상태를 확인할 수 있다.

>> Information# ip
Interface information:
1: 210.219.67.120, 255.255.255.128, 211.196.157.127, vlan 1, up

Default gateway information: metric strict
1: 210.219.67.126, up

Server Load Balancing Information

; Virtual server, real server의 구성 및 상태를 확인 할 수 있다.

>> main# /information/slb/dump

Real server state:
2: 210.219. 67.121, 00:50:8b:69:82:d9, vlan 1, port 2, health 4, up
2: 210.219. 67.122, 00:50:8b:69:82:d8, vlan 1, port 3, health 4, up
2: 210.219. 67.123, 00:50:8b:69:82:d7, vlan 1, port 4, health 4, up

Virtual server state:
2: 210.219. 67.124, 00:60:cf:44:1a:ae
virtual ports:
http: rport http, group 1, backup none
real servers:
1: 210.219. 67.121, backup none, up
2: 210.219. 67.122, backup none, up
3: 210.219. 67.123, backup none, up

Port Statistics
; port에서의 frame error 또는 collision등을 확인할 수 있다.

>> Port Statistics# bridg
------------------------------------------------------------------
Bridging statistics for port 1:
dot1PortInFrames: 0
dot1PortOutFrames: 0
dot1PortInDiscards: 0
dot1TpLearnedEntryDiscards: 0
dot1BasePortDelayExceededDiscards: 0
dot1BasePortMtuExceededDiscards: 0
dot1StpPortForwardTransitions: 0

>> Port Statistics# ethernet
------------------------------------------------------------------
Ethernet statistics for port 1:
dot3StatsAlignmentErrors: 0
dot3StatsFCSErrors: 0
dot3StatsSingleCollisionFrames: 0
dot3StatsMultipleCollisionFrames: 0
dot3StatsSQETestErrors: 0
dot3StatsDeferredTransmissions: 0
dot3StatsLateCollisions: 0
dot3StatsExcessiveCollisions: 0
dot3StatsInternalMacTransmitErrors: 0

Group Session Statistics
; Group으로 load balancing 되어지는 session수를 확인할 수 있다.

>> Statistics # slb

>> Server Load Balancing Statistics# gr 1
------------------------------------------------------------------
Real server group 1 stats:
Current Total Highest
Real IP address Sessions Sessions Sessions Octets
---- --------------- -------- ---------- -------- ---------------
1 210.219. 67.121 1456 3455624 55675 62316
2 210.219. 67.122 2345 12344476 67896 165356559
3 210.219. 67.123 2565 24564476 67896 165356559
---- --------------- -------- ---------- -------- ---------------
5891 35676700 123411 165418875


출처: cafe.naver.com/netstuff