Joon Park(IBM Cloud Engineer)

๋ณธ ๋ฌธ์„œ๋Š” IBM Cloud Public(IaaS)์˜ LB(Load Balancer) ์˜คํผ๋ง ์ค‘์—์„œ Software Defined LB ๋ฐฉ์‹์ธ โ€œBluemix LBโ€ ์— ๋Œ€ํ•œ ์„ค์ • ๋ฐ ํ…Œ์ŠคํŠธ์— ๋Œ€ํ•œ ํ•ธ์ฆˆ์˜จ(Hands-on) ๊ฐ€์ด๋“œ์ž…๋‹ˆ๋‹ค. Blumix LB ์˜ ๊ณต์‹ ๊ฐ€์ด๋“œ(ํ•œ๊ธ€๊ฐ€๋Šฅ, ํŽ˜์ด์ง€ ํ•˜๋‹จ์—์„œ ์–ธ์–ด์„ ํƒ)๋Š”https://console.bluemix.net/docs/infrastructure/loadbalancer-service/basic-load-balancing.html์—์„œ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

1. LBaaS(Load Balancer as a Service) ์ฃผ๋ฌธ

Bluemix LB ์˜ ๊ฒฝ์šฐ ์•„๋ž˜์™€ ๊ฐ™์ด ์ฃผ๋ฌธ(Order) ์ง„ํ–‰์‹œ 6๋‹จ๊ณ„๋กœ ๊ตฌ์„ฑ๋˜๋ฉฐ, ๊ฐ๊ฐ์˜ ๋‹จ๊ณ„๋ฅผ ์š”์•ฝํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋‹จ์ผ IBM Cloud Public(IaaS) ๊ณ„์ •์—์„œ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” Bluemix LB๋Š” ์ตœ๋Œ€ 20๊ฐœ ์ด๋ฉฐ, ์ถ”๊ฐ€ ์ƒ์„ฑ์ด ํ•„์š”ํ•  ๊ฒฝ์šฐ IBM Sales ์ชฝ์— ๋ฌธ์˜ ๋ถ€ํƒ ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

– 1๋‹จ๊ณ„) Plan: LB(Load Balancer)๋ฅผ ๋ฐฐํฌํ•  Data Center ์„ ํƒ
– 2๋‹จ๊ณ„) Network Settings: LB ์— ์ ์šฉํ•  ์„œ๋ฒ„์˜ Private Subnet ์„ ํƒ ๋ฐ Public Subnet ์ ์šฉ ์—ฌ๋ถ€ ์„ ํƒ
– 3๋‹จ๊ณ„) Basic: LB ์˜ Public Endpoint URL ์ •์˜, Protocol๋ฐ Port์ •์˜, Load Balancing ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์„ ํƒ
– 4๋‹จ๊ณ„) Health Checks: LB ์™€ ์„œ๋ฒ„๊ฐ„์— Health Check ์„ค์ •(ํ—ฌ์Šค์ฒดํฌ ์ธํ„ฐ๋ฒŒ, ๋””๋ ‰ํ† ๋ฆฌ ๋“ฑ)
– 5๋‹จ๊ณ„) Server Instances: LB ์— ์ ์šฉํ•  ์„œ๋ฒ„ ์„ ํƒ
– 6๋‹จ๊ณ„) Review: LB ๊ตฌ์„ฑ์— ๋Œ€ํ•œ ์ตœ์ข… ๋ฆฌ๋ทฐ ๋ฐ ์ตœ์ข… ์ฃผ๋ฌธ

 

1) Plan

– IBM Cloud Portal ํ™”๋ฉด์—์„œ โ€œNetworkโ€ -> โ€œLoad Balancingโ€ -> โ€œLocalโ€ ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

 

– โ€œOrder IBM Bluemix Load Balancerโ€ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

 

– LB ๋ฅผ ๋ฐฐํฌํ•  โ€œData Centerโ€ ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

2) Network Settings

– Private Subnet ์„ ์„ ํƒํ•˜๋Š” ํ™”๋ฉด์ž…๋‹ˆ๋‹ค. LB ๋ฅผ ๋ฐฐํฌํ•˜๊ณ  LB ์— ์—ฐ๋™ํ•  ์„œ๋ฒ„๊ฐ€ ์กด์žฌํ•˜๋Š” Private Subnet ์„ ์„ ํƒํ•ด์•ผ ๋ฉ๋‹ˆ๋‹ค.

