ã諸è¬ã®çç±ã«ãããAWSã®åãµã¼ãã¹ã®æåãæ¹ãã¦å¾©ç¿ä¸ã§ããã¾ãã¯ãAmazon Elastic Load Balancing ãé称ELBã«ã¤ãã¦ã§ããELBã®å
é¨ã®åä½ã«ã¤ãã¦ã¯ãå
¬éããã¦ããå
¬å¼ããã¥ã¡ã³ããå²ã¨ããã¾ããæ¯éä¸åº¦ãã£ããã¨ç®ãéãã¦ããã¨ããã§ãããå°ãªãã¨ãAWSマイスターシリーズのELBã«ã¤ãã¦ã¯ãèªãã§ããã¹ãã§ããç°¡æ½ã«ãã¤è©³ãã説æããã¦ããã®ã§ãç解ãæ ¼æ®µã«é²ãã§ããããã¨ããã¨ããã§ãç¾æ®µéã§ç§ãç解ãã¦ããELBã®ã¢ã¼ããã¯ãã£ãã¾ã¨ãã¦ã¿ã¾ããã
ELBã®å é¨æ§é
ãELBã¯ãELBã¨ã³ããã¤ã³ãã¨ELBã¤ã³ã¹ã¿ã³ã¹ï¼ä»®ç§°ï¼ã«ãã£ã¦æ§æããã¾ããELBã¤ã³ã¹ã¿ã³ã¹ï¼ä»®ç§°ï¼ã®æ£å¼å称ã¯ç¥ããªãã®ã§ããã®ååã§å¼ã¶ãã¨ã«ãã¾ããELBã¤ã³ã¹ã¿ã³ã¹ã«ã¯ãã°ãã¼ãã«IPãä»ä¸ããã¾ããELBã¨ã³ããã¤ã³ãã¯ãmyLB-xxx.elb.amazonaws.comã®ãããªDNSåãæã¡ã¾ãããã®ELBã®DNSåãåå解決ããã¨ãELBã¤ã³ã¹ã¿ã³ã¹ã®ã°ãã¼ãã«IPãè¿ããã¾ããELBã¤ã³ã¹ã¿ã³ã¹ãè¤æ°ããå ´åã¯ãè¤æ°ã®IPãè¿ãã¾ããELBã¤ã³ã¹ã¿ã³ã¹ã¯ãå©ç¨ããAZã«å°ãªãã¨ã1ã¤åå¨ãã¾ããMultiAZæ§æã®å ´åã§ããã°ãå°ãªãã¨ã2ã¤ã®IPãè¿ããã¾ãã
ãã¯ã©ã¤ã¢ã³ãããã¢ã¯ã»ã¹ããã£ãå ´åã¯ãDNSã®ã©ã¦ã³ãããã³ã§ELBã¤ã³ã¹ã¿ã³ã¹ã®IPã¢ãã¬ã¹ãè¿ããã¾ããELBã¤ã³ã¹ã¿ã³ã¹ã¯ãé ä¸ã®ã¤ã³ã¹ã¿ã³ã¹ã«æ¯ãåãããã¾ããæããELBã¤ã³ã¹ã¿ã³ã¹å ã«ãªãã¼ã¹ãããã·ã®ãããªæ©è½ãããã®ã§ãããã
ãnslookupã¨digãããã¨ã次ã®ããã«ãªãã¾ãã
$ nslookup ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com Server: 192.168.11.1 Address: 192.168.11.1#53 Non-authoritative answer: Name: ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com Address: 54.250.186.157 Name: ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com Address: 54.199.196.182
$ dig ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com ; <<>> DiG 9.8.5-P1 <<>> ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1343 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 4 ;; QUESTION SECTION: ;ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com. IN A ;; ANSWER SECTION: ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com. 48 IN A 54.199.196.182 ELB-Test-869539816.ap-northeast-1.elb.amazonaws.com. 48 IN A 54.250.186.157 ;; AUTHORITY SECTION: ap-northeast-1.elb.amazonaws.com. 166 IN NS ns-54.awsdns-06.com. ap-northeast-1.elb.amazonaws.com. 166 IN NS ns-1683.awsdns-18.co.uk. ap-northeast-1.elb.amazonaws.com. 166 IN NS ns-982.awsdns-58.net. ap-northeast-1.elb.amazonaws.com. 166 IN NS ns-1325.awsdns-37.org. ;; ADDITIONAL SECTION: ns-54.awsdns-06.com. 166659 IN A 205.251.192.54 ns-982.awsdns-58.net. 166660 IN A 205.251.195.214 ns-1325.awsdns-37.org. 166660 IN A 205.251.197.45 ns-1683.awsdns-18.co.uk. 166660 IN A 205.251.198.147 ;; Query time: 24 msec ;; SERVER: 192.168.11.1#53(192.168.11.1) ;; WHEN: Tue Feb 11 16:45:22 JST 2014 ;; MSG SIZE rcvd: 301
ELBã®ã¹ã±ã¼ãªã³ã°
ãä¸å®ä»¥ä¸ã®è² è·ãæããELBã®å¦çè½åãä¸ããå¿ è¦ãåºãå ´åã«ãèªåçã«ELBã®ã¹ã±ã¼ã«ã¢ãããããã¯ã¹ã±ã¼ã«ã¢ã¦ããè¡ããã¾ãããã®ELBã®ã¹ã±ã¼ãªã³ã°ããDNSã®åå解決ãå©ç¨ãã¦è¡ãã¾ããã¹ã±ã¼ã«ã¢ããã®å ´åã¯ãããå¦çè½åã®é«ãELBã¤ã³ã¹ã¿ã³ã¹ãç«ã¡ããã¦IPã«åãæ¿ãã¾ããã¹ã±ã¼ã«ã¢ã¦ãã®å ´åã¯ãåçã®å¦çè½åã®ELBã¤ã³ã¹ã¿ã³ã¹ãç«ã¡ããã¦IPã¢ãã¬ã¹ã«è¿½å ãã¾ãããããã«ããIPã¢ãã¬ã¹ãå¤ããã®ã§ã注æãã ããã
ãã¡ãªã¿ã«ã¹ã±ã¼ã«ã¢ã¦ããã¹ã±ã¼ã«ã¢ããã®ã©ã¡ããé¸ã¶ã®ãã¯ãAWSãèªåçã«é¸æãã¾ãããã®ã¢ã«ã´ãªãºã ã¯å ¬éããã¦ãã¾ãããæ³åã§ããããã©ãã£ãã¯æ°ãå¤ãå ´åã¯ã¹ã±ã¼ã«ã¢ã¦ãããªã¯ã¨ã¹ã辺ãã®ãã©ãã£ãã¯éãå¤ãå ´åã¯ã¹ã±ã¼ã«ã¢ãããé¸ã¶ã®ã§ã¯ãªãã§ããããï¼å ¨ãã®æ³åãªã®ã§ããã¤ã試ãã¦ã¿ããã§ãã
é害æã®åä½
ãé害æã®åä½ããåºæ¬çã«ã¯DNSãå©ç¨ãã¾ããELBã¤ã³ã¹ã¿ã³ã¹é ä¸ã®ã¤ã³ã¹ã¿ã³ã¹ãå ¨æ» ããå ´åããã®ELBã¤ã³ã¹ã¿ã³ã¹ã®IPã¢ãã¬ã¹ã¯åé¤ããã¾ãããã®IPã¢ãã¬ã¹ãæå¾ã®ï¼ã¤ã®å ´åã¯ããã®ã¾ã¾æ®ãã¾ããELBã¤ã³ã¹ã¿ã³ã¹èªèº«ã®é害ã®éããDNSã®åãæ¿ãã§å¯¾å¦ãã¾ãã
ELBã®CloudWatchã®Metrics
ãã¤ãã§ã«ELBã®CloudWatchã®ã¡ããªã¯ã¹ãè¦ã¦ã¿ã¾ãããã
ã¡ããªã¯ã¹å | æ¦è¦ |
---|---|
HealthyHostCount | ELBé ä¸ã®æ£å¸¸ç¨¼åãã¦ããï¼healthyï¼ã¤ã³ã¹ã¿ã³ã¹æ°ã§ã |
UnHealthyHostCount | ELBé ä¸ã®ç°å¸¸ç¨¼åãã¦ããï¼unhealthyï¼ã¤ã³ã¹ã¿ã³ã¹æ°ã§ã |
RequestCount | ELBã§å¦çããããªã¯ã¨ã¹ãæ°ã§ããHTTPCode_Backend_XXXã®åè¨ã§ã |
Latency | ELBããããã¯ã¨ã³ãã¤ã³ã¹ã¿ã³ã¹ã«æ¸¡ããã¦è¿ã£ã¦ããã¾ã§ã®æéã§ã |
HTTPCode_ELB_4XX HTTPCode_ELB_5XX |
ELBèªèº«ãè¿ãã¹ãã¼ã¿ã¹ã³ã¼ãã§ã |
HTTPCode_Backend_2XX HTTPCode_Backend_3XX HTTPCode_Backend_4XX HTTPCode_Backend_5XX |
ELBé ä¸ã®ããã¯ã¨ã³ãã¤ã³ã¹ã¿ã³ã¹ã§çæãããã¬ã¹ãã³ã¹ã³ã¼ãã§ã |
SurgeQueueLength | ELBã§å¦çå¾ ã¡ã®å¾ ã¡è¡å(surge queue)ã®æ°ã§ã |
SpilloverCount | å¾ ã¡è¡å(surge queue)ãã溢ãããªã¯ã¨ã¹ãæ°ã§ã |
ããã¤ã³ãã¨ãã¦ã¯ãSurgeQueueLengthåã³SpilloverCountãã¿ã¦ããã°ãELBã§å¦çåºæ¥ãªãã£ããªã¯ã¨ã¹ãã解ãã¨ããç¹ã§ããããããã¨ã¯ãHTTPCode_ELB_5XXç³»ã®HTTP 503: Service Unavailableãªã©ãè¦ã¦ããã°ãELBã®ãã£ããªã¼ãçã®æ¤åºãåºæ¥ãå¯è½æ§ãããã¾ãã
ãAmazonãããã¤ãã§ã«ELBã®æµéãç£è¦ããã¡ããªã¯ã¹ãä½ã£ã¦ããã¾ããããï¼
ã¾ã¨ã
ãå ¬éããã¦ããè³æã®ä¸ã§ã®ELBã®åä½ãã¾ã¨ãã¦ã¿ã¾ããããããããã誤解ãã¦ããé¨åãããããããã¾ããã®ã§ããã®éã¯æ¯éãææãã ãããã¡ãªã¿ã«ãã®ELBã®åä½ã®ããã«ãDNSãåãæ¿ãã¦è¡ãã¨ããã®ã¯AWSã®åºæ¬ææ³ã ã¨æãã¾ããä»ã®ãµã¼ãã¹ãè²ã å©ç¨ãã¦ãã¾ããããã¶ããããªãã ãããªãã¨ããã¨ãããããã¾ããGoogleã®ã¯ã©ã¦ãï¼Google Cloud Platformï¼ã¯ã¾ãéã£ãããã«è¦åããããã®ã§ããã®ãã¡èª¿ã¹ã¦å¯¾æ¯ããã¦ã¿ããã¨æãã¾ãã
See Also:
AWSのEBS Provisioned IOPSからEBSについて妄想する
結構知らないAmazon EBSの細かい話。主にEBSのネットワークの構造について
åç
§ï¼
AWSマイスターシリーズ Amazon Elastic Load Balancing (ELB)
Elastic Load Balancing 開発者ガイド
Best Practices in Evaluating Elastic Load Balancing : Articles & Tutorials : Amazon Web Services
Monitor Your Load Balancer Using Amazon CloudWatch - Elastic Load Balancing