Route53 - Health Check

์ƒํƒœ ํ™•์ธ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.

  • Monitor an Endpoint
  • Calculated Health Checks
  • Private Hosted Zones

image-20220706020313873

  • ์ƒํƒœ ํ™•์ธ์€ ์ฃผ๋กœ public resource ์— ๋Œ€ํ•œ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋Š” ๋ฐฉ๋ฒ•

  • private resource์—์„œ๋„ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋Š” ๋ฐฉ๋ฒ• ๋˜ํ•œ ์กด์žฌํ•œ๋‹ค.

  • Health Check => DNS ์˜ ์žฅ์•  ์กฐ์น˜๋ฅผ ์ž๋™ํ™”ํ•˜๊ธฐ ์œ„ํ•œ ์ž‘์—…

    • 3๊ฐ€์ง€์˜ ์ƒํƒœ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

      1. ๊ณต์šฉ Endpoint ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋ง ํ•˜๋Š” ๊ฒƒ (App, Server, another AWS Resource)

        • Monitor an Endpoint
      2. ๋‹ค๋ฅธ ์ƒํƒœ ํ™•์ธ์„ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๋Š” ์ƒํƒœ ํ™•์ธ๋„ ์žˆ๋‹ค. (๊ณ„์‚ฐ๋œ ์ƒํƒœ ํ™•์ธ์ด๋ผ ๋ถˆ๋ฆฐ๋‹ค.)

        • Calculated Health Checks
      3. CloudWatch ๊ฒฝ๋ณด์˜ ์ƒํƒœ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๋Š” ์ƒํƒœ ํ™•์ธ๋„ ์žˆ๋‹ค.

        • Private Hosted Zones

        • ์ œ์–ด๊ฐ€ ์‰ฝ๊ณ , ๊ฐœ์ธ ๋ฆฌ์†Œ์Šค๋“ค์— ์œ ์šฉ

  • Health Check๋Š” CloudWatch ์ง€ํ‘œ์™€ ํ†ตํ•ฉ๋  ์ˆ˜ ์žˆ๋‹ค.

    • ์ƒํƒœ ํ™•์ธ๋“ค์€ ๊ฐ์ž์˜ ๋ฉ”ํŠธ๋ฆญ(์ง€ํ‘œ) ๋ฅผ ์‚ฌ์šฉ
    • CloudWatch ์˜ ์ง€ํ‘œ์—์„œ๋„ ํ™•์ธ์ด ๊ฐ€๋Šฅ
  • ์„œ๋กœ ๋‹ค๋ฅธ ๋‘ ์ง€์—ญ์— ๊ฐ ํ•˜๋‚˜์”ฉ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ๊ฐ€ ์กด์žฌ
  • ๋‹ค์ค‘ Region ์…‹์—…
  • Region Level ์—์„œ์˜ ๊ณ ๊ฐ€์šฉ์„ฑ์„ ์›ํ•˜๋Š” ์ƒํ™ฉ์ด๋‹ค.
  • Route53 ์„ ์ด์šฉํ•ด DNS Records ๋ฅผ ๋งŒ๋“ค๊ณ , mydomain.com ๊ณผ ๊ฐ™์€ URL ์ด์šฉํ•ด ์ ‘์†ํ•˜๋ฉด
    ์œ ์ €๋Š” ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ๋กœ ์—ฐ๊ฒฐ๋œ๋‹ค. (Latency-based)
  • But.. ๋งŒ์•ฝ ํ•œ ์ง€์—ญ์ด ์‚ฌ์šฉ ๋ถˆ๊ฐ€๋Šฅ ์ƒํƒœ๊ฐ€ ๋˜๋ฉด ๊ทธ๊ณณ์œผ๋กœ ์œ ์ €๋ฅผ ๋ณด๋‚ด๋ฉด ์•ˆ๋œ๋‹ค.
  • ๊ทธ๋Ÿฌ๊ธฐ ์œ„ํ•ด์„  Route53 ์—์„œ Health Check๋ฅผ ์ƒ์„ฑํ•ด์•ผ ํ•œ๋‹ค.

Health Checks - Monitor an Endpoint

์ƒํƒœํ™•์ธ(health check)์ด ํŠน์ • Endpoint ์—์„œ ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•˜๋Š”์ง€ ์•Œ์•„๋ณด์ž.

image-20220706021155356