– ์œ„ ๊ทธ๋ฆผ์—๋Š” Seoul Data Center ์— 1๊ฐœ์˜ Private Subnet ์ด ์กด์žฌํ•จ์œผ๋กœ, ๊ทธ๋ƒฅ ์„ ํƒํ•˜๋ฉด ๋˜๋‚˜, ํ˜น์‹œ๋ผ๋„ ํ˜„์žฌ ์‚ฌ์šฉํ•˜์‹œ๋Š” ๊ณ„์ •์—์„œ LB ๋ฅผ ๋ฐฐํฌํ•˜๋ ค๋Š” Data Center ์— Private Subnet ์ด ๋ณต์ˆ˜๋กœ ์กด์žฌํ•œ๋‹ค๋ฉด, Network -> IP Management -> VLAN ํ•ญ๋ชฉ์—์„œ ํ™•์ธํ•˜์‹œ๊ณ , LB ๋ฐฐํฌ์‹œ์— ์ •ํ™•ํ•œ Private Subnet ์„ ์„ ํƒํ•˜์…”์•ผ ๋ฉ๋‹ˆ๋‹ค.

 


– โ€œLoad Balancer Public IPsโ€ ์„ ํƒ ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ์ตœ์ดˆ์— ํ•œ๋ฒˆ ์„ ํƒํ•˜๋ฉด LB ๋ฐฐํฌ ํ›„์— ์ˆ˜์ •์ด ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
. Allocation from IBM system pool(Default) ์„ ์„ ํƒํ•˜์‹œ๋ฉด, LB ์˜ Public end-point URL ์—์„œ ๋ฐ”๋กœ LB ์— ์—ฐ๊ฒฐ๋œ Server ์˜ Private IP ๋กœ ์„ธ์…˜์ด ์—ฐ๊ฒฐ๋ฉ๋‹ˆ๋‹ค.
. Allocate from a Public Subnet in this account ๋ฅผ ์„ ํƒํ•˜๋ฉด, LB ์˜ Public end-point URL ์—์„œ ํ•ด๋‹น LB ๋ฅผ ๋ฐฐํฌํ•œ Data Center ์— ์กด์žฌํ•˜๋Š” Public Subnet ์„ ๊ฑฐ์ณ์„œ LB ์— ์—ฐ๊ฒฐ๋œ Server ์˜ Private IP ๋กœ ์—ฐ๊ฒฐ๋ฉ๋‹ˆ๋‹ค.
– ์ฆ‰, LB ์™€ Server ์ค‘๊ฐ„์— ๊ณ ๊ฐ์ด ์ปจํŠธ๋กคํ•˜๋Š” Firewall ์„ ์ ์šฉํ• ์ง€ ์—ฌ๋ถ€์— ๋Œ€ํ•˜์—ฌ ์ •ํ•  ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. Firewall ์ ์šฉ ์›ํ•œ๋‹ค๋ฉด, ๊ณ ๊ฐ์ด ๋ณด์œ ํ•˜๊ณ  ์žˆ๋Š” Public Subnet ์— ์ ์šฉ๋œ Firewall ์„ ํ†ต๊ณผํ•˜๋ฉฐ ํŠธ๋ž˜ํ”ฝ์ด In/Outbound ๊ฐ€ ๋˜๋ฉฐ, LB ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•œ TCP 56501 ํฌํŠธ๊ฐ€ ๋ฐ˜๋“œ์‹œ Allow ๋˜์–ด ์žˆ์–ด์•ผ ๋ฉ๋‹ˆ๋‹ค.

3) Basics

Name: LB ์˜ Public Domain ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ์•„๋ž˜ ํ™”๋ฉด๊ณผ ๊ฐ™์ด โ€œdemo-lbโ€ ๋กœ ์ž…๋ ฅํ•œ๋‹ค๋ฉด, ํ•ด๋‹น LB ์˜ End-Point(Public Domain) ๋Š” http://demo-lb -“Account_ID”-seo01.lb.bluemix.net ๋กœ ๋ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ โ€œAccount_IDโ€ ๋Š” IBM Cloud Public(IaaS) ๊ณ„์ •์˜ 6์ž๋ฆฌ ๊ณ ์œ ์ˆซ์ž์ด๋ฉฐ, ๊ณ ๊ฐ์ด ์„ ํƒํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

