AWSã§AZé害ãèµ·ããã®ã§å°ã£ããã¨ãæ¸ãã¦ãã
åã«ãä¼¼ããããªãã¨æ¸ãããªã¨æã£ããã©ããä¸å¹´åãåã®ãã¨ã«ãªãã®ã
ãåç¥ã®éãæ¨æ¥ 2021/02/19 23:20é AWSã«ã¦æ±äº¬ãªã¼ã¸ã§ã³ã®ä¸ã¤ apne-az1
ã«ã¦å¤§è¦æ¨¡ãªé害ãçºçãå¤ãã®AWSãå©ç¨ãã¦ãããµã¼ãã¹ã§å½±é¿ããã£ãã
ãããªç§ã¯ãã¤ãã®ããã« ã¢ã©ã¹ããªãªã£ ã¢ãµã«ããªãªã£ ã©ã¹ããã¬ãã ã¨ããã²ã¼ã ãåæ°ã«ãã¬ã¤ãã¦ããã®ã ãã©ã23:25 ããç·æ¥ã¡ã³ãã«å
¥ã£ã¦ãã¾ã£ãã
ã©ããããã ããã¨æã£ã¦ãããã社å Slackã«ã¦AWSãå©ç¨ãã¦ãããµã¼ãã¹ããã¾ã«å¿çããªããªããElasticacheãåãæ¿ãã£ããªã©ãªã©ã®å ±åãå ¥ãããããããã¨é¢åãã¨ããªã¨æããªãã対å¿ãããã¨ã«ãªã£ãã
èµ·ãã¦ãããã¨
æ¢ã«AWSãããå
¬éããã¦ãããã¨ã§ããããä»åã¯2019å¹´8æã«èµ·ããé害ã¨é¡ä¼¼ããã¿ã¤ãã®é害ã ã£ãã
æ±äº¬ã®AZã®ä¸ã¤ãapne-az1
ã«ã¦ãµã¼ãå·å´è£
ç½®ã®é»åä¾çµ¦ã«ãã©ãã«ããããEC2ã®æ©è½ã縮éããã¨ãããã®ã§ãå½±é¿ãåããã®ã¯EC2ã¨EC2ã«ä¹ã£ã¦ããå¤ãã®ãµã¼ãã¹ã§ãã£ãã
ååãããã°ã«ã¦AZé害ãèµ·ããå ´åã®ãã¨ã«ã¤ãã¦åæ°ã«æ¸ãã¦ããããä»åã®å¯¾å¿ã§ã¯ãã®ã¿ã¤ãã®AZé害ã§ã¯å°ã£ããã¨ãèµ·ãããã¨ãããã£ãã
ä¸çªå°ã£ãã®ã¯ãEC2ã縮éãã¦ããã®ã«ãã¢ã©ã¼ããä¸ãã£ã¦ããªããã¨ã ã£ãã AWSã§æ§ç¯ãã¦ãããµã¼ãã¹ã¯EC2ãEC2ã使ã£ã¦çµã¾ãããµã¼ãã¹ã«ä¹ã£ã¦ãããã®ãå¤ããä¾ãã°æè¿ã ã¨ECSãFargateã§åããã¦ãALBã使ã£ã¦ãµã¼ãã¹æä¾ãããã¿ãããªæ§æãã¨ã£ã¦ããã
Fargateã¯èªåçã«ãµã¼ãã¹ãèµ·åããä»çµã¿ãæã£ã¦ããããALBãããã¼ã¸ããªãã¼ããã©ã³ãµã¼ã§ãããªã«åãã¦ãããã¨æã£ã¦ããããä»åã®ãã©ãã«ã§ã¯AWSå´ã®ä»çµã¿ã§ã¯ãã¾ãåãé¢ããã§ãã¦ããªãã£ãããã«æãããè¦ã¯AZã¯æ»ãã§ããã«ãé¢ãããããµã¼ãã¹ã¨ãã¦ã¯ã¾ã ãçãã¦ãããå¤å®ãããã¦ãããåãé¢ãããã¾ããã£ã¦ããªããããªåä½ããã¦ããã
ããã¯å¤§å¤å°ã£ããæ®æ®µå©ç¨ãã¦ããCloudwatchãªã©ã§ã¯æ»ãã ãµã¼ãããµã¼ãã¹ãå¤å¥ãã§ãããALBã«ã¤ãã¦ã¯èªåãã¡ã®ç®¡çä¸ã§ã¯ãªãã®ã§ãæ»ãã ALBã«å½ãããã¨ãé¿ããã®ã¯å®¹æã§ã¯ãªãã£ãã
ä»æ¹ããªãã®ã§ã apne-az1
ã«å±ãã¦ãããã¹ã¦ã®EC2ãã¼ã¹ã§åãã¦ãããã¨æããããµã¼ãã¹ã使ããªãããã«ãã¦ãããããªãã£ãã
ãããããã¯å
¨ããã£ã¦ç°¡åã§ã¯ãªãã£ããã¨ããã®ã¯AZé害ã®å ´åã¯å½ç¶ç¶ºéºã«èªååãé¢ããè¡ãããåæã§è¨è¨ããã¦ããã®ã§ãä»åã¿ããã«èªåçã«åãé¢ããã§ããªããã¨ãæ³å®ãã¦ããªãã£ãã
ããã¯TerraformãCloudFormationã使ã£ã¦ããã¨ãã¦ã容æã§ã¯ãªãã¨æããåãé¢ãæ¹ããµã¼ãã¹ã«ãã£ã¦ããªãéãã®ã§å¤ãã®ãªã½ã¼ã¹ã使ã£ã¦ããã»ã©ããæ¿ããé£ããã£ãã¯ãã ALBãªã©ã¯Subnetãæå®ããè¨å®ãããããFargate 㯠placement constraints ãè¨å®ããå¿ è¦ããã£ããã¾ããENIãªã©ãZoneã«ä¾åãã¦ãããRDSã¯Masterææ ¼ãããï¼ããã¯å¤§å¤ã ã ãã¡ããä¸æ°ã«ãã¹ã¦ã®ãªã½ã¼ã¹ããã¿ãã¿åãæ¿ãã£ããããã¯ããã§å°ã£ããããããªãããæ»ãã§ããã®ãçãã¦ãã®ãå¤å¥ãã¤ããªãã¨ããã®ã¯ç¸å½åã£ããä¸éå端ã«çãã¦ãããµã¼ãã¹ã綺éºã«åãæ¿ããã¯ç¸å½é£ããã
ä»åã®åç
ãµã¼ãã¹ã¯ç¶ºéºã«æ»ã¬ã¨ã¯éããªããã¨ãè¦è½ã¨ãã¦ãããã¨
AWSã§æ§ç¯ããã¨ãã«ã¯Multi-AZæ§æãåã£ã¦ããããèªåã§åãæ¿ããä»çµã¿ãè¨å®ãã¦ããããèªåã§åãæ¿ãããªãå ´åã«ã©ãåãé¢ããã¾ã§èæ ®ãã¦ããªãã£ãã Terraformã§æ§ç¯ã¯èªååãã¦ããããAZã®ä¸ã¤ã ããåãé¢ãã«ã¯ã©ãããã°ãããã俯ç°ãã¦è¦ã¦ããããã§ããªããå®éã®åãé¢ãä½æ¥ã«ã¯ããªãæéåã£ã¦ãã¾ã£ãã ã¨ãããããAZã®ä¸ã¤ãæ»ãã å ´åã«Terraformãªã©ã§éé¢ã§ããããã«æ¸ãã¦ããã¨ããã®ã¯ããªãé£ããæ°ããã¦ããã ããã¯ã¾ã èãã¦ããªãããå¤åä»æ´æ¸ãç´ãã®ã¯é£ããæ°ããã¦ãããæåããåãé¢ããããã«æ¸ãã¦ãããªãã¨é£ãããããããªã¨ããã¾ã§èãã¦ã¯ãªãã£ãã¨ããã®ãæ£ç´ãªã¨ããã ã
ãã¤ã¯ããµã¼ãã¹åãé²ããéç¨ã§ã¢ã«ã¦ã³ããåå²ãããã¨ã§å¯¾å¿ãç ©éã«ãªã£ã
ããã¯ããã¯ããã ããã¨ãã話ã ãã権éãã³ã¹ãåå²ã®è¦³ç¹ããã¢ã«ã¦ã³ãåå²ããã¦ãããã¨ã§ãåå²ããã¢ã«ã¦ã³ãã®æ°ã ãåããã¨ãããç¾½ç®ã«ãªã£ã¦ãã¾ã£ãã ã¢ã«ã¦ã³ãåä½ã§éããªããåºç¯å²ã®ãã©ãã«ã«å¯¾ãã¦ã¯è¤æ°ã¢ã«ã¦ã³ãã«åãããã¨ã§å¯¾å¿ç®æãã°ããã¦ãã¾ããè¨å®åæ ã«æéåããã¨ã«ãªã£ãã å®éãã®ãããªã±ã¼ã¹ãæ³å®ãã¦ãã¹ã¦ã®ã¢ã«ã¦ã³ãã«å¯¾ãã¦AZãåãæ¿ããããããã«è¨å®ãæ¸ãã®ã¯ããªãå°é£ã¨æãããããæ¯å¹´èµ·ãããããªåé¡ã§ããã°å¯¾å¿ããªããã°ãªããªãã
çµããã«
ååæ¸ããè¨äºã§ããã¨ãåé¡ãããããã·ã³ã®åãé¢ãã®ä»çµã¿ããã¾ãåããªããã±ã¼ã¹ã«è©²å½ãã¦å¤§å¤ãªç®ã«ãã£ãã ããä¸å¹´åã«ä¸åãããã®ç¢ºçã§èµ·ããåé¡ã ã¨ã対å¦ã§ããããã«ãã¦ãããªãã¨ãããªãããä»åã®ä»¶ãè¸ã¾ãã¦èªååãé¢ãã¨ã¯å¥ã®è¦³ç¹ã§æåã§AZåãé¢ããã§ããããã«ä»çµã¿åãã¦ããå¿ è¦ããããããããªãã
ä»åAZé害ã ããMultiAZã ããå½±é¿ããªãã£ã¦ããã®ã¯ééãã§ãä¸éå端ã«æ»ãã çµæåãé¢ãããã¾ãè¡ãããMultiAZæ§æãåã£ã¦ãã¦ãå½±é¿ãåºã¦ãã¾ãã¨ãããã©ãã«ã ã£ãã¨ãããã¨ã ãæ¸ãã¦ããããã
æ»ã¬ã¨ãã¯ç¶ºéºã«æ»ãã§ãããªãã£ã¦ã®ã¯ç©çæ代ãã¹ã¤ãããNICã§ãããã£ãããããããã®ãä¸çªå°ããããããã
ãã¾ã
ããªã³ã»ã¹ã»ããªã³ã·ãã« Crown Handler è¶ è¯ä½ã ãã観ã¦ã