ããã«ã¡ã¯ã8æããã¸ã§ã¤ã³ãã¦ããæè¡2課ã®ç´ æã§ããç¾å¨ãæ±äº¬ãªãã£ã¹ã§æ¥ã AWSã®å¦ç¿ä¸ã§ãã
ãã¦ã以åããã¡ãã®è¨äºã§CLUSTERPROã§EC2ã¤ã³ã¹ã¿ã³ã¹ã2å°ç«ã¦ã¦HAã¯ã©ã¹ã¿ãæ§ç¯ããæé ãç´¹ä»ãã¾ããã
CLUSTERPROã§ã¯AWSä¸ã§æ§ç¯ãããã¯ã©ã¹ã¿ã¨ãã¦ããElastic IPï¼ä»¥ä¸ãEIPï¼ã«ããHAã¯ã©ã¹ã¿ãã¨ãVirtula IPå¶å¾¡ã«ããHAã¯ã©ã¹ã¿ãã®2種é¡ã®HAã¯ã©ã¹ã¿ãæ³å®ããã¦ãããããããæ§ç¯ããããã®ã°ã«ã¼ããªã½ã¼ã¹ï¼ãã§ã¤ã«ãªã¼ãã¼ã°ã«ã¼ãã§å ±æããããªã½ã¼ã¹ï¼ããããããå®ç¾©ããã¦ãã¾ãã
ä»åã¯ãEIPãã°ã«ã¼ããªã½ã¼ã¹ã«ãããHAã¯ã©ã¹ã¿ãæ§ç¯ããæé ãç´¹ä»ãã¾ããããã«ãããã¯ã©ã¹ã¿ããã§ã¤ã«ãªã¼ãã¼ããéã«ããã¯ã©ã¤ã¢ã³ãã¯åä¸ã®EIPã§ãµã¼ãã«ã¢ã¯ã»ã¹ã§ãã¾ãã
ã¤ã¡ã¼ã¸
æ§ç¯ããç°å¢ã®ã¤ã¡ã¼ã¸ã以ä¸ã«ç¤ºãã¾ãã
ç°å¢è¦ä»¶
ã»ãã¡ãã®è¨äºåæ§ã®HAã¯ã©ã¹ã¿ãçµã¾ãã¦ãããã¨ï¼CLUSTERPROã®Versionã¯3.3ãæ³å®ï¼
ã»EC2ã¤ã³ã¹ã¿ã³ã¹ã«ä»¥ä¸ã®ã½ããã¦ã§ã¢ãã¤ã³ã¹ãã¼ã«ããã¦ãããã¨
ã½ããã¦ã§ã¢ | Version | åè |
AWS CLI | 1.6.0~ | |
Python | 2.7.5~ | 3.*ç³»ã¯ä¸å¯ |
æé
æé ã¨ãã¦ã¯ä»¥ä¸ã®ã¨ããã§ãã
- Elastic Network Interfaceï¼ä»¥ä¸ãENIï¼ãEIPã®è¿½å
- ã°ã«ã¼ããªã½ã¼ã¹ã®è¿½å
- åä½ç¢ºèª
ããã§ã¯å§ãã¦ããã¾ãã
1.ENIãEIPã®è¿½å
åã¤ã³ã¹ã¿ã³ã¹ã«ENIã追å ãã¾ãããã®ENIã«ãã§ã¤ã«ãªã¼ãã¼æã®EIPãé¢é£ä»ãããããã¨ã«ãªãã¾ãã
ããã©ã«ãã®ENIãç¨ãã¦åä½ããããã¨ãå¯è½ã§ãããä»åã¯ããã©ã«ãã®ENIã¯ãªã¢ã¼ãããã®ã¡ã³ããã³ã¹ç¨ã«ç¨ãããã¨ã«ãã¦ãæ°ãã«ENIã追å ãã¾ãã
ã¾ããæ°ãã«EIPã®å²ãå½ã¦ãè¡ããEIPã確ä¿ãã¾ãããã®EIPãã¯ã©ã¹ã¿ã®ã°ã«ã¼ããªã½ã¼ã¹ã¨ãã¦ç¨ãã¾ãï¼ENIã¸ã®é¢é£ä»ãã¯ã²ã¨ã¾ãä¸è¦ã§ãï¼ã
ä¸è¨ã§è¿½å ããENIãEIPã®IDãã¡ã¢ãã¦ããã¾ãã
2.ã°ã«ã¼ããªã½ã¼ã¹ã®è¿½å
以ä¸ã®æé ã«ãããCLUSTERPROã®Webããã¼ã¸ã£ä¸ããEIPã®ã°ã«ã¼ããªã½ã¼ã¹ã追å ãã¾ãã
Webããã¼ã¸ã£ããæä½ã¢ã¼ããã«ããä¸ã§ããã§ã¤ã«ãªã¼ãã¼ã°ã«ã¼ããå³ã¯ãªãã¯ããããªã½ã¼ã¹ã®è¿½å ããæ¼ä¸ãã¾ãã
ã°ã«ã¼ããªã½ã¼ã¹å®ç¾©ã®ã¿ã¤ããããAWS Elastic IPãªã½ã¼ã¹ããé¸æããã次ã¸ããæ¼ä¸ãã¾ãã
ã¾ãã次ã«åºã¦ãããä¾åé¢ä¿ããã復æ§åä½ãã®ç»é¢ã«é¢ãã¦ãããã®ã¾ã¾ã次ã¸ããæ¼ä¸ãã¾ãã
詳細è¨å®ç»é¢ã§ããEIP ALLOCATION IDãããENI IDããè¨è¿°ããç»é¢ã«ãªãã®ã§ãå ã»ã©ã¡ã¢ãã¦ãããENIã¨EIDã®IDãè¨è¼ãã¾ãã
ãµã¼ãå ±éã®è¨å®ç»é¢ã§ã¯ãä»»æã®ãµã¼ãã®ENI IDãè¨è¼ãã¾ãã
以ä¸ã®æé ãè¡ãã¨ããªã½ã¼ã¹ä¸è¦§ã«ãAWS Elastic IPãªã½ã¼ã¹ããã¿ã¤ãã«æã£ããªã½ã¼ã¹ã追å ããã¾ãã
æå¾ã«è¨å®ã®åæ ãè¡ãã¾ããå³ã®èµ¤æ ã®ãã¿ã³ãæ¼ä¸ããè¨å®ãåæ ãã¦ãã ãããæ£å¸¸ã«åæ ãããã¨å³ã®ããã«ãåæ ãããæ¨ã®ã¡ãã»ã¼ã¸ã表示ããã¾ãã
3.åä½ç¢ºèª
以ä¸ã§è¨å®ã¯å®äºã§ããWebããã¼ã¸ã£ããæä½ã¢ã¼ããã«ããä¸ã§ã¯ã©ã¹ã¿ãèµ·åããã¨ããã§ã¤ã«ãªã¼ãã¼ã°ã«ã¼ãã®ä¸ã«Elastic IPã®ãªã½ã¼ã¹ãåä½ãã¦ãããã¨ã確èªã§ãã¾ãã
試ãã«æåã§ãã§ã¤ã«ãªã¼ãã¼ãå®æ½ããEIPãåãæ¿ããã確èªãã¦ã¿ã¾ãããã
ãæä½ã¢ã¼ããã®ã¾ã¾ãã§ã¤ã«ãªã¼ãã¼ã°ã«ã¼ããå³ã¯ãªãã¯ããã移åããæ¼ä¸ãã¾ãã
å ã»ã©ãã¹ã¿ã³ãã¤å´ã ã£ããµã¼ããã¢ã¯ãã£ãã«ãªããEIPãä»ãå¤ãã£ã¦ããã®ã確èªã§ããã¨æãã¾ãã
ã¾ã¨ã
ä»åã®è¨äºã§ã¯EIPãã°ã«ã¼ããªã½ã¼ã¹ã«ããHAã¯ã©ã¹ã¿ãæ§ç¯ãã¦ã¿ã¾ããã
ä»åç´¹ä»ããæ©è½ã«ãããCLUSTERPROä¸ã®æä½ã ãã§EIPã®ä»ãæ¿ãçå®æ½ã§ãã¾ãã
次åï¼ããã¯ãï¼ï¼ï¼ã¯ãããå°ãæ¤è¨¼ãéãã¦ãç´°ããæ©è½ããã¥ã¼ãã³ã°ã«ã¤ãã¦ãè¨åã§ããã°ã¨æãã¾ãã