Protocol configuration: LB ๊ฐ€ Listen ํ•  ํ”„๋กœํ† ์ฝœ๊ณผ ํฌํŠธ ๊ทธ๋ฆฌ๊ณ  LB ์— ์—ฐ๋™ํ•  ์„œ๋ฒ„์— ๋ณด๋‚ผ ํ”„๋กœํ† ์ฝœ๊ณผ ํฌํŠธ๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ, ๋กœ๋“œ๋ฒจ๋Ÿฐ์‹ฑ ์•Œ๊ณ ๋ฆฌ์ฆ˜๊ณผ LB ํ†ตํ•˜์—ฌ ํ†ต์‹ ํ•  End User ์™€ LB ์— ์—ฐ๋™๋œ ์„œ๋ฒ„์™€์˜ ์„ธ์…˜์— ๋Œ€ํ•˜์—ฌ ์ง€์†์„ฑ์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๋Š” ์˜ต์…˜(Session Stickness)์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ตœ๋Œ€ 50๊ฐœ์˜ Protocol Configuration ์ถ”๊ฐ€๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
. FRONT-END PROTOCOL, PORT: LB ์—์„œ Listen ํ•  Protocol ๊ณผ Port ๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ํ”„๋กœํ† ์ฝœ์€ HTTPS, HTTP, TCP ๋ฅผ ์ง€์›ํ•˜๋ฉฐ, ํฌํŠธ๋Š” 1 – 65535 ๊นŒ์ง€ ์ •์˜ ํ•  ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
. BACK-END PROTOCOL, PORT: LB ์— ์—ฐ๋™๋  ์„œ๋ฒ„๊ฐ€ Listen ํ•˜๊ณ  ์žˆ๋Š” Protocol ๊ณผ Port ๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. HTTP, TCP ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
. Method: ๋กœ๋“œ๋ฒจ๋Ÿฐ์‹ฑ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์„ ํƒ ์˜ต์…˜์ž…๋‹ˆ๋‹ค. Round Robin, Weighted Round Robin, Least Connection ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. Round Robin ์€ LB ์— ์—ฐ๋™๋œ ์„œ๋ฒ„์—๊ฒŒ ์ˆœ์„œ๋Œ€๋กœ ๋ฒจ๋Ÿฐ์‹ฑ์„ ํ•˜๋ฉฐ, Weighted ์˜ต์…˜์„ ์ฃผ๋ฉด, LB ์— ์—ฐ๋™๋œ ์„œ๋ฒ„ ๋ณ„๋กœ ๊ฐ€์ค‘์น˜๋ฅผ ์ค„ ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์€ โ€œ50โ€์ด๋ฉฐ, ์ตœ์†Œ โ€œ0โ€, ์ตœ๋Œ€ โ€œ100โ€๊นŒ์ง€ ์„ค์ •ํ•  ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋†’์„ ์ˆ˜๋ก ๊ฐ€์ค‘์น˜๊ฐ€ ๋†’์œผ๋ฉฐ, ๊ฐ€์ค‘์น˜๊ฐ€ ๋‚ฎ์€ ์„œ๋ฒ„์— ๋น„ํ•˜์—ฌ ๋” ๋งŽ์ด LB ๋กœ ๋ถ€ํ„ฐ ๋ฒจ๋Ÿฐ์‹ฑ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค. โ€œ0โ€ ์œผ๋กœ ํ•˜๊ฒŒ ๋˜๋ฉด, ๊ธฐ์กด์˜ ์„ธ์…˜์€ ์œ ์ง€ํ•˜๋ฉฐ ์‹ ๊ทœ ์„ธ์…˜์„ ๋ฐ›์ง€ ์•Š์Šต๋‹ˆ๋‹ค. โ€œ์ฒญ๋…น๋ฐฐํฌ(Blue-Green Deployment)โ€์— ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค. ๋งˆ์ง€๋ง‰์œผ๋กœ Least Connection ์€ LB ์™€ ํ•ด๋‹น ์„œ๋ฒ„ ๊ฐ„์˜ Connection ์ด ์ ์€ ์„œ๋ฒ„๋ถ€ํ„ฐ ๋ฒจ๋Ÿฐ์‹ฑ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.
. Session Stickness: Default ๊ฐ’์€ Disable ๋˜ ์–ด ์žˆ์œผ๋ฉฐ, Enable(Source IP) ์„ ํƒํ•˜๋ฉด, 1๋ฒˆ ์‚ฌ์šฉ์ž๋Š” LB ๋ฅผ ํ†ตํ•˜์—ฌ ์ตœ์ดˆ์— 1๋ฒˆ์›น์„œ๋ฒ„์— ์—ฐ๊ฒฐ์ด ๋˜์—ˆ๋‹ค๋ฉด, 1๋ฒˆ ์‚ฌ์šฉ์ž๋Š” ๋‹ค์Œ ์„ธ์…˜ ์š”์ฒญ ์‹œ์—๋„ 2๋ฒˆ ์›น์„œ๋ฒ„๊ฐ€ ์•„๋‹Œ 1๋ฒˆ ์›น์„œ๋ฒ„๋กœ ์—ฐ๊ฒฐ์ด ๋ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ์˜ต์…˜์ด Disable ๋˜์–ด ์žˆ๋‹ค๋ฉด, 1๋ฒˆ ์‚ฌ์šฉ์ž๋Š” ์ ‘์†์‹œ 1๋ฒˆ ์›น์„œ๋ฒ„, ํ˜น์€ 2๋ฒˆ, 3๋ฒˆ ์›น์„œ๋ฒ„๋กœ ์—ฐ๊ฒฐ ๋  ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
. Max Connections(Optional): ํŠน๋ณ„ํ•œ ๊ฐ’(1 โ€“ 15,000)์„ ์ง€์ •ํ•˜์ง€ ์•Š์„ ๊ฒฝ์šฐ Default 15,000 ์ปจ๋„ฅ์…˜๊นŒ์ง€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

