ããããŒã°
ãšã«ãã®ããŒã ã§ããç§ãã¡ã®è£œåã®éæ³çã§ç¥ç§çãªè©³çŽ°ã®è©³çŽ°ãäžçãšå ±æããããšããæ¥ãŸããã ç¹å¥ãªèªããšç°¡åãªç€Œæã®å¯Ÿè±¡ã§ããæãè€éãªãããžã§ã¯ãã®1ã€ããå§ããããšã«ããŸããã ã¡ãã£ãšããè¬ã«èŠãããæé»ã®éæ³ã®å 茪ã«å ãŸããŠããŸãã 圌ã«é¢ããäŒèª¬ã¯å£ããå£ãžãšåãç¶ãããŠããŸãã ç¥èã®ããäžéšã®ã¿ãwikiãŸãã¯yutrekã«ææžåãããŠããã倧éšåã¯ããŒãžã§ã³ç®¡çã·ã¹ãã ã®ãœãŒã¹ã³ãŒãã«é ãããŠããŸãã ãã®ç§å¯ã®ã³ãŒãããããžã§ã¯ãã§ãŸããŸã解èªã§ããè³¢æãªé·èãã¡ã 詳现ãªåçš¿ã«ãã¹ãŠã®éæ³ã®åªæãæžãçããæãæ¥ãŸããã ããã¯Elbeã®å±éã·ã¹ãã ãã€ãŸã匷åãªDeployã«ã€ããŠã§ãã
Elbaã¯èµ·æ¥å®¶åãã®WebãµãŒãã¹ã§ãããããžãã¹ã®éå¶ãæ¯æŽããŸãã ãããŠã匷åãªãããã€ã®ä»äºã¯ãšã«ããæŽæ°ããããšã§ãã ãµãŒãã¹ã®æ°ããããŒãžã§ã³ã®æºåãã§ãããã Deployã¯ãããäžçã«å ¬éããå¿ èŠããããŸãã ãŠãŒã¶ãŒã«ã ã€ãŸããã·ã¹ãã ã®ãã¹ãŠã®éšåãæŽæ°ããŠèµ·åãããã¹ãŠã®ããŒã¿ãå€æããŠæºåããå¿ èŠããããŸãã ç§ãã¡ã®Deployã¯ãã®ä»äºãããŸããã£ãŠããŸã-Elbaã®æŽæ°ã¯ããŠãŒã¶ãŒã®äœæ¥ãäžæããããšãªãããŠãŒã¶ãŒã«ã¯ãŸã£ããèŠããŸããã ããã«ãããå¿ èŠã«å¿ããŠ-æºåãã§ããŠããã°ãæ°ãããªãªãŒã¹ãã¢ããããŒãã§ããŸãã ãããã©ã®ããã«éæããããWebãµãŒãã¹ããŠãŒã¶ãŒã«å¯ŸããŠãã³ã¹ãããã§ééçã«æŽæ°ãããæ¹æ³ã«ã€ããŠã¯ãåŸã§èª¬æããŸãã
第1ç« èµ·æº
å€ä»£ããšã«ãã¯ASP.Net Web Formsäžã®å°ããªWebã¢ããªã±ãŒã·ã§ã³ãšMS SQL Serveräžã®ããŒã¿ããŒã¹ã§æ§æãããŠããŸããã ãã®ã¢ããªã±ãŒã·ã§ã³ã«ãããèµ·æ¥å®¶ã¯å°ããªãŠã£ã¶ãŒãã®å©ããåããŠãçšå眲ã«ç°¡çŽ åãããçšå¶ç³åãæºåãæåºããããšãã§ããŸããã ãã以æ¥ãå€ãã®æ代ãå€ãããŸãã-çŸåšããšã«ãã¯ããªãã«ãã£ãšå€ãã®ããšãããããšãã§ããŸãã 圌女ãäœãã§ãããããããŠåœŒå¥³ãã©ã®ããã«èµ·æ¥å®¶ãå©ããããç§ãã¡ã®ããŒã±ãã£ã³ã°ãšããã¢ãŒã·ã§ã³ãµã€ãã®é åçãªèªæžã¯æããŠãããŸãã
æè¡é¢ã«ãã£ãšèå³ããããŸãã ãšã«ããå°ããã£ããšããé éããã»ã¹ã¯åçŽã§çŽ æŽã§ããã ã¢ããªã±ãŒã·ã§ã³ã¯ããã©ã³ãµãŒã®åŸãã«é ããã2ã€ã®ãã¹ãäžã®ããŒã¿ã»ã³ã¿ãŒã«ãããŸããã äž¡æ¹ã®ã¢ããªã±ãŒã·ã§ã³ãæŽæ°ããããã«ãããã°ã©ããŒã¯RDPã®æã§æ¬çªãµãŒããŒã«è¡ããããªã³ã³ãã€ã«ãããã³ãŒããäž¡æ¹ã®ãã¹ãã®ãã©ã«ããŒã«ã³ããŒããŸããã åªããIISã¯ããã«å€æŽãååŸããã·ã¹ãã ãåèµ·åããŸããã ããŒã¿ããŒã¹ã®ããŒã¿ãæŽæ°ããã«ã¯ãSQLãµãŒããŒã§ã¹ã¯ãªãããæåã§å®è¡ããå¿ èŠããããŸããã
æéãçµã€ã«ã€ããŠãã³ãŒãããŒã¹ã¯æé·ãã匷床ãç²åŸããŸããã å€ãã®åç·ãçŸãããµãŒãã¹ã¯ããããã®ãã¹ãã«å¥ã ã«äœãã§ããŠãããããã人ã«åã£ãŠä»£ããããã€ãäžçãåŒãç¶ããããšæã£ãŠããŸããããµãŒãããŒãã£ã®è£œåããµãŒãã¹ãšã®çµ±åãè¿œå ãããå€ãã®ç°ãªãèå³æ·±ãããšããããŸããã ãŸãããªãªãŒã¹çšã«ããããã¡ã€ã«ã®ããã¯ãäœæããããããã³ããŒããéã®æäœæ¥ãç°¡ç¥åãããŸããã Batnikovã¯ããã¹ãŠã®ãã¹ãã§æ°ãããã£ã¹ããªãã¥ãŒã·ã§ã³ãã¬ã€ã¢ãŠãããŠå®è¡ããŸããã ããããããã«ã³ãŒããéåžžã«å€ããªãããã¹ãŠã®ãã¹ãã«ã³ããŒããæéãå¢å ããŸããã Batnikovã®ç®¡çã¯é£ãããªããŸããããµãŒãã¹ãšããããžãŒã®ææ°ãªã¹ããç¶æããŠãã ããã ããã«ããŠãŒã¶ãŒæ°ã®å¢å ã«äŒŽããæ°ãããªãªãŒã¹ã®åã«æŽæ°ããå¿ èŠãããããŒã¿ã®éãå¢å ããŸããã èªååã®æãæ¥ãŸããã
ãããã®å€ä»£ã¯éåžžã«éé ·ã§ããã å®æããããŒã«ã誰ãç¥ãããã°ãŒã°ã«ã®äœ¿ãæ¹ãç¥ãããä»äººã®ããŒã«ã䜿çšããŸããã§ããã ããã°ã©ããŒã¯ã³ãŒããæžãã®ã倧奜ãã§ãã ç§ãã¡ã¯èªåã§æžãããšã«ããŸããã ãããŠåœŒãã¯æžããã
Deployã®æåã®ããŒãžã§ã³ã¯aã®ããã«æ¯ãèããŸããã ç·æ§ã¯ã³ã³ãœãŒã«ãç«ã¡äžããæåã«è£œåå šäœããªãªãŒã¹åœ¢åŒã§åéããŸããã ããã«ã¯ããµãŒãã¹/ãããã/ããã³ãã®ã³ãŒããšçµ±èšã®ã³ã³ãã€ã«ãããã³ãããã€èªäœãå«ãŸããŸãã 次ã«ããµã€ãã®ããããžãã¢ãã¬ã¹ãå€èŠ³ããã¹ã¯ãŒãããã©ã°ããã°ã«ã¹ã€ãããããžãã¯å®æ°ãªã©ãããããã¹ãŠã®è£œåèšå®ãæºåããŸããã æºåããããã£ã¹ããªãã¥ãŒã·ã§ã³ã¯ãç¹å¥ã«èšç·Žããããªã¢ãŒããµãŒãã¹ã®ããŒã¿ã»ã³ã¿ãŒã«è»¢éãããŸããããªã¢ãŒããµãŒãã¹ã¯ã転éã®çµäºåŸã«åãããžãã¯ãããã€ãèµ·åããæ¹æ³ã®ã¿ãç¥ã£ãŠããŸããã
åé¢ã®æåã®ãã®ã¯ãå€ã®äžçã®ãæè¡äœæ¥äžãã®ã¹ã¿ãã«èŠããŸããã 圌女ã®ã«ããŒã®äžã§ã ãããã€ã¯åœŒãå°éã§ãããã¹ãŠã®ãã®ã殺ããŠããŸããã ãµã€ãå šäœãæ¶æ» ãããŸããã ããããããµãŒãã¹ãæŠç·ããã¹ãŠã®äœæ¥ããã»ã¹ã殺ãã芪ãåãspaãã¿ãçŠåãæ®ããŸããã ãšã«ãã¯æ©èœããªããªããŸããã ãããŠããããã®å» onã®äžã§ã Deployã¯æ°ãããããè¯ãäžçãæ§ç¯ãå§ããŸããã æå®ãããããããžã«åŸã£ãŠååžããã£ãããšåæ£ãããèšå®ãå€æŽããã¹ã¯ãªãããå®è¡ããŠããŒã¿ããŒã¹å ã®ããŒã¿ãæŽæ°ããŸãã ãããã圌ã¯ãã£ãããšèŸ²å Žå šäœãå§ããŸããã æãåãã®é ããµãŒãã¹ã®éå§åŸãã¹ã¿ãã¯åé€ãããããããããªãŠãŒã¶ãŒãæçµçã«æŽæ°ãããã·ã¹ãã ã«ã¢ã¯ã»ã¹ã§ããããã«ãªããŸããã
æããã«ããã¹ãŠã®ãŠãŒã¶ãŒãåžžã«æºè¶³ããŠããããã§ã¯ãããŸããã æè¯ã®å ŽåãããŠã³ã¿ã€ã ã¯æ·±å€ã«çŽ10ã20åããããŸããããããŠããã¹ãŠãããŸããã£ããšãã§ãã æãããŸããããªãã£ãå Žåã ãããã€ã¯ä»äºãçµããããšãªããæãäžé©åãªå Žæã§äºæããã«æ»äº¡ããããŒã ã¯ãã©ãããã©ãŒã ããŽãç®±ã«å£ãããŸãŸã«ãªããŸããã ã©ããã§ãäœããæ©èœããã©ããã§æ©èœããŸããã§ããããæå³ãããšããã«æ©èœããŸããã§ããã ãããŠã次ã®ç ããªãå€ã®æ°æéã§ãç§ã¯ç·æ¥ã«ãã¹ãŠãæŽé ããªããã°ãªããŸããã§ããã æè¡ãµããŒããå°é£ãªããããŠãŒã¶ãŒã®æããæããããæãã€ã©ã€ã©ãã人ã¯å®å¿ã§ããé»è©±ãããã©ã€ã³ã§çŽæ¥ãã¬ãªã¢ã³ãšã¯ãã ä»ããããŸããã
åœæããšã«ãã§ã®éçºã®é²åã¯ãããå€ããããé »ç¹ã«ãããè¯ããªãªãŒã¹ããã段éã«éããŸããã 圌ãã¯ããªãªãŒã¹ã®ãã¥ãŒãæ§ç¯ãããããŠãŒã¶ãŒãæè¡ãµããŒãã«è² æ ãããããããããšããã¯ãæã¿ãŸããã§ããã
Deployã®æ°ããèŠä»¶ã圢æãããŸãã ïŒ
- ãšã«ãã®æå°ããŠã³ã¿ã€ã ãçæ³çã«ã¯-ãã®äžåš;
- ééçãªããŒã¿æŽæ°ã
- ãªãªãŒã¹ã倱æããå Žåã§ããã·ã¹ãã ã¯åŒãç¶ãåäœããã¯ãã§ãã
- 人çèŠå ãæé€ããããã®å®å šèªååãŸãã¯æå°éã®æåã¢ã¯ã·ã§ã³ã
- ãããªãæ¹åãšéçºã®ããã®ã·ã³ãã«ãªã³ãŒãã
èŠä»¶ãããã«ç解ããããšã§ãã¡ã€ã³ã¢ããªã±ãŒã·ã§ã³ã§ãµããŒãããªããã°ããã³ãã£ãŒã¯å€±æã«çµãããŸãã ã¹ã¿ã³ãã¢ãã³ã®å±éã·ã¹ãã ãäœæããããšã¯ã§ããŸããã ã·ã¹ãã èªäœãæãåºæ¬çãªã³ãŒãã§ã¯ããªãªãŒã¹ã¹ã¯ãªããããµããŒãããã€ã³ãã©ã¹ãã©ã¯ãã£ãè¿œå ããã³ãŒããããŒã¿ãããã³ããããžã®èŠä»¶ã確ç«ããå¿ èŠããããŸãã
Elbaã®æ°ããããŒãžã§ã³ãå±éããäœæ¥ã®ã»ãšãã©ã¯ãäœæ¥äžã®ããŒãžã§ã³ãšäžŠè¡ããŠå®è¡ã§ããŸãã ãããã€ã¡ã³ãã¯ãç¹å®ã®ãµãŒãã¹ãååšãããã¹ããšããŒãã瀺ããã³ã³ãã€ã«ããããã£ã¹ããªãã¥ãŒã·ã§ã³ãšããããžãå ¥ãå£ã§åãåããŸãããã®åŸãå¿ èŠãªãã¹ãŠã®ãµãŒãã¹ãåæ£ããŠèµ·åããŸãã é©åãªã¿ã€ãã³ã°ã§ãã¹ã€ãããåŒããŠãã©ãããã©ãŒã å šäœãåãæ¿ããã ãã§ãã
海岞ã§ã¯ããã¹ãŠã人éã®å¶åŸ¡ãè¶ ããéæ³ã®ããã«èãããã
ããã°ã©ããŒãè¢ããŸããäžããå 人ãã¡ã®æ¬ ç¹ã匱ããã解æŸãããéæ³ã®åãåããæ°ãããããè¯ãã Deployãäžçã«èŠããªããã°ãªããªãç¬éã蚪ããŸããã
å倧ãªgusev_pãšããªãã®è¬èãªå¬äœ¿ã®å©ããåããŠã圌ã¯ã©ããããã®æéãç°¡æœã«ã塵ãšç°ããçãŸããŸãã-匷åãªæ¢ããããªãããã© ã
第2ç« ç°å¢
å±éããã»ã¹ãšçŽç²ã«æè¡çãªè©³çŽ°ã説æããåã«ãäœãæ±ã£ãŠããããäŒãã䟡å€ããããŸãã
-Elba-WebãµãŒãã¹ãWindowsã¹ã¿ãã¯ã®è£œåãã³ãŒãã¯CïŒã§èšè¿°ãããŠããŸãã
-ã¡ã€ã³ã¢ããªã±ãŒã·ã§ã³ïŒããã³ãïŒ-IISçšã®ASP.Net Webãµã€ãã éšåçã«Webãã©ãŒã ãéšåçã«MVCã
-å€æ°ã®httpã€ã³ã¿ãŒãã§ã€ã¹ãåããã¹ã¿ã³ãã¢ãã³ãµãŒãã¹ãç¶ç¶çã«èª¿éããŸããã ãµãŒãã¹ã¯ããã©ã³ã¹ãšãã©ãŒã«ããã¬ã©ã³ã¹ã®ããã«è€è£œãããŸãã
-ã¹ã±ãžã¥ãŒã«ã«åŸã£ãŠã¹ã±ãžã¥ãŒã©ã«ãã£ãŠèµ·åãããå€æ°ã®ããããã
-äž»èšæ¶-MS SQL ServerããŒã¿ããŒã¹ã
-éæ£èŠåããŒã¿ããã³éèšçšã®MongoDBã
-å šææ€çŽ¢ã®ããã®ElasticSearchã
-ã¡ãã»ãŒãžã³ã°çšã®RabbitMQã
SQLããŒã¿ããŒã¹ã¯è¿œå å°çšãšããŠäœ¿çšãããŸãã ã¢ããªã±ãŒã·ã§ã³ã³ãŒãã¯UPDATEãšDELETEã䜿çšããããšã³ãã£ãã£ã®å€æŽãšåé€ã¯ãå€æŽããããã£ãŒã«ããŸãã¯åé€ã®ãµã€ã³ãå«ãæ°ãããªããžã§ã³ã®è¿œå ã«ãã£ãŠè¡ãããŸãã ãªããžã§ã³çªå·ã¯ã1çš®é¡ã®ãšã³ãã£ãã£ãééããå¢åã«ãŠã³ã¿ãŒã§ãã ãªããžããªã®ã¢ããªã±ãŒã·ã§ã³ã³ãŒãå ã§ORMã䜿çšãããšãç¹å®ã®åãšã³ãã£ãã£ã®æåŸã®åé€ãããŠããªããªããžã§ã³ã®ã¿ãéžæãããŸãã ãã®ãããªã¹ããŒã ã®çµæãšããŠããã¹ãŠã®ããŒã¿ã®ããŒãžã§ãã³ã°ãšå€æŽã®å±¥æŽãååŸãããŸããããã«ããã以äžã«èª¬æãã+86ã®éæ³ãåŸãããŸãã
第3ç« éæ³ã®åŠæ ¡
Deployã®äœæ¥ã説æããŸãã ãŸãããªãªãŒã¹ãå±éããããã»ã¹å šäœãçŽ40ã®ã¹ãããã«åããŸããã åã¹ãããã¯ã倧ããªäœæ¥ã®å°ããªéšåãå®è¡ããããã«å¯ŸããŠã®ã¿è²¬ä»»ãè² ããŸãã 次ã®ã¹ãããã¯ãåã®ã¹ããããæ£åžžã«å®äºããåŸã«ã®ã¿éå§ãããŸãã ã»ãšãã©ã®æé ã¯ãåäœäžã®ãšã«ããšäžŠè¡ããŠå®è¡ã§ããŸãã 倱æããå Žåãå¯èœã§ããã°ãã¹ãããã¯ã·ã¹ãã ãå ã®ç¶æ ã«æ»ããŸãã
åãšåæ§ã«ãç¹å¥ã«èšç·Žãããå°ããªãªã¢ãŒããµãŒãã¹ãElbaã®æ°ãããã£ã¹ããªãã¥ãŒã·ã§ã³ãåãåãã Deployãèµ·åããŸãã æéãç¡é§ã«ããããšãªãã圌ã¯æåã®äžæ©ãèžã¿åºããŸãã
æåã®æé ã¯ããã»ã©èå³æ·±ããã®ã§ã¯ãããŸããã çŸåšã®æ§æã確èªããããã¡ã€ã«ã·ã¹ãã ãæºåãããæ°ãããµãŒãã¹ã³ãŒãã察å¿ãããã¹ãã®æ°ãããã©ã«ããŒã«ã³ããŒãããã¹ã±ãžã¥ãŒã©ã§ã¿ã¹ã¯ãæºåãããŸãã åæ§ã®ã¿ã¹ã¯ããã¹ãŠã®ãã¹ãã§äžŠååãããŸãã
Next Deployã¯ããŒã¿ã®ç§»è¡ã«å¯ŸåŠããå¿ èŠããããŸãã ãã®ç¬éã圌ã¯éæ³ã®é åã«å ¥ããŸãã
æ°ãããªãªãŒã¹ã§ã¯ãããã°ã©ããŒã¯è¯ãä»äºãããå€ãã®æ°ããã³ãŒããæžããæ°ãããšã³ãã£ãã£ãäœæããæ¢åã®ãã®ããªãã¡ã¯ã¿ãªã³ã°ããŸããã ãããã®ããã€ãã§ã¯ãããã©ã«ããå€æŽãããæ°ããããããã£ã衚瀺ãããããå€ãããããã£ãåé€ãããŠããŸãã çŸåšã§ã¯ãå€ããšã³ãã£ãã£ã®ä»£ããã«ãããã€ãã®æ°ãããšã³ãã£ãã£ã®ã»ããã䜿çšãçžäºæ¥ç¶ããŸãã¯ãã®éã«ããããšãã§ããŸãã 1察1ã®é¢ä¿ãããå Žåãå€å¯Ÿå€ã®é¢ä¿ã衚瀺ãããå ŽåããããŸãã åé¡ã¯ãæ°ããã³ãŒããå€ãããŒã¿ãåŠçããæ¹æ³ãç¥ããªãããšã§ãã æ°ããã³ãŒããéå§ããåã«ãæ¢åã®ããŒã¿ãæºå-移è¡ããå¿ èŠããããŸãã æ°ãããªãªãŒã¹ãæºåãããšããããã°ã©ãã¯ããªããžããªå ã®ããŒã¿æ§é ãå€æŽããçŸåšã®ãšã³ãã£ãã£ãå€æŽããã³å€æããé©åãªã¹ã¯ãªãããšãŠãŒãã£ãªãã£ãäœæããŸãã
ããããå€ãã³ãŒãã¯æ°ããããŒã¿ãæ±ãæ¹æ³ãç¥ããŸããã ãŸããéåžžãããŒã¿ã®ç§»è¡ãç°¡åãªå Žåãéæ¹åã®ç§»è¡ã¯äžå¯èœã§ã¯ãªãã«ããŠãå°é£ã§ãã æ°ããã³ãŒãããšã³ãã£ãã£ãæ°ããæ¹æ³ã§æžã蟌ãå Žåãããããå€ããã®ã«å€æããããšã¯ã§ããŸããã ããŒã¿ã®ç§»è¡ãããŒã«ããã¯ãã䟡å€ã¯ãããŸããã ãããã£ãŠãæéãšç©ºéã亀差ããªãå Žåã«ã®ã¿ãå€ãã³ãŒãã§å€ãããŒã¿ãåŠçããæ°ããã³ãŒãã§æ°ããããŒã¿ãåŠçããŸãã
ãã®ããã Deployã®æåã®ä»®å®ãçãŸããŸãããã€ãŸããããŒã¿ã®ç§»è¡ãåäœäžã®ã³ãŒããå£ããŠã¯ãªããŸããã æ°ããåãšããŒãã«ãäœæã§ããŸãããçŸåšã®ããŒã¿ãå€æŽããããšã¯ã§ããŸããã ããããå€æããå¿ èŠãããå Žåã¯ãæ°ããåãšããŒãã«ãäœæããããã«çµæãé 眮ããå¿ èŠããããŸãã 幞ããªããšã«ãã¢ããªã±ãŒã·ã§ã³ã³ãŒãã®ORMã¯ã¹ãã¬ãŒãžããé©åã«æœè±¡åããããã®ãããªå€æŽã«æ°ä»ããªãããã«ããŠããŸãã
åªæïŒ1æåã®ç§»è¡åŸã Deployã¯ãã¹ãŠã®ãããããåæ¢ããŸãããªãªãŒã¹ã®æéäžãããããã®äœæ¥ã¯ç ç²ã«ãªããŸãã 次ã«ãµãŒãã¹ã ãã ããã·ã¹ãã ãæ©èœããã«ã¯ãµãŒãã¹ãå¿ èŠã§ããããã¹ãŠãåæ¢ããããšã¯ã§ããŸããã åãªãªãŒã¹ã§ããããžãšèšå®ãå€æŽããããããŸããã§ããã ã»ãšãã©ã®å Žåãæ°ãããªãªãŒã¹ã®ããããžã¯ããã§ã«å±éããåäœããŠããElbaã®ããããžãšäžèŽããŸãã ã»ãšãã©ã®ãªãªãŒã¹ã§ã¯ãããããžã¯ãã£ãã«å€æŽããããå¿ èŠã«å¿ããŠå°ãã®æåæäœã§ç°¡åã«å€æŽã§ããããããã®èŠä»¶ã¯å¹²æžããŸããã
éåžžã«å€ãã®å Žåã移è¡ã¯é·ããåžžã«æéã§æ±ºãŸãããã»ã¹ã§ã¯ãããŸããã æ°çŸäžè¡ã®ããŒãã«ãšã®ã¬ãã€ãã®ããŒã¿ãããŠã³ããŒãããå¿ èŠãããå ŽåããããŸãã ãããããŠãŒã¶ãŒã¯åŸ ã¡ãããªãã®ã§ãåçŽãªãµãŒãã¹ã¯æªãã§ãã ãããŠãDeployã¯æåã®éæ³-ããŒã«ãã®ããŒãžã§ã³ç®¡çãããæ§é -ã䜿çšããŸããã ãã¹ãŠã®ç§»è¡ã¯2ã€ã®æ®µéã«åããããŸããã
æåã®æ®µé-æéã®å¶éã¯ã»ãšãã©ãããŸãã-ããŒã¿ã¹ããŒã ãæŽæ°ãããšã³ãã£ãã£ã®ã¡ã€ã³ããªã¥ãŒã ã®ç§»è¡ãè¡ããŸãã åãšããŒãã«ãè¿œå ãããã¹ãŠã®ãšã³ãã£ãã£ã¿ã€ãã®çŸåšã®ææ°ãªããžã§ã³ãèšæ¶ããŸãã ããŒã¿å€æçšã®ã¹ã¯ãªãããšãŠãŒãã£ãªãã£ãå®è¡ããåŸãæ°ããã³ãŒããæäœããããã®ãšã³ãã£ãã£ãæºåããŸãã äž»ãªããšã¯ãæåã®æ®µéã¯æ¢åã®ã³ãŒãã®äœæ¥ã劚ãããå€æŽãããããŒã¿ã¯å€ãã³ãŒãããã¯èŠããªãæ°ãããã£ãŒã«ãã«è¡šç€ºãããããšã§ãã
2çªç®ã®ã¹ããŒãžDeployã¯ãããŒãžã§ã³ãåãæ¿ããåã«åå¥ã®ã¹ããããå®è¡ããŸãã ãã®äžã§ãæåã®æ®µéã®åŸã«åºçŸãããšã³ãã£ãã£ã®æ°ããæ¹èšã®æ¯é ãè¡ãããŸãã ãããè¡ãã«ã¯ãåãã¹ã¯ãªãããšå€æãŠãŒãã£ãªãã£ããã¹ãŠå®è¡ãããŸããã以åã«èšæ¶ããããªããžã§ã³ããã§ã«äœ¿çšãããŠããŸãã ããã«ããã环ç©ãããå€æŽã®ã¿ãåŠçãããŸãã
ãã®ããã Deployã®2çªç®ã®ä»®å®ãç»å ŽããŸãããåããã¹ãäžã§ãå€ãã³ãŒãã®ä»£ããã«æ°ããã³ãŒãã§ãµãŒãã¹ãå®è¡ããŸãã ç°¡åã«ããããã«ãå±éæã«äœæ¥ãµãŒãã¹ã®ã¬ããªã«ã®ååãåæ¢ãã代ããã«æ°ãããµãŒãã¹ãèµ·åããããšã«ããŸããã å€ããµãŒãã¹ãæ©èœããŠããéãæŽæ°ãããããŒãžã§ã³ã¯ãã§ã«è¿ãã«ã³ããŒãããŠããŸããã çŸåšã®ãµãŒãã¹ã¯Deployã«ãã£ãŠåæ¢ãããæ°ãããµãŒãã¹ãèµ·åãããŸãã åæã«ãäžæçã«åæžãããã¬ããªã«æ°ã§ã·ã¹ãã å šäœãåäœãç¶ããŸãã
ã¹ãã«ïŒ2
ã·ã¹ãã ã®åºæ¬çãªãããã¯ãŒã¯ã€ã³ãã©ã¹ãã©ã¯ãã£ãå€æŽããå¿ èŠããããŸããã åãµãŒãã¹ã¯ç¹å®ã®èšå®ã»ããã§å®è¡ãããŸãããã®ãªãªãŒã¹ã§ã¯ããªãªãŒã¹ããŒãžã§ã³ã衚瀺ãããæ°ããå±éã®ãã³ã«å¢å ããŸãã ãµãŒãã¹èšå®ã§ããŒãžã§ã³ãæ£ããæå®ãããã°-ãããã€ã®ã¿ã¹ã¯ãç¶æããŸãã ããã³ããå«ããã¹ãŠã®ãµãŒãã¹ã¯ãåãããŒãžã§ã³å ã§ã®ã¿éä¿¡ã§ããŸãã ãããµãŒãã¹ãå¥ã®å€ããŸãã¯æ°ããå¥ã®ãµãŒãã¹ã«ãªã¯ãšã¹ããè¡ããšããªã¯ãšã¹ããåŠçãã代ããã«ãç¹å®ã®å¿çãè¿ãããŸãã 次ã«ããã®ãµãŒãã¹ã¯ãã©ãã¯ãªã¹ãã«ç»é²ããããªã¯ãšã¹ãã¯å¥ã®ã¬ããªã«ã«éãããŸãã
é§ãæ¿ããªã£ãŠããŸãã ãããã€ã¯ããŒã¯ããžãã¯èªäœã®é åã«è¿ã¥ããŸããã åç·ãæŽæ°ããçªã§ããã æãããªçç±ã§ããããã§äž»ãªå°é£ãçããŸããã 第äžã«ãæ°ããã¢ããªã±ãŒã·ã§ã³ã®éå§ãé·ãããã§ãã IISãäœãããã®ãã¯æ確ã§ã¯ãããŸãããããã¹ãŠã®ã¢ã»ã³ããªãã¡ã¢ãªã«äžãããããã£ãã·ã¥ããããã¡ã¿ããŒã¹ãæŽæ°ãããããŸãã ç§ã®ãŸãšããªéãé£ã¹ãã 第äºã«ãå®è¡äžã®ã¢ããªã±ãŒã·ã§ã³ã®ãŠãŒã¶ãŒããã®httpãªã¯ãšã¹ãã®ããã ããã§ããããããåãæšãŠãã¹ã¿ãããšã©ãŒããŸãã¯ã¿ã€ã ã¢ãŠããè¿ããããããŸããã çŸåšã®ãã¹ãŠã®èŠæ±ãšæ°ããèŠæ±ããã¹ãŠåŠçããå¿ èŠããããŸãã
Deployã¯ãå€ããã¹ããå®è¡ãããŠãããã¹ãŠã®ãã¹ãäžã®IISã§æ°ããããã³ããå±éããŸãã ããããå¥ã®ããŒãã§ã å ç±ãããŠããªãã¢ããªã±ãŒã·ã§ã³ã¯èµ·åæã«åæ¢ããããããŠã©ãŒã ã¢ããããæ¹æ³ãåŠã³ãŸããã ãããè¡ãã«ã¯ãéå§æã«ãŠãŒã¶ãŒãæã人æ°ã®ããããŒãžã«ã¢ã¯ã»ã¹ããŠã·ãã¥ã¬ãŒãããŸããããã«ãããIISã¯å¿ èŠãªãã¹ãŠã®ãã£ãã·ã¥ã¢ã¯ã·ã§ã³ãå®è¡ã§ããŸãã æ°ããè£å©ããã³ãããŠã©ãŒã ã¢ããããã®ãèŸæ±åŒ·ãåŸ ã¡ãŸãã ãã®çµæãå€ãã¢ããªã±ãŒã·ã§ã³ã¯åŒãç¶ãåããã³ãã§æ©èœããçä¿¡ãŠãŒã¶ãŒãªã¯ãšã¹ããåžžã«åŠçããŸããæ°ããã¢ããªã±ãŒã·ã§ã³ã¯æ¢ã«èµ·åãããŠããããŸã åŸ æ©ããŠããŸãã
ãªãªãŒã¹ã®åãæ¿ãã¯ããã«å§ãŸããŸãã æ°ããã³ãŒãã®ããŒã¿æºåãå®äºãããã¹ãŠã®ãšã³ãã£ãã£ã®æ¢åã®ãªããžã§ã³ãå€æããå¿ èŠããããŸãã ãã®ããã»ã¹ã劚ãããã®ã¯ãããŸããã ãã以äžææ°ã®ãšã³ããªã¯è¡šç€ºãããŸããã ãã®ä»®å®ãä¿®æ£ããããã«ããã¹ãŠã®çä¿¡ãŠãŒã¶ãŒèŠæ±ã«å¯ŸããŠããããã¯ãã確ç«ããããšã決å®ãããŸããã ããã¯éåžžã«åŒ·åãªåªæã§ãããå€ãã®ç°ãªãå¹æã§æ§æãããŠããŸãã
ãã¹ãŠã®ããã³ãããã³äœæ¥ãµãŒãã¹ã¯ããªãªãŒã¹ã®åãæ¿ãã®éå§ã«é¢ããDeployããã®ã·ã°ãã«ãåä¿¡ããŸããããã¯ãäœæ¥ã®é¡èãªå€åã«ã€ãªãããŸãã ä¿¡å·ãåä¿¡ããç¬éãããåãããããã¯ããã¢ããªã±ãŒã·ã§ã³ã³ãŒãå ã«èšå®ãããŸãã ããã³ãã®æ°ããhttpãªã¯ãšã¹ãã¯ãã¹ãŠäžæåæ¢ããåé€ãããã®ãåŸ ã¡ãŸãã ããããã¯ãã¯ãããŒã¿ããŒã¹ãžã®æ°ããã¬ã³ãŒãã®è¿œå ãçŠæ¢ããŠãæçµçãªç§»è¡ã®èªç±ãæäŸããŸãã ããããã¯ããã€ã³ã¹ããŒã«ããåã«ã¢ããªã±ãŒã·ã§ã³ã«å°éããçŸåšã®èŠæ±ãèšé²ãè©Šã¿ãŠããå Žåãã€ã³ãã©ã¹ãã©ã¯ãã£ã³ãŒãã®æãæ·±ããšããããäŸå€ãã¹ããŒãããã¯ãšãªã¯å é ã§ç¹°ãè¿ããããã¹ãŠã®æ°ãããããã¯ãšåãããããã¯ãã«å¯ŸããŠåæ¢ããŸãã
Deployã¯ãããŒã¿ç§»è¡ã®2çªç®ã®æçµæ®µéãå®è¡ããŸãã ãã以æ¥ãå©çšå¯èœãªãã¹ãŠã®ããŒã¿ã¯ãæ°ããã³ãŒãã§åŠçããæºåãã§ããŠããŸãã 移è¡ãå®äºãããšãããããã¯ããåé€ããããã®ä¿¡å·ãããã³ãã«éä¿¡ãããŸãã ãå€ããã¢ããªã±ãŒã·ã§ã³ãžã®å ¥ãå£ã§ç¥çµè³ªã«ãªã£ãŠãããã¹ãŠã®ãªã¯ãšã¹ãã¯ããã§ã«ãŠã©ãŒã ã¢ããããããè£å©ãæ°ãããã®ã«ãããã·ããããã®å¿çã¯ã¯ã©ã€ã¢ã³ãã«ãããã·ãããŸãã ãããã£ãŠããŠãŒã¶ãŒã®èŠæ±ã¯æ°ãããè£å©ãã¢ããªã±ãŒã·ã§ã³ã®æ°ããã³ãŒãã«ãã£ãŠãã§ã«åŠçãããŠãããå€ãã¢ããªã±ãŒã·ã§ã³ã¯ãããã·åŠçã®ã¿ãåŠçããŸãã å€ãã³ãŒãã¯æ°ããããŒã¿ã§ã¯æ©èœããŸããã ãŸããåäžã®ãŠãŒã¶ãŒãªã¯ãšã¹ãã倱ãããŠããŸããã
ããããã¯ãã®ã€ã³ã¹ããŒã«ããåé€ãŸã§ã®ããã»ã¹å šäœã¯ãæåéãæ°ç§ããããŸãã ã¢ã€ãã¢å šäœããæ°ããã¢ããªã±ãŒã·ã§ã³ã§ãªã¯ãšã¹ãã®åŠçãéå§ã§ããå¯äžã®ç¬éã決å®ããã®ã«åœ¹ç«ã¡ããã®ç¬éãŸã§ã«ãæ¢åã®ããŒã¿ã¯ãã¹ãŠå®å šã«æ¢ã«ç§»è¡ãããŠããŸãã ãã€ã§ããæ°ãããšã³ããªã¯å€ãã³ãŒããŸãã¯æ°ããã³ãŒãããããŒã¿ããŒã¹ã«èœã¡ãŸãããåæã«ã¯ãªããŸããã ããã«ãããããŒã¿ã«å¿ããã³ãŒãã®éäºææ§ãæé€ããããªãªãŒã¹ã®åãæ¿ããç°¡çŽ åããã³é«éåãããŸãã
åªæïŒ3Deployã®äœæ¥ã¯ãŸã å®äºããŠããŸããã 2ã€ã®ã¢ããªã±ãŒã·ã§ã³ãšãããã·ã䜿çšããããšã¯ããŸã䟿å©ã§ã¯ãããŸããã Deployã¯ãIISã®ããã©ã«ãã¢ããªã±ãŒã·ã§ã³ããæ°ããã¢ããªã±ãŒã·ã§ã³ïŒãè£å©ããèµ·åããããŸãã«ãã®ã¢ããªã±ãŒã·ã§ã³ïŒã®ãããã©ã«ããŒã«åãæ¿ããŸãã ãã®ããã»ã¹ã«ãIISæéïŒéåžžã¯æ°ç§ïŒãããããŸãã ãã®éãã£ãšãèŠæ±ã¯å€ãã¢ããªã±ãŒã·ã§ã³ã§åä¿¡ããããè£å©ãã¢ããªã±ãŒã·ã§ã³ã«ãããã·ãããŸãã äžæ¹ãæ°ãããåäœäžã®ãã¢ããªã±ãŒã·ã§ã³ãèµ·åããèµ·ååŸã¯ãã€ãã®ããã«ãããŠã©ãŒã ã¢ãããããæéãäžããå¿ èŠããããŸãã ãããã£ãŠãæ°ããã¢ããªã±ãŒã·ã§ã³ã¯çä¿¡HTTPèŠæ±ãåŠçãããå ç±æéå šäœã«ããã£ãŠãè£å©ãèŠæ±ãžã®ãããã·ãåŠçããŸãã
ã¯ãšãªã®ããããã¯ããåé€ããæé ã¯ãæçµçãªå±éæé ãšèŠãªãããŸãã äžçã¯å€ãããŸããã æ°ããã³ãŒããæ©èœããéå»ã«æ»ãããšã¯äžå¯èœã§ãã ããããåã®ã¹ãããã¯ãçµæãªãã§ããŒã«ããã¯ã§ããŸãã åé¢ãåãæ¿ããåã«äŸå€çãªç¶æ³ãçºçããå ŽåãDeployã¯ãçŸåšã®æé ããæåã®æé ãžãšéã®é åºã§ã¹ããããããŒã«ããã¯ããã·ã¹ãã å šäœã䜿çšå¯èœãªç¶æ ã«æ»ããŸãã æ°ãããµãŒãã¹ã¯ãªãã«ãªããå€ããµãŒãã¹ã¯ãªã³ã«ãªããåæ¢ãããããããèµ·åãããŸãã
åªæïŒ4æåŸã®æé ã§ã¯ã Deployã¯å€ããµãŒãã¹ã®åååäœããŠããã¬ããªã«ãåæ¢ãã代ããã«æ°ãããµãŒãã¹ãèµ·åããã¹ã±ãžã¥ãŒã©ã§æ°ããããããããªã³ã«ããæ°ããããã³ãããŠã©ãŒã ã¢ããããã®ãåŸ ã£ãŠããªãªãŒã¹ã®æåã«é¢ãããã°ãæžã蟌ãå¿ èŠããããŸãã ãããã€å®äºïŒ
ããæç¹ã§ã3ã€ã®Elbaã¢ããªã±ãŒã·ã§ã³ãåãIISã®åããã¹ãã§å®è¡ãããŠããŸãã å€ããã®ã¯ãIISãåãæ¿ããåã«çä¿¡èŠæ±ãåãå ¥ããããããè£å©çãªãæ°ãããã®ã«ãããã·ããŸããã 第äžã«ããŸãæ°ãããåãæ¿ãã®çŽåŸã«çºå£²ãããã 2çªç®ã®ãè£å©ããšå®å šã«åäžã§ãã 3çªç®ã®ãããã·ã¯ããŠã©ãŒã ã¢ããäžã«2çªç®ã«ãããã·ãèŠæ±ããŸãã æåŸã®ããŠã©ãŒã ã¢ãããã®åŸãã¢ããªã±ãŒã·ã§ã³ã¯ãããã·ãåæ¢ããããèªäœã§ãªã¯ãšã¹ãã®åŠçãéå§ããŸãã æ®ãã®ã¢ããªã±ãŒã·ã§ã³ã¯ãããããžã®ãªã¯ãšã¹ãã®ãããŒããªããªããšæ¶æ» ããŸãã æåŸã«ãæ®ã£ãŠãããã®ã¯1ã€ã ãã§ãã
ãšãããŒã°
ãã®èšäºã§ã¯ãäž»ãªã¢ã€ãã¢ãšã Elbaãçæéã§ãã³ã¹ãããã®è¿ éãªæŽæ°ãå®è¡ã§ããããã«ããç¹å®ã®ããªãã¯ã«ã€ããŠèª¬æããŸãã
Mongããã³Elasticã§ããŒã¿ã移è¡ããã¬ã³ãŒãã®æ£ããããŒã«ããã¯ã確ä¿ããæªåé«ãããããã¯ããåæããIISãšæŠã£ãŠã ãããã€ã® UIãäœæããä»ã®å€ãã®å°ããªæè¡çåé¡ã解決ããæ¹æ³ã¯ãèå°è£ã®ãŸãŸã§ãã 詳现ã«èå³ãããå Žåã¯ãã³ã¡ã³ãã§ãçãããŸãã
æã ãElbaã¯ãã¹ã¿ããã®äžã§æŽæ°ãããŸãããããã¯éåžžãããŒããŠã§ã¢ã®ç§»åãOSãã€ã³ãã©ã¹ãã©ã¯ãã£ãµãŒãã¹ã®ã¢ããã°ã¬ãŒããããã³ã»ãšãã©æ±ºããŠæ°ããæ©èœã®ãªãªãŒã¹ã«é¢é£ããŠããŸãã
æ°ããDeployã®éçºã®çµæãç§ãã¡ã¯ã»ãŒæãã§ãããã®ãæã«å ¥ããŸãã-ãŠãŒã¶ãŒã«å®å šã«ééçãªæ°ãããªãªãŒã¹ã®ãã³ã¹ããããããã€ã¡ã³ãã§ãã ã¯ã©ã€ã¢ã³ãã¯ãå€ãã¢ããªã±ãŒã·ã§ã³ã®ããŒãžã«ç§»åããŠæŽæ°ããæ°ããã¢ããªã±ãŒã·ã§ã³ã«è¡šç€ºã§ããŸãã å±éããã»ã¹å šäœã®æèŠæéã¯10åæªæºã§ãããèŠæ±ã«å¯Ÿããå¿çã®æ倧é 延æéã¯3ã4ç§ã§ãã ããã«ã Deployã³ãŒãå šäœãç§ãã¡ã®ãã®ã§ãã åŒãç¶ãæ¹è¯ãšæ¹åãè¡ããæ°ããæ©èœãå°å ¥ããæ©èœãéçºããŠããŸãã