ALB ์— ๋Œ€ํ•œ eu-west-1 ์˜ health check๋ฅผ ํ•œ๋‹ค๊ณ ํ•˜๋ฉด, AWS์˜ health check๊ฐ€ ์ „ ์„ธ๊ณ„๋กœ๋ถ€ํ„ฐ ์˜ฌ๊ฒ๋‹ˆ๋‹ค.
ํ•˜๋‚˜๊ฐ€ ์•„๋‹ˆ์ฃ , ์ „ ์„ธ๊ณ„๋กœ๋ถ€ํ„ฐ 15๊ฐœ ์ •๋„์˜ health check๊ฐ€ ์˜ต๋‹ˆ๋‹ค.

  • ์šฐ๋ฆฌ๊ฐ€ ๋ฃจํŠธ๋ฅผ ์„ค์ •ํ•œ ๊ณต์šฉ ์—”๋“œ ํฌ์ธํŠธ๋กœ ๋ชจ๋‘ ์š”์ฒญ์„ ๋ณด๋‚ธ๋‹ค.
  • 200OK ๋˜๋Š” ์šฐ๋ฆฌ๊ฐ€ ์ •์˜ํ•œ ์ฝ”๋“œ๋ฅผ ๋ฐ›์œผ๋ฉด resource๋Š” ์ •์ƒ์œผ๋กœ ๊ฐ„์ฃผ๋œ๋‹ค.
  • ์ „์„ธ๊ณ„์—์„œ ์˜จ 15๊ฐœ์˜ health check๊ฐ€ endpoint์˜ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๊ณ 
    ์ž„๊ณ„๊ฐ’์„ ์ •์ƒ ํ˜น์€ ๋น„์ •์ƒ์œผ๋กœ ์„ค์ •ํ•œ๋‹ค.
  • ๊ฐ„๊ฒฉ๋„ ์„ค์ • ๊ฐ€๋Šฅํ•˜๋‹ค.
    1. 30์ดˆ๋งˆ๋‹ค ์ •๊ธฐ์  ํ™•์ธ
    2. 10์ดˆ๋งˆ๋‹ค ์ •๊ธฐ์  ํ™•์ธ (๋น„์šฉ์ด ๋”๋“ค๊ณ , ๋น ๋ฅธ health check ๊ฐ€๋Šฅ)
  • HTTP, HTTPS, TCP ๋“ฑ ๋งŽ์€ ํ”„๋กœํ† ์ฝœ ์ง€์›
  • 18% ์ด์ƒ์˜ health check๊ฐ€ ์ •์ƒ์ด๋ผ๊ณ  ํŒ๋‹จํ•˜๋ฉด Route53 ๋„ ์ด๋ฅผ ์ •์ƒ์ด๋ผ๊ณ  ๊ฐ„์ฃผ
  • ๊ทธ๋ ‡์ง€์•Š๋‹ค๋ฉด ๋น„์ •์ƒ์ด๋ผ๊ณ  ์ธ์‹
  • health check๋Š” ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ๋กœ๋ถ€ํ„ฐ 2xx, 3xx ์ฝ”๋“œ๋ฅผ ๋ฐ›์•„์•ผ๋งŒ ํ†ต๊ณผ
  • health check๋Š” ํ…์ŠคํŠธ ๊ธฐ๋ฐ˜ ์‘๋‹ต์ผ ๊ฒฝ์šฐ, ์‘๋‹ต์˜ ์ฒ˜์Œ 5,120byte ํ™•์ธํ•˜์—ฌ ์‘๋‹ต์ž์ฒด์— ํ•ด๋‹น ํ…์ŠคํŠธ๊ฐ€ ์žˆ๋Š”์ง€ ๋ณธ๋‹ค.
  • health check๊ฐ€ ๊ฐ€๋Šฅํ•˜๋ ค๋ฉด, health check๊ฐ€ ์šฐ๋ฆฌ์˜ ALB ๋‚˜ Endpoint์— ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•ด์•ผ ํ•œ๋‹ค.
    • Route53 Health Check ์˜ IP ์ฃผ์†Œ๋ฒ”์œ„์—์„œ ๋“ค์–ด์˜ค๋Š” ๋ชจ๋“  ์š”์ฒญ์„ ํ—ˆ์šฉํ•ด์•ผ ํ•œ๋‹ค.
    • ์ด ์ฃผ์†Œ ๋ฒ”์œ„๋Š” ์œ„ ์‚ฌ์ง„์˜ ์˜ค๋ฅธ์ชฝ ์•„๋ž˜ ๋งํฌ์—์„œ ํ™•์ธ ๊ฐ€๋Šฅ

Route53 - Calculated Health Checks

๊ณ„์‚ฐ๋œ ์ƒํƒœํ™•์ธ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.