– SSL Offload ๊ธฐ๋Šฅ์„ ํ•„์š”ํ•  ๊ฒฝ์šฐ์—๋Š” ์œ„์™€ ๊ฐ™์€ ์„ค์ •์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. FRONT-END PROTOCOL ์€ HTTPS ๋กœ ์ ์šฉํ•˜๊ณ , FRONT-END PORT ๋Š” 443 ์œผ๋กœ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค. BACK-END๋Š” HTTP, 80 ์œผ๋กœ ์„ค์ •์„ ํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ์ฃผ์˜ํ•ด์•ผ ๋  ์‚ฌํ•ญ์€ SSL Offload ํŠน์„ฑ์ƒ LB ์— SSL ์ธ์ฆ์„œ(SSL Certificate)๋ฅผ ์ ์šฉํ•ด์•ผ ๋จ์œผ๋กœ, ์‚ฌ์ „์— IBM Cloud Portal ์— ๊ณ ๊ฐ์ด ๊ฐ–๊ณ  ์žˆ๋Š” SSL ์ธ์ฆ์„œ๋ฅผ ๋ฏธ๋ฆฌ ๋“ฑ๋ก์„ ํ•ด์•ผ ๋ฉ๋‹ˆ๋‹ค. ๋“ฑ๋ก๋ฐฉ๋ฒ•์€ ๋‹ค์Œ URL ์ฐธ๊ณ  ๋ถ€ํƒ ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

Enable SSL Offload

 

– SSL Offload ์—์„œ ์‚ฌ์šฉํ•  SSL ์ธ์ฆ์„œ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. Session Stickness ์˜ต์…˜์—์„œ Source IP ๋กœ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. HTTP ํ†ต์‹ ์„ ์œ„ํ•˜์—ฌ ์ถ”๊ฐ€๋กœ FRONT-END ์— HTTP, 80 ์œผ๋กœ ์„ค์ •์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

4) Health Checks

