Habrahabrã®èªè ã®æ³šæã¯ã æšå¹Žã® 11æ7æ¥ãã8æ¥ã«ã¢ã¹ã¯ã¯è¿éã®ã¹ã³ã«ã³ãŽã©ã§éå¬ãããHighLoad ++äŒè°ã®æ®µéã§ã®Vyacheslav Bakhmutovã®ã¹ããŒãã®ãããªã®ãã©ã³ã¹ã¯ãªããïŒåºçç©ã®æåŸïŒã§ç€ºãããŸã ã
ç§ã®ååã¯Bakhmutov Gloryã§ããDropboxã§åããŠããŸãã ç§ã¯ãµã€ãä¿¡é Œæ§ãšã³ãžãã¢ïŒSREïŒã§ãã Goã倧奜ãã§ã宣äŒããŠããŸãã ã¿ããªã§golangshowããããã£ã¹ããé²é³ããŸãã
Dropboxãšã¯äœã§ããïŒ
ããã¯ããŠãŒã¶ãŒããã¡ã€ã«ãä¿åããã¯ã©ãŠãã¹ãã¬ãŒãžã§ãã 5å人ã®ãŠãŒã¶ãŒãããã20äžãè¶ ããããžãã¹ããããèšå€§ãªéã®ããŒã¿ãšãã©ãã£ãã¯ïŒ1æ¥ããã12åãè¶ ããæ°ãããã¡ã€ã«ïŒããããŸãã
æŠå¿µçã«ã¯ãã¢ãŒããã¯ãã£ã¯2ã€ã®å€§ããªèŠçŽ ã§ãã æåã®éšåã¯ã¡ã¿ããŒã¿ãµãŒããŒã§ããããã¡ã€ã«ããã¡ã€ã«éã®æ¥ç¶ããŠãŒã¶ãŒæ å ±ãããçš®ã®ããžãã¹ããžãã¯ã«é¢ããæ å ±ãä¿åãããããã¯ãã¹ãŠããŒã¿ããŒã¹ã«æ¥ç¶ãããŸãã 2çªç®ã®å€§ããªéšåã¯ããŠãŒã¶ãŒããŒã¿ãä¿åãããããã¯ã¹ãã¬ãŒãžã§ãã åœåã2011幎ã«ã¯ããã¹ãŠã®ããŒã¿ãAmazon S3ã«ä¿åãããŠããŸããã 2015幎ã«ããã¹ãŠã®ãšã¯ãµãã€ããèªåèªèº«ã«ããŠã³ããŒãããããšãã§ãããšããç¬èªã®ã¯ã©ãŠãã¹ãã¬ãŒãžã®äœæã«ã€ããŠè©±ããŸããã
ããžãã¯ãã±ãããšåŒã³ãŸãã Goã§æžãããŠãããäžéšã¯Rustã§æžãããŠãããPythonã§ãããªãæžãããŠããŸãã Magic Pocketã®ã¢ãŒããã¯ãã£ã¯ãã¯ãã¹ãŸãŒã³ã§ãããããã€ãã®ãŸãŒã³ããããŸãã ã¢ã¡ãªã«ã§ã¯ããããã¯3ã€ã®ãŸãŒã³ã§ãããPocketã§çµåãããŸãã ãšãŒãããã«ã¯ãã±ããããããŸãããã¢ã¡ãªã«äººãšäº€å·®ããããšã¯ãããŸããããšãŒããã人ã¯èªåã®ããŒã¿ãã¢ã¡ãªã«ã«æã¡ãããªãããã§ãã ãããã®éã®ãŸãŒã³ã¯ããŒã¿ãè€è£œããŸãã ãŸãŒã³å ã«ã»ã«ããããŸãã ãããã®ã»ã«ãå¶åŸ¡ãããã¹ã¿ãŒãããŸãã ãŸãŒã³éã«è€è£œããããŸãã åã»ã«ã«ã¯ããã®ããŒã¿ãä¿åãããŠãããµãŒããŒãç£èŠããããªã¥ãŒã ãããŒãžã£ãŒããããéåžžã«å€§ããªãµãŒããŒããããŸãã
åãµãŒããŒã§ãããã¯ãã¹ãŠãã±ããã«çµåããããã±ããã¯1 GBã§ãã ãŠãŒã¶ãŒããä¿åããããŒã¿ãããã¯ã¯4 MBã§ãããããããæäœããããšã¯éåžžã«é£ãããããããŒã¿ãåé€ãã¯ãªã¢ãããã©ã°ãããšããã©ããã§ããŒã¿ãã¹ããŒãããšãã«ãã±ããã䜿çšããŸãã Magic Pocketã®ãã¹ãŠã®ã³ã³ããŒãã³ãã«ã€ããŠã¯ãæè¡ããã°ã§è©³ãã説æãããŠããŸããããããã«ã€ããŠã¯èª¬æããŸããã
SREã®èŠ³ç¹ããã¢ãŒããã¯ãã£ã«ã€ããŠèª¬æããŸãã ãã®èŠ³ç¹ãããããŒã¿ã®å¯çšæ§ãšã»ãã¥ãªãã£ã¯éåžžã«éèŠã§ãã ããã¯äœïŒ
å¯çšæ§ã¯è€éãªæŠå¿µã§ããããµãŒãã¹ããšã«ç°ãªãæ¹æ³ã§èšç®ãããŸãããéåžžã¯å®äºãããªã¯ãšã¹ãã®æ°ãšãªã¯ãšã¹ãã®ç·æ°ã®æ¯çã§ãããéåžž9ã999ã9999ã99999ã§è¡šãããŸããããããå®éã«ã¯çœå®³ãŸãã¯ãã®åé¡ãã©ãã ãä¿®æ£ãããã«ããåé¡ã ã©ã®ããã«ä¿®æ£ããŠããæ¬çªç°å¢ã§ããŸãã¯åã«ããŒãžã§ã³ãããŒã«ããã¯ããŸãã
å®å šæ§ãšã¯äœã§ããïŒ
å®å šæ§ã¯ã©ã®ããã«èšç®ããŸããïŒ äžéšã®ããŒã¿ãååŸããŠãããŒããã©ã€ãã«ä¿åããŸãã 次ã«ããããããã£ã¹ã¯ã«åæããããŸã§åŸ ã€å¿ èŠããããŸãã ããã¯ã°ãããŠããŸãããå€ãã®äººã¯ãã®æé ãåã«ã¹ãããããnosqlãœãªã¥ãŒã·ã§ã³ã䜿çšããŠããŸãã
å®å šæ§ã¯ã©ã®ããã«èšç®ãããŸããïŒ
AFRããããŸã-ããã¯å¹Žéã®ãã£ã¹ã¯ãšã©ãŒçã§ãã ç¹å®ã®ããŒããã©ã€ãã§çºçãããšã©ãŒããšã©ãŒã®çºçé »åºŠã«é¢ããããŸããŸãªçµ±èšæ å ±ããããŸãã ãããã®çµ±èšã«æ £ããããšãã§ããŸãïŒ
ãã®åŸãããŒã¿ãç°ãªãããŒããã©ã€ãã«è€è£œããŠãèä¹ æ§ãåäžãããããšãã§ããŸãã RAIDã䜿çšããŠãã¬ããªã«ãç°ãªããµãŒããŒãŸãã¯ç°ãªãããŒã¿ã»ã³ã¿ãŒã«ä¿åããããšãã§ããŸãã ãããŠã1ãã€ãã倱ã確çãšåãããããã«ã³ãé£éãèæ ®ãããšã27ãã€ã³ã«ã€ããŠäœããåŸãŸãã ãšã¯ãµãã€ãã®ããŒã¿ãããDropboxã¹ã±ãŒã«ã§ããè¿ãå°æ¥ã«1ãã€ãã倱ãããããšã¯ãããŸããã ãã ããããã¯ãã¹ãŠäžæçãªãã®ã§ããããªãã¬ãŒã¿ãŒãšã©ãŒããŸãã¯ã³ãŒãå ã®è«çãšã©ãŒã§ããããŒã¿ã¯ãããŸããã
ããŒã¿ã®å¯çšæ§ãšã»ãã¥ãªãã£ãå®éã«ã©ã®ããã«æ¹åããŸããïŒ
ç§ã¯ããã4ã€ã®ã«ããŽãªã«åããŸãããããã¯æ¬¡ã®ãšããã§ãã
- åé¢;
- ä¿è·;
- ã³ã³ãããŒã«;
- èªåå
èªååã¯éåžžã«éèŠã§ãã
絶çžãèµ·ãããŸãïŒ
- ç©çç
- è«çç
- æäœå¯èœã
ç©ççãªåé¢ã DropboxãŸãã¯Dropboxã®ãããªäŒæ¥ã®èŠæš¡ã§ã¯ãããŒã¿ã»ã³ã¿ãŒãšéä¿¡ããããšãéåžžã«éèŠã§ããããŒã¿ã»ã³ã¿ãŒå ã§ã®ãµãŒãã¹ã®äœçœ®ããµãŒãã¹ãžã®ãšãã«ã®ãŒã®äŸçµŠæ¹æ³ãããã³ãããã®ãµãŒãã¹ã®ãããã¯ãŒã¯å¯çšæ§ã®çš®é¡ãç¥ãå¿ èŠããããŸãã åžžã«ããã¯ã¢ããããå¿ èŠãããããŒã¿ããŒã¹ãµãŒãã¹ã1ã€ã®ã©ãã¯ã«ä¿æããããããŸããã æã£ãŠãããã¹ãŠã®ããã¯ã¢ããã400 Mbpsã§ãããååãªãã£ãã«ããªããšããŸãããã ãã®ã¹ã¿ãã¯ãæ·±ãæãäžããã»ã©ãææ決å®ã®ã³ã¹ãã¯é«ããªããé£ãããªããŸãã ã©ãã ãäœããªããã¯ããªãã®æ±ºå®ã§ããããã¡ãããããŒã¿ããŒã¹ã®ãã¹ãŠã®ã¬ããªã«ã1ã€ã®ã©ãã¯ã«å ¥ããã¹ãã§ã¯ãããŸããã ãšãã«ã®ãŒããªãã«ãªããããŒã¿ããŒã¹ããªããªãããã§ãã
æ©åšã¡ãŒã«ãŒã®èŠ³ç¹ãããããããã¹ãŠå¥ã®æ¬¡å ã§èŠãããšãã§ããŸãã ç°ãªãæ©åšã¡ãŒã«ãŒãç°ãªããã¡ãŒã ãŠã§ã¢ãç°ãªããã©ã€ããŒã䜿çšããããšãéåžžã«éèŠã§ãã ãªãã§ïŒ æ©åšã¡ãŒã«ãŒã¯ãœãªã¥ãŒã·ã§ã³ãä¿¡é Œã§ãããšèšã£ãŠããŸãããå®éã«ã¯åãã€ããŠãããããã§ã¯ãããŸããã ãŸããå°ãªããšã圌ãã¯ççºããŸããã
ãã®ãã¹ãŠã«åºã¥ããŠãéèŠãªããŒã¿ãã€ã³ãã©ã¹ãã©ã¯ãã£ã®ããã¯ã¢ããã®ã©ããã«çœ®ãã ãã§ãªããå€éšã€ã³ãã©ã¹ãã©ã¯ãã£ã«ã眮ãããšãéèŠã§ãã ããšãã°ãGoogleã¯ã©ãŠãã䜿çšããŠããå Žåã¯ãéèŠãªããŒã¿ãAmazonã«å ¥ãããã®éãåæ§ã§ãã ã€ã³ãã©ããªããªããšãã©ãããã§ãããã¯ã¢ãããåãããããã§ãã
è«ççãªåé¢ã ã»ãšãã©ãã¹ãŠã®äººã圌女ã«é¢ãããã¹ãŠãç¥ã£ãŠããŸãã äž»ãªåé¡ïŒ1ã€ã®ãµãŒãã¹ã§åé¡ãçºçãå§ãããšãä»ã®ãµãŒãã¹ã§ãåé¡ãçºçãå§ããŸãã ãããµãŒãã¹ã®ã³ãŒãã«ãã°ããã£ãå Žåããã®ãã°ã¯ä»ã®ãµãŒãã¹ã«åºããå§ããŸãã ééã£ãããŒã¿ãååŸããŠããŸãã ããã«å¯ŸåŠããæ¹æ³ã¯ïŒ
匱ãã€ãªããïŒ ããããã»ãšãã©æ©èœããŸããã ççµåã§ã¯ãªãã·ã¹ãã ããããŸãã ãããã¯ãZooKeeperã®ããŒã¿ããŒã¹ã§ãã è² è·ãZooKeeperã«éãããå Žåãã¯ã©ãŒã©ã ã¯ã©ã¹ã¿ãŒã¯äœäžãããã®åŸãã¹ãŠãäœäžããŸããã åããããã®ããŒã¿ããŒã¹ã§ã ãã¹ã¿ãŒã«å€§ããªè² è·ãããã£ãŠããå Žåãã»ãšãã©ã®å Žåãã¯ã©ã¹ã¿ãŒå šäœãèœã¡ãŸãã
Dropboxã§ã¯äœãããŸãããïŒ
ããã¯ãã¢ãŒããã¯ãã£ã®é«ã¬ãã«ã®å³ã§ãã 2ã€ã®ãŸãŒã³ãããããããã®éã«éåžžã«ã·ã³ãã«ãªã€ã³ã¿ãŒãã§ã€ã¹ãäœæããŸããã ããã¯å®éã«çœ®ãããååŸãããä¿ç®¡ã®ããã§ãã ãã¹ãŠããã£ãšè€éã«ãããã£ãã®ã§ãç§ãã¡ã«ãšã£ãŠã¯éåžžã«å°é£ã§ããã ãããããŸãŒã³å ã§ã¯ãã¹ãŠãéåžžã«è€éã§ãããZooKeeperãšããŒã¿ããŒã¹ãã¯ã©ãŒã©ã ãååšãããããããã¯éåžžã«éèŠã§ãã ãããŠãããã¯ãã¹ãŠå®æçã«ãäžåºŠã«ãŸã£ããã«èœã¡ãŸãã ãããŠãæ®ãã®ãŸãŒã³ããã£ããã£ããªãããã«ããããã®éã«ãã®ã·ã³ãã«ãªã€ã³ã¿ãŒãã§ãŒã¹ããããŸãã 1ã€ã®ãŸãŒã³ãèœã¡ãå Žåã2çªç®ã®ãŸãŒã³ãæ©èœããå¯èœæ§ãæãé«ããªããŸãã
æäœäžã®çµ¶çžã ã³ãŒããããŸããŸãªãµãŒããŒã«ã©ãã ãããŸãåæ£ãããŠããè«ççã«ã©ã®ããã«åé¢ãããŠããŠããäœãééã£ãããšããã人ãå¿ ãããŸãã ããšãã°ãOdnoklassnikiã«ã¯åé¡ããããŸãããäœããæ©èœããªããã¹ãŠã®Bashã·ã§ã«ãµãŒããŒãããŒã«ã¢ãŠããããã¹ãŠã®ãµãŒããŒãåæãããŸããã ãã®ãããªåé¡ãçºçããŸãã
圌ãã¯ãŸãããã¹ãŠã®ããã°ã©ããŒãšã·ã¹ãã 管çè ããªã©ãã¯ã¹ããããã«ã©ããã«è¡ãã°ãã·ã¹ãã ã¯åœŒããåããšããããã¯ããã«å®å®ããŠåãã ãããšåè«ãèšããŸããã ãããŠãæ¬åœã«ããã§ãã ããªãŒãºæéäžãå€ãã®äŒæ¥ã¯ãã®å¹Žæ«å¹Žå§ã®åã«åçµã®ç·Žç¿ãããŠãããããã·ã¹ãã ã¯ããå®å®ããŠåäœããŸãã
ã¢ã¯ã»ã¹å¶åŸ¡ã ãªãªãŒã¹ããã»ã¹ïŒãããã¯ãã¹ãŠç©æ¥µçã«ãã¹ãããããã®åŸãããšãã°äŒç€Ÿã䜿çšããã¹ããŒãžã³ã°ã§ãã¹ããããŸãã ããã«ã1ã€ã®ãŸãŒã³ã«å€æŽãåæ£ããŸãã ãã¹ãŠãæ£åžžã§ããããšã確èªãããããã«ãä»ã®2ã€ã®ãŸãŒã³ã«é 眮ããŸãã äœããæ£åžžã§ãªãå Žåã¯ããããããããŒã¿ãè€è£œããŸãã ããã¯ãã¹ãŠã¹ãã¬ãŒãžã§ãã 補åãµãŒãã¹ã¯1æ¥ã«1å絶ããæŽæ°ããŠããŸãã
ä¿è·ã ããŒã¿ãä¿è·ããã«ã¯ã©ãããã°ããã§ããïŒ
ããã¯æäœã®æ€èšŒã§ãã ããã¯ããã®ããŒã¿ãå埩ããæ©äŒã§ãã ããã¯ãã¹ãäžã§ãã æäœæ€èšŒãšã¯äœã§ããïŒ
ã·ã¹ãã ã®æ倧ã®ãªã¹ã¯ã¯ãªãã¬ãŒã¿ãŒã§ãã
ç©èªããããŸãã ã¢ããèšç»ã§åããŠããããŒã¬ã¬ããã»ããã«ãã³ã¯ããã¹ãäžã®ããæç¹ã§ãåšã圌女ã®ãšããã«æ¥ãŠã¬ããŒãåããã·ã¹ãã å šäœãæ»ã£ãŠããŸããã ãã®ã¬ããŒã¯ããã®ã¢ããã®ããã²ãŒã·ã§ã³ã·ã¹ãã ãã¯ãªã¢ããŸããã ããã«ãã³ã¯NASAã«ç®ãåãããã®ãããªåé¡ããããšèšã£ãŠã圌女ã¯åŒè·ãç³ãåºãã è¹ãé£ã¶å Žåããã®è¹ã®ããŒã¿ã¯ã¯ãªã¢ãããŸããã ããããNASAã¯ãå®å®é£è¡å£«ã¯å°é家ã§ããã決ããŠãã®ã¬ããŒãåããªããšè¿°ã¹ãŸããã 次ã®é£è¡ã§ãå®å®é£è¡å£«ã®äžäººã誀ã£ãŠãã®ã¬ããŒãåãããã¹ãŠãã¯ãªã¢ãããŸããã åé¡ã®æ確ãªèª¬æãããããã®ããã²ãŒã·ã§ã³ããŒã¿ã埩å ã§ããŸããã
åæ§ã®äŸããããŸãããJSSHãšããããŒã«ããããŸããããã¯ãå€ãã®ãµãŒããŒã§ã³ãã³ããå®è¡ã§ããåæ£ã·ã§ã«ã§ãã
å®éããã®ã³ãã³ãã§ã¯ãåã€ã³ã¹ããŒã«ç¶æ ã®ãµãŒããŒã§memcacheãå®è¡ããå¿ èŠããããŸããã€ãŸãããµãŒããŒã¯åäœããªããªããæŽæ°ããå¿ èŠããããŸãã upgrade.shã¹ã¯ãªãããå®è¡ããå¿ èŠããããŸãã éåžžãããã¯ãã¹ãŠèªåçã«è¡ãããŸãããæåã§è¡ãå¿ èŠãããå ŽåããããŸãã
åé¡ããããŸãããã¹ãŠã®åŒçšç¬Šãå®è¡ããå¿ èŠããããŸããã
ãã¹ãŠåŒçšç¬Šããªãããããã¹ãŠã®memcachã«lifecycle = restartåŒæ°ãèšå®ãããã¹ãŠåèµ·åããŸããã ããã¯ãµãŒãã¹ã«ããŸã圱é¿ããŸããã§ããã ãªãã¬ãŒã¿ãŒã®ããã§ã¯ãããŸãããäœã§ãèµ·ããåŸãŸãã
ç§ãã¡ã¯äœãããŸãããïŒ
ãã®ãããªåé¡ãçºçããªãããã«ãã³ãã³ãæ§æïŒgshïŒãå€æŽããŸããã ã©ã€ããµãŒãã¹ïŒDBãmemcacheãã¹ãã¬ãŒãžïŒã§ç Žå£çãªæäœãå®è¡ããããšã¯çŠæ¢ãããŠããŸãã ã€ãŸããããŒã¿ããŒã¹ãåæ¢ããŠæ¬çªç°å¢ããåé€ããããšãªããmemcacheã䜿çšããŠããŒã¿ããŒã¹ããªããŒãããããšã¯æ±ºããŠãããŸããã ãã®ãããªæäœããã¹ãŠèªååããããšããŠããŸãã
æåŸã«ãã®æäœã«2ã€ã®ã¹ã©ãã·ã¥ãè¿œå ããŸããããã®åŸãã¹ã¯ãªããã瀺ããŸããããã®ãããªå°ããªä¿®æ£ã«ãããå°æ¥ãã®ãããªåé¡ãåé¿ã§ããŸããã
2çªç®ã®äŸã ããã¯SQLAlchemyã§ãã ããã¯ãããŒã¿ããŒã¹ãæäœããããã®Pythonã©ã€ãã©ãªã§ãã ãããŠãæŽæ°ãæ¿å ¥ãåé€ã®ããã«ãwhereclauseãšåŒã°ããåŒæ°ããããŸãã ãã®äžã§ãåé€ããããã®ãæŽæ°ããããã®ãæå®ã§ããŸãã ãã ããwhereclauseã§ã¯ãªããwhereã転éãããšãsqlalchemyã¯äœãèšãããåã«whereãªãã§ãã¹ãŠãåé€ããŸããããã¯éåžžã«å€§ããªåé¡ã§ãã ProxySQLãªã©ãããã€ãã®ãµãŒãã¹ããããŸãã ããã¯MySQLã®ãããã·ã§ãããå€ãã®ç Žå£çãªæäœïŒDROP TABLEãALTERãwhereã®ãªãæŽæ°ãªã©ïŒãçŠæ¢ã§ããŸãã ãŸãããã®ProxySQLã§ã¯ãã¹ããŒãã¯ãšãªã«ãã£ãŠã©ã³ãã ã«ãã¹ã¿ãŒã«ãªããªãããã«ãäžæãªã¯ãšãªã調æŽãããã®æ°ãå¶éã§ããŸãã
å埩ã ããã¯ã¢ãããäœæããã ãã§ãªãããããã®ããã¯ã¢ããã埩å ãããããšã確èªããããšãéåžžã«éèŠã§ãã Facebookã¯æè¿ã圌ãã絶ããããã¯ã¢ãããäœæãããããã®ããã¯ã¢ãããã絶ããå埩ããæ¹æ³ã«ã€ããŠèªãèšäºãæçš¿ããŸããã åºæ¬çã«åããã®ããããŸãã
çæéã®ãªãŒã±ã¹ãã¬ãŒã¿ã®äŸã次ã«ç€ºããŸãã
1ã€ã®ãµãŒããŒã«æ倧32åã®ããŒã¿ããŒã¹ããããããããåžžã«ç§»åããŠãããããããŒã¿ããŒã¹ã¯ããŒã³ãåžžã«äœæããŠããããšãããããŸãã ãããã£ãŠãç§ãã¡ã¯åžžã«ã¯ããŒã³ãäœæããŠããŸãã 絶ããæé²ã¯ãã¹ã¿ãŒãã¹ã¬ãŒããªã©ã«è¡ããŸãã ãŸããèšå€§ãªæ°ã®ããã¯ã¢ããã Amazon S3ã§ãããã¯ã¢ãããè¡ããŸãã ããããç§ãã¡ã¯åžžã«å埩ããŠããŸãã ããã¯ã¢ãããããã¹ãŠã®ããŒã¿ããŒã¹ã埩å ã§ããããšã確èªããªãå Žåãå®éã«ã¯ãã®ããã¯ã¢ããã¯ãããŸããã
ãã¹ãäž
åäœãã¹ããšçµ±åãã¹ããæçšã§ããããšã¯èª°ããç¥ã£ãŠããŸãã ã¢ã¯ã»ã·ããªãã£ã®èŠ³ç¹ããèŠããšããã¹ãã¯MTTRïŒãªã«ããªã®æéïŒã§ãããæ¬è³ªçã«0ã§ãããã®ãã°ã¯æ¬çªã§ã¯ãªããæ¬çªåã«çºèŠãããä¿®æ£ãããããã§ãã å¯çšæ§ã¯æ²ãã£ãŠããŸããã ãããéåžžã«éèŠã§ãã
å¶åŸ¡
誰ããåžžã«å°ç¡ãã«ããŸããããã°ã©ããŒããªãã¬ãŒã¿ãŒã®ã©ã¡ãããäœãééã£ãããšãããŸãã ããã¯åé¡ã§ã¯ãããŸããã ãã¹ãŠãèŠã€ããŠä¿®æ£ã§ããå¿ èŠããããŸãã
ã¹ãã¬ãŒãžã«ã¯èšå€§ãªæ°ã®æ€èšŒè ãããŸãã
ããã«ããããã«ãå®éã«ã¯5ã§ã¯ãªã8ã§ãã ã¹ãã¬ãŒãžã³ãŒã以å€ã«ã確èªã³ãŒãããããŸãã å éšãã©ãã£ãã¯ã®25ïŒ ããããŸã-ããã¯ç¢ºèªã§ãã æäžäœã¬ãã«ã§ã¯ããã£ã¹ã¯ã¹ã¯ã©ããŒãæ©èœããŸããããã¯ãããŒããã©ã€ããããããã¯ãèªã¿åãããã§ãã¯ãµã ããã§ãã¯ããã ãã§ãã ãªããããè¡ãã®ã§ããïŒ ããŒããã©ã€ãã暪ããã£ãŠãããããSMARTã¯æšªããã£ãŠããŸãã ã¡ãŒã«ãŒããããã®ããŒããã©ã€ããè¿ããªããã°ãªããªããããSMARTã«ãšã©ãŒãæ€åºãããããšã¯æçã§ã¯ãããŸããã ãããã£ãŠãããã¯åžžã«ãã§ãã¯ããå¿ èŠããããŸãã ãããŠãåé¡ãèŠã€ãããšããã«ããã®ããŒã¿ã®å埩ãè©Šã¿ãŸãã
ãŽãæ€æ»å®ãããŸãã äœããåé€ã移åããŸãã¯ããŒã¿ãç Žå£ããå ŽåããŸããã®ããŒã¿ãç¹å®ã®ãã¹ã±ããã«å ¥ããŠããããã®ããŒã¿ã確èªããŠæ¬åœã«åé€ãããã©ããã確èªããŸãã ããšãã°ã2é±éä¿ç®¡ãããŸãã åé€ãããããŒã¿ã®ãã®2é±éåã®å®¹éããããŸããããã¯éåžžã«éèŠã§ãããããããã«è²»ãããŸãã ãŸããã¹ãã¬ãŒãžãžã®ãã©ãã£ãã¯ã®äžéšã§ããããããã®æäœã¯Kafkaã«ä¿åãããŸãã 次ã«ãã¹ãã¬ãŒãžã§ãããã®æäœãç¹°ãè¿ããŸãã ãã©ãã¯ããã¯ã¹ãšããŠã®ã¹ãã¬ãŒãžã«ç®ãåããŠãå®éã«å°çãããã©ãã£ãã¯ããŒã¿ãšèšé²ãããŠãããã©ãã£ãã¯ããŒã¿ããããã©ããã確èªããŸãã
ããŒã¿ã1ã€ã®ã¹ãã¬ãŒãžããå¥ã®ã¹ãã¬ãŒãžã«è€è£œãããŠããããšãã€ãŸããããããçžäºã«å¯Ÿå¿ããŠããããšãåžžã«ãã§ãã¯ããŸãã ããŒã¿ã1ã€ã®ã¹ãã¬ãŒãžã«ããå Žåãå¥ã®ã¹ãã¬ãŒãžã«ããå¿ èŠããããŸãã
æ€èšŒè -ããã¯ãé«å質ã§é«å質ã®èä¹ æ§ãå®çŸããå Žåã«éåžžã«éèŠã§ãã
ãŸãããã¹ãããŠããªãæ€èšŒè ã¯ãæ¬è³ªçã«äœãæ€èšŒããªãããšãç¥ã£ãŠããããšãéåžžã«éèŠã§ãã 圌ãã¯æ¬åœã«ããªããæãããšããããšããããšã¯ã§ããŸããã
ãããã£ãŠãçœå®³åŸ©æ§ãã¹ãïŒDRTïŒãå®è¡ããããšã¯éåžžã«éèŠã§ãã ããã¯äœã§ãã ããã¯ãããšãã°ãä»ã®ãµãŒãã¹ãäŸåããå éšãµãŒãã¹ãå®å šã«ç¡å¹ã«ããäœããæ©èœããŠããªããšå€æã§ãããããŸãã¯ãã¹ãŠãæ£åžžã§ãããšå€æã§ããå Žåã§ãã è¿ éã«å¯Ÿå¿ãã修埩ãããã¹ãŠã埩å ããŠãã ããã ããã¯éåžžã«éèŠã§ãããªããªããæ¬çªç°å¢ã§åé¡ããã£ããããããã§ãã çç£ã¯ããã©ãã£ãã¯ããŸã£ããç°ãªããšããç¹ã§ã¹ããŒãžã³ã°ãšã¯ç°ãªããŸãã ç°ãªãã€ã³ãã©ã¹ãã©ã¯ãã£ããããŸãã ããšãã°ãã¹ããŒãžã³ã°ã§ã¯ã1ã€ã®ã©ãã¯ã«è€æ°ã®ãµãŒãã¹ãé 眮ã§ããŸãããWebãµãŒãã¹ãããŒã¿ããŒã¹ãã¹ãã¬ãŒãžãªã©ã®ãµãŒãã¹ã¯ç°ãªããŸãã ãããŠæ¬çªç°å¢ã§ã¯ããŸã£ããç°ãªãå ŽåããããŸãã
ããŒã¿ããŒã¹ã«WebãµãŒãã¹ãå«ãŸããŠãããããæéå ã«ããã¯ã¢ããã§ããªãã£ãããããã®ãããªåé¡ãçºçããŸããã ãããç£èŠããå¿ èŠããããŸãã
ç§ãã¡ã®å€æã蚌æããããšã¯éåžžã«éèŠã§ãã ã€ãŸããäœããèœã¡ãŠãããã埩å ããæ¹æ³ãç¥ã£ãŠãããªãããã®ã¹ã¯ãªãããæžããŸãããäœããèœã¡ããããããæ¬åœã«èµ·ããããšã蚌æããªããã°ãªããŸããã ã³ãŒããå€åããŠãããããã€ã³ãã©ã¹ãã©ã¯ãã£ãå€åããŠããããããã¹ãŠãå€åããå¯èœæ§ããããŸãã 圌ãã¯ç ããªãã®ã§ãããã¯å€åäžã®äººã«ãšã£ãŠããã©ã¹ã§ç©ããã§ãã 圌ãã¯å€ã«ç®ãèŠãŸãã®ã奜ãã§ã¯ãªãã®ã§ãåé¡ãæ±ããŠãããããããŸããã ããã¯äºå®ã§ããå¿çåŠè ã¯ãããç 究ããŸããã
ã¢ãã³ãã³ããäœããã®åé¡ãããããšãç¥ã£ãŠããå Žåã圌ãã¯ããã®æºåãã§ããŠããŸãã 圌ãã¯ãå®éã®åé¡ãçºçããå Žåã®å埩æ¹æ³ãç¥ã£ãŠããŸãã ããã¯æ¬çªç°å¢ã§å®æçã«è¡ãå¿ èŠããããŸãã
èªåå
æãéèŠãªããšã ãµãŒããŒã®æ°ãç·åœ¢ãŸãã¯ææ°é¢æ°çã«å¢å ãããšã人ã®æ°ã¯ç·åœ¢ã«çãŸããŸããã 圌ãã¯çãŸããç 究ããŠããŸãããããçšåºŠã®åšææ§ããããŸãã ãŸãããµãŒããŒã®æ°ã«çžåœãã人æ°ãå¢ããããšã¯ã§ããŸããã
ãããã£ãŠããããã®äººã ã®ããã«äœæ¥ãè¡ãèªååãå¿ èŠã§ãã
èªååãšã¯äœã§ããïŒ
èªååã§ã¯ãã€ã³ãã©ã¹ãã©ã¯ãã£ããã¡ããªãã¯ãåéããããšãéåžžã«éèŠã§ãã ç§ã®ã¬ããŒãã§ã¯ã¡ããªãã¯ã«ã€ããŠã¯äœãèšããŸããã§ãããã¡ããªãã¯ã¯ãµãŒãã¹ã®äžå¿ã§ããããããèšåããå¿ èŠã¯ãããŸãããããã¯ãµãŒãã¹ã®æãéèŠãªéšåã ããã§ãã ã¡ããªãã¯ããªãå ŽåããµãŒãã¹ãæ©èœããŠãããã©ããã¯ããããŸããã ãããã£ãŠãã¡ããªãã¯ãè¿ éã«åéããããšãéåžžã«éèŠã§ãã ããšãã°ãã¡ããªãã¯ã1åã«1ååéãããåé¡ã1å以å ã«ããå Žåããã®ããšã¯ããããŸããã è¿ éã«å¯Ÿå¿ããããšãéåžžã«éèŠã§ãã ããšãã°ã1åãçµéãããªã©ã人ãåå¿ããå Žåãäœããèµ·ãã£ããšãã«ããã°ãã¡ããªãã¯ã«ãã£ããšããäºå®ã«äœãã眮ãããã¢ã©ãŒãã衚瀺ãããŸãã 5åéã®ããªã·ãŒããããŸãã ãã®æç¹ã§ã¢ã©ãŒãã«å¿çããŠãäœããéå§ããå¿ èŠããããŸãã ããªãã¯äœããå§ããç解ãå§ããŸããå®éãåé¡ã«å¿ããŠãããªãã®åé¡ã¯å¹³å10ã15åã§è§£æ±ºãããŸãã ãªãŒãã¡ãŒã·ã§ã³ã䜿çšãããšããã®åé¡ã«åãçµãåã«ãã®åé¡ã«é¢ããæ å ±ãæäŸãããšããæå³ã§ãé«éåããããšã¯ã§ããŸããã解決ããããšã¯ã§ããŸããã
ãã®ãããªNaoruããŒã«ããããŸã-åå·çãªèªååã§ãã
ãªãŒãã¡ãŒã·ã§ã³ã¯ããã€ãã®ã³ã³ããŒãã³ãã§æ§æãããŠããŸãã
ããã€ãã®ã¢ã©ãŒãã§æ§æãããŠããŸãã ãµãŒããŒã«æ¥ç¶ãã䜿çšå¯èœã§ããããšã確èªããåçŽãªPythonã¹ã¯ãªããã«ããããšãã§ããŸãã ããã¯ã䜿çšãããã®ã«é¢ä¿ãªããNagiosãŸãã¯Zabbixããã®ãã®ã§ãã äž»ãªãã®ã¯ããããããã«æ¥ããšããããšã§ãã 次ã«ããããã©ãããããç解ããå¿ èŠãããã蚺æããå¿ èŠããããŸãã ããšãã°ããµãŒããŒãå©çšã§ããªãå ŽåãSSHçµç±ã§æ¥ç¶ãIPMIçµç±ã§æ¥ç¶ãè©Šã¿ãå¿çããªãããããªãŒãºããããäœãä»ã®ãã®ãããã°ãäœããã®æ²»çãåŠæ¹ããå¿ èŠããããŸãã
ããã«ããªãŒãã¡ãŒã·ã§ã³ãäœæãããšãã¯ããã¹ãŠããªãã¬ãŒã¿ãŒãééããå¿ èŠããããŸãã èªååãè¡ããšããããªã·ãŒããããçŽ3ã6ãæã§ãªãã¬ãŒã¿ãŒã«ãã£ãŠè§£æ±ºãããŸãã
åé¡ã«é¢ãããã¹ãŠã®æ å ±ãåéããŸããããã®æ å ±ã¯ãªãã¬ãŒã¿ãŒã«æŒããŸãããã®ãããªãµãŒããŒã¯äœããã®çç±ã§å©çšã§ãããäœãããå¿ èŠããããã瀺ãããªãã¬ãŒã¿ãŒã«ç¢ºèªãæ±ããããŸãã ãªãã¬ãŒã¿ãŒã¯éåžžã«éèŠãªç¥èãæã£ãŠããŸãã 圌ã¯ä»ããµãŒãã¹ã«äœããã®åé¡ãããããšãç¥ã£ãŠããŸãã ããšãã°ã圌ã¯ããã®ãµãŒããŒã§ä»ã®äœããå®è¡ãããŠããããåèµ·åã§ããªãããšãç¥ã£ãŠããŸãã ãããã£ãŠãåçŽã«åèµ·åããããšã¯ã§ããŸããã ãã®ããããªãã¬ãŒã¿ãŒã¯åé¡ã«ééãããã³ã«ããã®èªååã¹ã¯ãªããã«ããã€ãã®æ¹åãå ããæ¹åãããã³ã«æ¹åãè¡ããŸãã
倧ããªåé¡ããããŸããããã¯ãªãã¬ãŒã¿ãŒã®æ inessã§ãã 圌ãã¯èªååãèªååãå§ããŸãã ããã«yesãèªåçã«æ¿å ¥ãããŸãã
ãããã£ãŠããã°ããã®éãyes / noã§ã¯ãªãããã¯ãããããæ¬åœã«æ¬²ããããšæžããŸããã å¥ã®ã¬ãžã¹ã¿ã§ããããå®éã«ã³ã³ãœãŒã«ã§ããããšãã©ã³ãã ã«ãã§ãã¯ããŸããã ããã¯éåžžã«éèŠã§ãã
ããã¯ãæã€ããšãéèŠã§ãã ãã¹ãŠãåžžã«ãã§ãã¯ã§ããããã§ã¯ãªãããã§ãã ããã¯ã¯éåžžã«ç°¡åã§ããããšãã°ãZooKeeperããµãŒããŒäžã§å®è¡ãããŠããå Žåãã°ã«ãŒãã®ãã¹ãŠã®ã¡ã³ããŒãåäœããŠããããšã確èªããå¿ èŠããããŸãïŒãšã©ãŒã®ããã¹ã¯ãªããïŒã
ãããã®ããã¯ã¯ãããŒå šäœã«é 眮ãããã¢ã©ãŒãã®åŸã«èšºæãã©ã°ã€ã³ãªã©ã«ããã¯ããããŸãã ãµãŒãã¹çšã«ç¬èªã®ããã¯ãäœæã§ããŸãã
次ã¯ãåé¡ã®è§£æ±ºçã§ãã
ãšãŠãç°¡åã§ãã ããšãã°ããã®ãµãŒããŒãåèµ·åããŸãã ãããããã·ã§ããªã©ãå®è¡ãã
ãããããªã«ã§ãã ããã¯äºåŸå¯Ÿå¿åã®ä¿®åŸ©ã§ãã ããã«ãããã€ãã³ãã«éåžžã«è¿ éã«å¯Ÿå¿ããéåžžã«è¿ éã«ä¿®åŸ©ããããšãã§ããŸãã
ãªãŒãã³ãœãŒã¹ã®ãœãªã¥ãŒã·ã§ã³ããããŸãã æã人æ°ã®ããã®ã¯ããã·ã¢äººã®StackStormã§ãã 圌ãã«ã¯éåžžã«è¯ã解決çããããéåžžã«äººæ°ããããŸãã ãªãŒãã³ãOpsGenieãªã©ã®ç¬èªã®ãœãªã¥ãŒã·ã§ã³ã§ãããè¡ãããšãã§ããŸãã
ç¬èªã®ãœãªã¥ãŒã·ã§ã³ããããŸãã Facebookããã¯ãããã¯FBARïŒfacebookã®èªå修埩ïŒã§ãã Linkedinã®çè·åž«ã 圌ãã¯éããŠããŸããã圌ãã¯åžžã«ãããã®æ±ºå®ã«ã€ããŠè©±ããŸãã ããšãã°ãFacebookã¯æè¿ãããŒã«å šäœã§ã©ãã¯å šäœã移åããåé¡ã«é¢ããã¬ããŒããäœæããŸããã
ããããèªååã¯ãªã¢ã¯ãã£ãïŒãããšçŸåšïŒã§ããã ãã§ãªããé·æéã«ããã£ãŠå®è¡ããå¿ èŠãããèªååã§ããããŸãã ããšãã°ã1äžå°ã®ãµãŒããŒãæŽæ°ããããããåèµ·åããå¿ èŠããããŸãã ããšãã°ããã©ã€ããŒãã«ãŒãã«ããã®ä»ã®æäœãæŽæ°ããå¿ èŠããããŸãã ããã«ã¯ãæã幎ãªã©ã®é·ãæéããããå ŽåããããŸãã ãªã¢ã¯ãã£ãã·ã¹ãã ã§ã¯ããããåžžã«ç£èŠããããšã¯ã§ããŸããã
ãããã£ãŠããŸã ãã®ãããªWheelhouseã·ã¹ãã ããããŸãã
ä»çµã¿ã®ä»çµã¿ããããŸã ã 次ã«ãäœããããã説æããŸãã
åºæ¬çã«ã1ã€ã®ãã¹ã¿ãŒãæã€ããŒã¿ããŒã¹ã¯ã©ã¹ã¿ãŒããããŸãã Aãš2ã€ã®ã¹ã¬ãŒãããããŸãã ãã®ãã¹ã¿ãŒã眮ãæããå¿ èŠããããŸããããšãã°ãã«ãŒãã«ãæŽæ°ããå¿ èŠããããŸãã ããã眮ãæããã«ã¯ãã¹ã¬ãŒããæŽçãããã®ãã¹ã¿ãŒããããã¢ãŒãããåé€ããå¿ èŠããããŸãã Dropboxã«ã¯èŠä»¶ããããŸãããã®ãããªæ§æã«ã¯ãã¯ã©ã¹ã¿ãŒã«åžžã«2ã€ã®ã¹ã¬ãŒããå¿ èŠã§ãã ãã®ã¯ã©ã¹ã¿ãŒã«ã¯ç¹å®ã®ç¶æ ããããŸãã HostAã¯éçšäžã§ãããã¹ã¿ãŒã§ããããŸã ãªãªãŒã¹ãããŠããŸããã2ã€ã®ã¹ã¬ãŒãããããŸããããã®æäœã«ã¯3ã€å¿ èŠã§ãã
ããããã¹ãŠè¡ãäœããã®ã¹ããŒããã·ã³ããããŸãã
replace_loopïŒéãç¢å°ïŒããããµãŒããŒãéçšäžã§ãããååãªã¹ã¬ãŒãããªãããšãããããå¥ã®ã¹ã¬ãŒããéžæããç¶æ ã«ãªããŸãã ãã®ç¶æ ã«ãªããmaster'a new slaveã§æ°ããã¯ããŒã³ãäœæããäœæ¥ãéå§ããŸãã Orchestratorã®ã©ããã§å§ãŸããŸãããåŸ ã¡ããŠããŸãã äœæ¥ãå®äºãããã¹ãŠãæ£åžžã§ããã°ã次ã®ã¹ãããã«é²ã¿ãŸãã 倱æããå Žåã¯ã倱æç¶æ ã«é²ã¿ãŸãã 次ã«ããã®ãã¹ãã®éçšç°å¢ã«æ°ããã¹ã¬ãŒããè¿œå ããOrchestratorã§ãã®äœæ¥ãéå§ããåŸ æ©ããŠreplace_loopã«æ»ããŸãã
çŸåšã次ã®ãããªãã®ããããŸãã
1ã€ã®ãã¹ãããã¹ã¿ãŒã§ããã3ã€ã®ã¹ã¬ãŒãããããŸãã ååãªã¹ã¬ãŒãããããšããæ¡ä»¶ãæºããã ãã®åŸãããã¢ãŒãç¶æ ã«é²ã¿ãŸãã
ããã¯å®éã«ã¯éæšå¥šã§ãã ãã¹ã¿ãŒãã¹ã¬ãŒãã«ããããçš®ã®ã¹ã¬ãŒããã¹ã¿ãŒã«ããå¿ èŠãããããã§ãã ããã§ã¯ãã¹ãŠåãã§ãã Orchestratorã§ã®äœæ¥ãè¿œå ãããæ¡ä»¶ã確èªããããªã©ãæ®ãã®æé ã¯ã»ãŒåãã§ãã ãã®åŸãå®çšŒåç°å¢ãããã¹ã¿ãŒãåé€ãããã©ãã£ãã¯ãåé€ããŸãã ãã®ãµãŒããŒã«é¢ä¿ãã人ããµãŒããŒäžã®äœããæŽæ°ã§ããããã«ãã€ã³ã¹ããŒã©ãŒã§masterãåé€ããŸãã
ãã®ãããã¯ã¯éåžžã«å°ããã§ãããããè€éãªãããã¯ã«é¢ä¿ããŠããŸãã ããšãã°ãã¹ã€ããã®ãã©ã€ããå€æŽãããŠãããããã©ãã¯å šäœãå¥ã®ã©ãã¯ã«ç§»åããå¿ èŠãããå Žåãã©ãã¯å šäœãåæããŠã¹ã€ããããªããŒãããã ãã§ãã ããŸããŸãªãµãŒãã¹ã®ç¶æ å³ãããããæ¶ãæ¹æ³ãäžããæ¹æ³ã«ã€ããŠå€ã説æããŸããã ããã¯ãã¹ãŠåäœããŸãã æ°åŠçã«ããã·ã¹ãã ãåžžã«çšŒåç¶æ ã«ããããšã蚌æã§ããŸãã ãªãããã·ãŒãžã£ã¢ãŒãã§ã¯ãªãSTMãä»ããŠãããè¡ãããã®ã§ããïŒ ããšãã°ãã¯ããŒã³äœæã«æéããããå Žåãã¯ããŒã³äœæã«ã¯1æéçšåºŠãããããšããããããäœãä»ã®ããšãèµ·ãããã·ã¹ãã ã®ç¶æ ãå€åããŸãã ç¶æ ãã·ã³ã®å Žåãã©ã®ç¶æ ãšããã«ã©ã®ããã«å¿çããããåžžã«ç¥ã£ãŠããŸãã
çŸåšããããä»ã®ãããžã§ã¯ãã§äœ¿çšããŠããŸãã ããŒã¿ã®å¯çšæ§ãšã»ãã¥ãªãã£ãé«ããããã«äœ¿çšã§ãããããã®4ã€ã®æ¹æ³ã ç¹å®ã®ãœãªã¥ãŒã·ã§ã³ã«ã€ããŠã¯è©±ããŸããã§ãããã©ã®å€§äŒæ¥ã§ããææ決å®ã¯å šå¡ãè¡ãããã§ãã ãã¡ãããMySQLã䜿çšããããŒã¿ããŒã¹ãªã©ãããçš®ã®å®å®ãããã¯ã䜿çšããŸããããã®äžã«ã°ã©ãã¹ãã¬ãŒãžãå°ç¡ãã«ããŸããã ã¬ããªã±ãŒã·ã§ã³ã«ã¯ååæã䜿çšããŸããããApache BookKeeperã®ãããªç¬èªã®ã¬ããªã±ãŒã·ã§ã³ããããproxdbã䜿çšããŠããŸãã ããããäžè¬çã«ãç§ãã¡ã¯ãã¹ãŠç¬èªã®ãœãªã¥ãŒã·ã§ã³ãæã£ãŠããã®ã§ããããã¯ããããããªãã®ãã®ã«èŠããªãããããããã«ã€ããŠã¯èšåããŸããã§ããã ãã ãããããã®æ¹æ³ã¯ããªãŒãã³ãœãŒã¹ã®æç¡ã«ããããããã©ã®ãœãªã¥ãŒã·ã§ã³ã§ã䜿çšã§ããŸãã ã¢ã¯ã»ã·ããªãã£ãåäžãããããã
ããã ãã§ããããããšãïŒ