image-20220706022241591

  • ์—ฌ๋Ÿฌ ๊ฐœ์˜ Health Check result๋ฅผ ํ•˜๋‚˜๋กœ ํ•ฉ์ณ์ฃผ๋Š” ๊ธฐ๋Šฅ
    • Route53์— EC2๊ฐ€ 3๊ฐœ ์žˆ๊ณ , health check ๋ฅผ 3๊ฐœ ์ƒ์„ฑ ๊ฐ€๋Šฅํ•˜๋‹ค.
    • ์ด๋“ค์€ EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ํ•˜๋‚˜์”ฉ ํ™•์ธํ•ด ์ฃผ๋Š” ํ•˜์œ„ ์ƒํƒœํ™•์ธ(Child) ์ด ๋  ๊ฒƒ
    • ์ด ํ•˜์œ„ ์ƒํƒœํ™•์ธ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ƒ์œ„(parent) ์ƒํƒœํ™•์ธ์„ ์ •์˜ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • ์ด Health Check๋ฅผ ๋ชจ๋‘ ํ•ฉ์น˜๊ธฐ ์œ„ํ•œ ์กฐ๊ฑด์€ OR์™€ AND ๋˜๋Š” NOT ์ด๋‹ค.
  • ํ•˜์œ„ ์ƒํƒœํ™•์ธ์„ 256๊ฐœ๊นŒ์ง€ ๋ชจ๋‹ˆํ„ฐ๋ง ๊ฐ€๋Šฅ
  • ์ƒ์œ„ ์ƒํƒœ ํ™•์ธ์ด ํ†ต๊ณผํ•˜๊ธฐ ์œ„ํ•ด ๋ช‡ ๊ฐœ์˜ ์ƒํƒœ ํ™•์ธ์„ ํ†ต๊ณผํ•ด์•ผ ํ•˜๋Š”์ง€๋„ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • ์‚ฌ์šฉ์‚ฌ๋ก€
    • ์ƒํƒœ ํ™•์ธ์ด ์‹คํŒจํ•˜๋Š” ์ผ ์—†์ด ์ƒ์œ„ ์ƒํƒœ ํ™•์ธ์ด ์›น์‚ฌ์ดํŠธ๋ฅผ ๊ด€๋ฆฌ ์œ ์ง€ํ•˜๋„๋ก ํ•˜๋Š” ๊ฒฝ์šฐ

Health Checks - Private Hosted Zones

๊ฐœ์ธ ๋ฆฌ์†Œ์Šค์˜ ์ƒํƒœ ํ™•์ธ์€ ์–ด๋–ป๊ฒŒ ํ•˜๋Š” ์ง€ ์•Œ์•„๋ณด์ž.

image-20220706022731937

  • private resource ์„ ๋ชจ๋‹ˆํ„ฐ๋ง ํ•˜๋Š”๊ฒƒ์€ ์–ด๋ ค์šธ ์ˆ˜์žˆ๋‹ค.
  • Route53 ์˜ Health Check๊ฐ€ ๊ณต์šฉ ์›น์— ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด๋“ค์€ VPC ๋ฐ–์— ์กด์žฌํ•˜๊ฒŒ ๋œ๋‹ค.
  • ๊ทธ๋“ค์€ private endpoint์— ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค.
  • CloudWatch ์ง€ํ‘œ๋ฅผ ๋งŒ๋“ค์–ด cloudWatch ์•Œ๋žŒ์„ ํ• ๋‹นํ•˜๋Š” ์‹์œผ๋กœ ์ด ๋ฌธ์ œ ํ•ด๊ฒฐ ๊ฐ€๋Šฅ
    • cloudWatch ๊ฒฝ๋ณด๋ฅผ ์ƒํƒœ ํ™•์ธ์— ํ• ๋‹นํ•  ์ˆ˜ ์žˆ๋‹ค.
    • cloudWatch Metrix(์ง€ํ‘œ)๋ฅผ ์ด์šฉํ•ด ๊ฐœ์ธ subnet ์•ˆ์— ์žˆ๋Š” EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋ง
    • Metrix(์ง€ํ‘œ)๊ฐ€ ์นจํ•ด๋˜๋Š” ๊ฒฝ์šฐ CloudWatch ์•Œ๋žŒ์„ ์ƒ์„ฑํ•˜๊ฒŒ ๋œ๋‹ค.
    • ์•Œ๋žŒ์ด ๋ชจ๋‘ ALARM ์ƒํƒœ๊ฐ€ ๋˜๋ฉด health check๋Š” ์ž๋™์œผ๋กœ ๋น„์ •์ƒ์ด ๋œ๋‹ค.
    • ์ด๋ ‡๊ฒŒํ•˜๋ฉด, private resource์— ๋Œ€ํ•œ health check๋ฅผ ๋งŒ๋“  ๊ฒƒ์ด๋‚˜ ๋‹ค๋ฆ„์—†๋‹ค.
    • ๊ฐ€์žฅ ํ”ํžˆ ์‚ฌ์šฉ๋˜๋Š” ์‚ฌ๋ก€์ด๋‹ค.

์‹ค์Šต

image-20220706023802216

image-20220706023835594

  • ์‹คํŒจ ์ž„๊ณ„๊ฐ’
    • ์žฅ์• ๋กœ ๊ฐ„์ฃผ๋˜๊ธฐ ์ „์— ๋ช‡ ๋ฒˆ์˜ ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•ด์•ผ ํ•˜๋Š”์ง€ ์„ค์ •
  • ๋ฌธ์ž์—ด ๋งค์นญ (String matching)
    • ์‘๋‹ต์˜ ์•ž 5,120๋ฐ”์ดํŠธ ๋ถ€๋ถ„์„ ๋จผ์ € ๊ฒ€์ƒ‰ํ•˜๋Š”์ง€ ์•ˆํ•˜๋Š”์ง€ ์—ฌ๋ถ€ ์ฒดํฌ

ํƒœ๊ทธ: , ,

์นดํ…Œ๊ณ ๋ฆฌ:

์—…๋ฐ์ดํŠธ:

๋Œ“๊ธ€๋‚จ๊ธฐ๊ธฐ