– ํ—ฌ์Šค์ฒดํฌ๋Š” ์•ž์— 3)Basics ๋‹จ๊ณ„์—์„œ ์ •์˜ํ•œ BACK-END PROTOCOL, PORT ์„ค์ •์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•˜์—ฌ์„œ ์ ์šฉ์ด ๋ฉ๋‹ˆ๋‹ค. ์œ„ ๊ทธ๋ฆผ์€ ๊ธฐ๋ณธ๊ฐ’(Default)์ด๋ฉฐ, HTTP 80 ํฌํŠธ์— ๋Œ€ํ•˜์—ฌ 5์ดˆ ๊ฐ„๊ฒฉ์œผ๋กœ ๊ธฐ๋ณธ ํŽ˜์ด์ง€ โ€œ/โ€ ๋ฅผ ํ†ตํ•˜์—ฌ ํ—ฌ์Šค์ฒดํฌ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉฐ, 2์ดˆ ๋™์•ˆ ํ•ด๋‹น ์„œ๋ฒ„๊ฐ€ ์‘๋‹ต์ด ์—†๋‹ค๋ฉด, ์ตœ๋Œ€ 2ํšŒ ๊นŒ์ง€ ํ—ฌ์Šค์ฒดํฌ๋ฅผ ๋‹ค์‹œ ์š”์ฒญํ•˜๋ฉฐ, 2ํšŒ ๊นŒ์ง€ ํ—ฌ์Šค์ฒดํฌ๋ฅผ ์‹คํŒจํ•  ๊ฒฝ์šฐ ํ•ด๋‹น ์„œ๋ฒ„๋Š” Down(Unhealthy)๋˜์—ˆ๋‹ค๊ณ  ๊ฐ„์ฃผํ•˜๊ณ , ํ•ด๋‹น LB ์—์„œ ์ œ์™ธ(์„œ๋น„์Šค์—์„œ ์ œ์™ธ) ์‹œํ‚ต๋‹ˆ๋‹ค.

5) Server Instances

– ์ด์ œ LB ์— ์ ์šฉ๋ (์„œ๋น„์Šค์— ํˆฌ์ž…๋ ) ์„œ๋ฒ„๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ๋‹จ์ผ Bluemix LB ์— ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋Š” ์„œ๋ฒ„(์ธ์Šคํ„ด์Šค)์˜ ์ตœ๋Œ€ ์ˆ˜๋Ÿ‰์€ 50๊ฐœ์ž…๋‹ˆ๋‹ค. ๋ณธ ๊ฐ€์ด๋“œ์—์„œ๋Š” ์ด๋ฏธ ๋ฐฐํฌํ•˜์—ฌ ์›น์„œ๋น„์Šค ๋ฐ๋ชฌ(์•„ํŒŒ์น˜)์„ ๊ตฌ๋™ํ•˜์—ฌ http 80 ํฌํŠธ๊ฐ€ Listen ๋˜๊ณ  ์žˆ๋Š” web01, web02 ์— ๋Œ€ํ•˜์—ฌ ์„ ํƒํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

– ์œ„ ํ™”๋ฉด์—์„œ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•œ ๊ฒƒ ์ฒ˜๋Ÿผ, LB ์™€ ์„œ๋ฒ„์˜ ์—ฐ๊ฒฐ์€ Private Network ๋ฅผ ํ†ตํ•˜์—ฌ ์—ฐ๋™์ด ๋ฉ๋‹ˆ๋‹ค. ์ตœ์ดˆ์— LB ์ฃผ๋ฌธ์‹œ์— Private Subnet ์„ ์„ ํƒ์ด ํ•„์š”ํ–ˆ๋˜ ์ด์œ ๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. LB ์— ์ ์šฉํ•  ์„œ๋ฒ„๊ฐ€ ํ•ด๋‹น ๋ฆฌ์ŠคํŠธ์— ๋‚˜ํƒ€๋‚˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, ์ตœ์ดˆ์— LB ์ฃผ๋ฌธ์‹œ์— Private Subnet ์„ ์ •ํ™•ํ•˜๊ฒŒ ์„ ํƒํ•˜์˜€๋Š”์ง€ ๋‹ค์‹œ ํ•œ๋ฒˆ ํ™•์ธ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

6) Review

– ์ตœ์ข… ์ฃผ๋ฌธ์„ ์œ„ํ•œ โ€œReviewโ€ ๋‹จ๊ณ„์ž…๋‹ˆ๋‹ค.

2. LBaaS(Load Balancer as a Service) ๋™์ž‘ ํ™•์ธ

– ์ตœ์ข… ์ฃผ๋ฌธ์„ ์™„๋ฃŒํ•˜๊ณ , ์ฃผ๋ฌธํ•œ LB ์˜ STATUS ๊ฐ€ โ€œOnlineโ€ ์ด ๋˜๋Š” ๊ฒƒ์„ ๊ธฐ๋‹ค๋ฆฝ๋‹ˆ๋‹ค. STATUS ๊ฐ€ Online ์œผ๋กœ ๋‚˜์˜ค์ง€ ์•Š๊ณ , Offline ์œผ๋กœ ์žฅ์‹œ๊ฐ„ ์œ ์ง€๊ฐ€ ๋œ๋‹ค๋ฉด, ํ•ด๋‹น LB ์ฃผ๋ฌธ ์‹œ์— โ€œNetwork Settingsโ€์—์„œ ๋ฐฉํ™”๋ฒฝ ์ ์šฉ ์˜ต์…˜์„ ์„ ํƒํ•˜์‹  ๊ฒƒ์ด ์•„๋‹Œ์ง€ ํ™•์ธ์ด ํ•„์š”ํ•˜๋ฉฐ, ๊ทธ๋ ‡๋‹ค๋ฉด ํ•ด๋‹น ๋ฐฉํ™”๋ฒฝ์—์„œ TCP 5601 ํฌํŠธ์— ๋Œ€ํ•˜์—ฌ Open ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. http://knowledgelayer.softlayer.com/faq/what-ip-ranges-do-i-allow-through-firewall

 

– LB ์„ธ๋ถ€ํ™”๋ฉด์— ๋“ค์–ด๊ฐ€๋ฉด, ๊ฐ€์žฅ ๋จผ์ € LB ์ฃผ๋ฌธ์‹œ์— ์ถ”๊ฐ€ํ–ˆ๋˜ ์„œ๋ฒ„์— ๋Œ€ํ•˜์—ฌ Health Status ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. LB ์ฃผ๋ฌธ์‹œ์— HTTP, HTTPS ์— ๋Œ€ํ•œ ์ด2๊ฐœ์˜ Service Group ์„ ์ •์˜ํ•˜์˜€์Œ์œผ๋กœ Health Status ํ•ญ๋ชฉ์—์„œ ๊ฐ๊ฐ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

– ์ฃผ๋ฌธํ•œ LB ์˜ Public DNS(์„œ๋น„์Šค ๋„๋ฉ”์ธ)์€ โ€œdemo-lb -1412953-seo01.lb.bluemix.netโ€ ์ž…๋‹ˆ๋‹ค. LB ์— ์—ฐ๋™ํ•œ ์„œ๋ฒ„ Health Check ๊ฐ€ ์ •์ƒ์ธ์ง€ ํ™•์ธํ•˜๊ณ  ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์—ด๊ณ  ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ด…๋‹ˆ๋‹ค. ๋จผ์ € http ํ”„๋กœํ† ์ฝœ ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

– LB ์ฃผ๋ฌธ์‹œ ์ž…๋ ฅํ–ˆ๋˜ โ€œdemo-lbโ€ ๊ฐ€ ํฌํ•จ๋œ ์„œ๋น„์Šค URL ์„ ๋ธŒ๋ผ์šฐ์ €์— ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. http://demo-lb -1412953-seo01.lb.bluemix.net

 

– LB ์— ์—ฐ๊ฒฐ๋œ ์„œ๋ฒ„๊ฐ€ 2๊ฐœ ์ด์ƒ ์žˆ์œผ๋ฉฐ, LB ์„ค์ •์—์„œ Session Stick ๋ฅผ Disable๋กœ ํ–ˆ๋‹ค๋ฉด, ์„œ๋ฒ„ 1๋ฒˆ๊ณผ ์„œ๋ฒ„ 2๋ฒˆ์ด LB ๋ฅผ ํ†ตํ•˜์—ฌ ์ˆœ์„œ๋Œ€๋กœ ๋ฒจ๋Ÿฐ์‹ฑ์ด ๋ฉ๋‹ˆ๋‹ค. ๋‹ค๋งŒ, ๋ณธ ๊ฐ€์ด๋“œ์—์„œ๋Š” ์ตœ์ดˆ LB ๋ฐฐํฌ์‹œ Session Stickness ๋ฅผ Source IP ๋กœ ์„ค์ •ํ–ˆ๊ธฐ์—, ๋ธŒ๋ผ์šฐ์ €๋ฅผ ๋ฆฌํ”„๋ž˜์‰ฌ ํ•ด๋„ Web01๊ณผ Web02 ๊ฐ€ ์ˆœ์„œ๋Œ€๋กœ ๋‚˜์˜ค์ง€ ์•Š์œผ๋ฉฐ, Wee01 ํ™”๋ฉด๋งŒ ๋‚˜์˜ต๋‹ˆ๋‹ค. ์ฐธ๊ณ ๋กœ ์ต์Šคํ”Œ๋กœ๋Ÿฌ๋Š” โ€œCtrl+F5โ€ ๋ฅผ ํ†ตํ•˜์—ฌ ๋ฆฌํ”„๋ž˜์‰ฌ๋ฅผ ํ•˜๋ฉด No-Cache ๋กœ ๋ฆฌํ”„๋ž˜์‰ฌํ•ฉ๋‹ˆ๋‹ค.

 

– ์œ„ ํ™”๋ฉด๊ณผ ๊ฐ™์ด. Session Stickness ์˜ต์…˜์„ Disable ํ•˜๊ณ  ๋‹ค์‹œ ๋ธŒ๋ผ์šฐ์ €์—์„œ ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ด…๋‹ˆ๋‹ค.

 


– ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ƒˆ๋กœ๊ณ ์นจ์„ ํ•˜๋ฉด, web01, web02 ๊ฐ€ ์ˆœ์„œ๋Œ€๋กœ ๋‚˜์˜ค๋Š” ๊ฒƒ์„ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

– ์ด์ œ http ๊ฐ€ ์•„๋‹Œ https ์ ‘์† ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. URL ์€ ๋™์ผํ•˜๋ฉฐ, ํ”„๋กœํ† ์ฝœ๋งŒ http ๊ฐ€ ์•„๋‹Œ https ๋กœ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. 1๊ฐœ์˜ LB ์—์„œ http ์™€ https with SSL Offload ๋กœ ์„ธํŒ…์„ ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

 

– URL โ€œhttps://demo-lb -1412953-seo01.lb.bluemix.netโ€ ์„ ๋ธŒ๋ผ์šฐ์ €์— ์ž…๋ ฅํ•˜๋ฉด, ๋ณด์•ˆ ๊ฒฝ๊ณ  ํ™”๋ฉด์ด ๋œน๋‹ˆ๋‹ค. LB ์— ์ ์šฉํ•œ SSL ์ธ์ฆ์„œ๊ฐ€ CA ์—์„œ ์ธ์ฆํ•œ ๊ณต์ธ์ธ์ฆ์„œ๊ฐ€ ์•„๋‹Œ ์‚ฌ์„ค์ธ์ฆ์„œ์ด๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๋ธŒ๋ผ์šฐ์ €์— ๋”ฐ๋ผ ๋ฐฉ๋ฒ•์ด ๋‹ค๋ฅด์ง€๋งŒ, ๋ฌด์‹œ ํ•˜๊ณ  ์ง„ํ–‰์„ ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

– ๋ณด์•ˆ ๊ฒฝ๊ณ ๋ฅผ ๋ฌด์‹œํ•˜๊ณ  ์ง„ํ–‰ํ•˜์‹œ๋ฉด ์•„๋ž˜ ํ™”๋ฉด๊ณผ ๊ฐ™์ด https ๋กœ ์ ‘์†์„ ์„ฑ๊ณตํ•œ ํ™”๋ฉด ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. URL ์™ผ์ชฝ์— โ€œ์ž๋ฌผ์‡ โ€ ๋ฅผ ํ†ตํ•˜์—ฌ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

– โ€œ์ž๋ฌผ์‡ โ€ ๋ชจ์–‘์„ ํด๋ฆญํ•˜๋ฉด, LB ์— ์ ์šฉํ•œ SSL ๊ณผ ๋™์ผํ•œ ๊ฒƒ์ž„์„ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

3. LBaaS(Load Balancer as a Service) Health Check ํ…Œ์ŠคํŠธ

 

์ด๋ฒˆ ์žฅ์—์„œ๋Š” ๋ฐฐํฌํ•œ LB ์— ๋Œ€ํ•˜์—ฌ ํ—ฌ์Šค ์ฒดํฌ ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. LB ์— ์—ฐ๊ฒฐ๋œ ์›น์„œ๋ฒ„์— ์›น์„œ๋น„์Šค ๋ฐ๋ชฌ(httpd)์„ ๊ฐ•์ œ๋กœ ์ฃฝ์ธ ํ›„์— ํ—ฌ์Šค์ฒดํฌ ์ƒํƒœ๊ฐ€ ๋ณ€ํ•˜๋Š”์ง€, ๊ทธ๋ฆฌ๊ณ  LB ์—์„œ ํ•ด๋‹น ์›น์„œ๋ฒ„๊ฐ€ ์ œ์™ธ(์„œ๋น„์Šค์—์„œ ์ œ์™ธ)๋˜๋Š”์ง€๋ฅผ ํ™•์ธํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

– ํ˜„์žฌ LB ์—๋Š” Web01 ๊ณผ Web02 ์„œ๋ฒ„ ์ด 2๋Œ€๊ฐ€ ์—ฐ๊ฒฐ ๋˜์–ด ์žˆ์œผ๋ฉฐ, ๊ฐ๊ฐ์˜ ์„œ๋ฒ„์—๋Š” http 80, https 443 ์œผ๋กœ ํ—ฌ์Šค์ฒดํฌ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. 2/ 2 Healthy: ์ด 2๋Œ€ ์ค‘์— 2๋Œ€๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์šด์˜ ์ค‘

 

– web01 ์„œ๋ฒ„์— ์ ‘์†ํ•˜์—ฌ์„œ ์•„ํŒŒ์น˜ ๋ฐ๋ชฌโ€httpdโ€ ์„ ์ˆ˜๋™์œผ๋กœ ์ค‘์ง€ ์‹œํ‚ต๋‹ˆ๋‹ค.

 

– ์•„๋ž˜ ํ™”๋ฉด๊ณผ ๊ฐ™์ด, ์ด 2๋Œ€ ์ค‘์— 1๋Œ€๋งŒ ์ •์ƒ์ ์ธ Healthy ์ƒํƒœ๋กœ ํ—ฌ์Šค์ฒดํฌ์ƒํƒœ(Health Checks Status)๊ฐ€ ๋ฐ”๋€๋‹ˆ๋‹ค.

 

– ์ด์ œ LB Public Domain ์„ ๋ธŒ๋ผ์šฐ์ €์— ์ž…๋ ฅํ•˜์—ฌ ์„œ๋น„์Šค๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ํ—ฌ์Šค์ฒดํฌ ์ƒํƒœ์—์„œ ํ™•์ธํ•œ ๋Œ€๋กœ web01 ์€ ์„œ๋น„์Šค์—์„œ ์ œ์™ธ๋˜์–ด์„œ ๋ธŒ๋ผ์šฐ์ €๋ฅผ ํ†ตํ•˜์—ฌ web02 ๋งŒ ํ™”๋ฉด์— ๋‚˜์˜ต๋‹ˆ๋‹ค.


– ๋‹ค์‹œ, web01 ์„œ๋ฒ„์— ์ ‘์†ํ•˜์—ฌ ์›น์„œ๋น„์Šค ๋ฐ๋ชฌโ€httpdโ€ ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

 

– LB ํ™”๋ฉด์˜ ํ—ฌ์Šค์ฒดํฌ ์ƒํƒœ์—์„œ 1 / 2 ์—์„œ 2 / 2๋กœ ๋ณ€๊ฒฝ๋œ ๊ฒƒ์— ๋Œ€ํ•˜์—ฌ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.


– LB ์˜ Public Domain ์„ ํ†ตํ•˜์—ฌ ๋ธŒ๋ผ์šฐ์ € ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ Web01 ์ด ๋‹ค์‹œ LB ์— ๋“ฑ๋ก๋œ ๊ฒƒ์„ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

 

์ด์ƒ์œผ๋กœ IBM Cloud Public(IaaS) ์˜ LBaaS โ€œBluemix LBโ€์— ๋Œ€ํ•œ ๊ฐ€์ด๋“œ๋ฅผ ๋งˆ์นฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๊ฐ€์ด๋“œ๋Š” ํ–ฅํ›„ ์ง€์†์ ์œผ๋กœ ์—…๋ฐ์ดํŠธ ์˜ˆ์ •์ด๋ฉฐ IBM ํด๋ผ์šฐ๋“œ ๊ธฐ์ˆ ํฌ๋Ÿผ(https://developer.ibm.com/kr/cloud/bluemix-_infrastructure)์—์„œ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

ํ† ๋ก  ์ฐธ๊ฐ€

์ด๋ฉ”์ผ์€ ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ์ž…๋ ฅ์ฐฝ์€ * ๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.