ã¿ãªããããã«ã¡ã¯ïŒ
Amazon Web Servicesã§ãã¡ã€ã«ããã¯ã¢ãããšMySQL / XtraDBãæŽçããçµéšãå
±æããããšæããŸãã ç¹ã«ãã¯ã©ãŠãã«ãããžã§ã¯ããå±éããããã«ã匷å¶ããããŠãããæéãéãããŠããå Žåãæ
å ±ã圹ç«ã€ããšãé¡ã£ãŠããŸã:-)
ãããããŸããAmazonãæäŸããããŒã¿ã¹ãã¬ãŒãžãã¯ãããžãŒã«ã€ããŠç°¡åã«èª¬æããŸãã
ä»®æ³ãã·ã³ã®ããŒã¿ã¯ã©ãã«ãããŸããïŒ
ããã§ã¯ãAmazonãæäŸããä»®æ³ãã·ã³ããŒã¿ã®ä¿åããå§ããŸããã-ä»®æ³
EBSãããã¯ããã€ã¹ã ãã®ãããªãã£ã¹ã¯ã¯ç°¡åã«äœæããã2åã®ã¯ãªãã¯ã§ãµãŒããŒã«æ¥ç¶ãããŸãã æ倧ãã£ã¹ã¯ãµã€ãºã¯1TBã§ãã ããã©ã«ãã§ã¯ã5000ãã©ã€ããš20TBã«å¶éããããŸãã
ãæåã®ãªã¯ãšã¹ãã§å¢å
ããŸãã
ããŒã«ã«ãããã¯ããã€ã¹ã®æè¡ãææ¡ãããŠããããã®ããŒã¿ã¯...ãµãŒããŒãšå
±ã«æ¶ããŸãïŒãã·ã³ãã¯ã©ãã·ã¥ãããšç°¡åã«çºçããŸãïŒ-ããããç§ã¯ããã«ã€ããŠã¯æžããŸããã ç§ãã¡ã¯ãããå®éšããŸããã§ããã
EBSããã©ãŒãã³ã¹
éãããé
ãããšãããã«ããããŸãã ããã€ã¹ã®é£œåç¶æ
ïŒïŒ
utilãiostatã³ãã³ãïŒã§ãã©ã³ãã ãªèªã¿åãããªã¥ãŒã ã1ããŒã¹ãŸãã¯2 MB / sïŒæžã蟌ã¿ã§ããã«å°ãªãïŒã«ãªããšãããã«100ïŒ
ã«è¿ã¥ããŸãã ãã¬ãŒãã¯ããã©ã«ãããã£ã¹ã¯ãããã£ã¹ã¯ã«ã³ããŒãããã¢ãŒã«ã€ããå±éãããªã©ã®äžè¬çãªæäœã§æ確ã«è¡šç€ºãããŸãã éšåãšãã³ãããŒã¯ã¯ãªã³ã©ã€ã³ã§ç°¡åã«èŠã€ããããšãã§ããŸãã
襲æïŒ
Amazonãã£ã¹ã¯ã®æäœãé©åã«éå§ããããã®æãç°¡åãªæ¹æ³ã¯ããã£ã¹ã¯ããœãããŠã§ã¢RAIDã«ã移åãããããšã§ãã ããŒã¿ããŒã¹ã®å Žåãext4ãšxfsã®äž¡æ¹ã®8ã€ã®EBSãã£ã¹ã¯ã§raid-10ã䜿çšããŸãã ãœãããŠã§ã¢ã®è¥²æ
ã¯éåžžã«ç°¡åã«è¡ãããé·æéã«ããã£ãŠæ©èœããå®éã«ã¯å£ããŸããã
空襲ã¯ãEBSãã©ã€ããçªç¶ã¯ã©ãã·ã¥ããå Žåã«ç¹ã«åœ¹ç«ã¡ãŸãã
ããã§ããäžéšã®ã¿ã¹ã¯ã§ã¯RAIDã䜿çšããŸãããããšãã°ãMySQLãã€ããªãã°ã®ä¿åãããã¯ã¢ãããªã©ã«äœ¿çšããŸãããŸããnginxãã£ãã·ã¥ã®ä¿åã«ã¯ãEBSãã£ã¹ã¯ã®raid0ãæ£åžžã«æ©èœããŸããã
EBSãã©ã€ãã®ä¿¡é Œæ§
æ£çŽã«èšããšãAmazon EBSãã£ã¹ã¯ã§ã®äœæ¥ã®1幎åã¯ãèœèããããšã¯ãããŸããã§ããïŒãæªãããèªã¿åããšã©ãŒãªã©ã®æããªããšã¯ãããŸããïŒ...é·ãAmazonã®ã¢ã€ã«ã©ã³ãã®ããŒã¿ã»ã³ã¿ãŒã«åœãã£ãå Žåãé€ããŠ-ãã®åŸãè€æ°ã®ãã£ã¹ã¯ãäžåºŠã«é£ã³ãŸããraid-10ãã:-)
ãã ããAmazonããã£ã¹ã¯ã®ä¿¡é Œæ§ã«ã€ããŠæžããŠããããšã泚ææ·±ãèªãã å ŽåãRAIDãšãã¡ããå®æçãªããã¯ã¢ãããè¡ãå¿
èŠãããããšãç解ã§ããŸãã
Amazon EBSããªã¥ãŒã ããŒã¿ã¯ã1ã€ã®ã³ã³ããŒãã³ãã®é害ã«ããããŒã¿ã®æ倱ãé²ãããã«ãã¢ãã€ã©ããªãã£ãŒãŸãŒã³ã®è€æ°ã®ãµãŒããŒã«è€è£œãããŸãã ããªã¥ãŒã ã®èä¹
æ§ã¯ãããªã¥ãŒã ã®ãµã€ãºãšãæåŸã®ã¹ãããã·ã§ãã以éã«å€æŽãããããŒã¿ã®å²åã®äž¡æ¹ã«äŸåããŸãã äŸãšããŠãææ°ã®Amazon EBSã¹ãããã·ã§ãã以éã«å€æŽãããããŒã¿ã20 GB以äžã§åäœããããªã¥ãŒã ã¯ã0.1ïŒ
ãã0.5ïŒ
ã®å¹Žéæ
éçïŒAFRïŒãäºæž¬ã§ããŸããæ
éãšã¯ãããªã¥ãŒã ã®å®å
šãªæ倱ãæããŸãã ããã¯ãäžè¬ã«çŽ4ïŒ
ã®AFRã§æ
éããåžè²©ã®ããŒããã£ã¹ã¯ãšæ¯èŒããŠãEBSããªã¥ãŒã ã®ä¿¡é Œæ§ãäžè¬çãªåžè²©ã®ãã£ã¹ã¯ãã©ã€ãã®10åã«ããŸããäžæ¹ã100ãè¶
ããEBSãã£ã¹ã¯ãå®çšŒåç°å¢ã«ããã1幎åã§IOã®ãšã©ãŒãåå ã§ãœãããŠã§ã¢ã®è¥²æããã£ã¹ã¯ãããã¯ã¢ãŠãããããšã¯ãããŸããã ãéããã£ã¹ã¯äžã®è€æ°ã®ããã€ã¹ãå€æŽããã¯ããªã®ã§ãçµè«ãå°ããŸãã
å©çšå¯èœãªããã¯ã¢ããæè¡
ããŒã¿ãæ¯èŒçå°ãããé »ç¹ã«å€æŽãããªãå Žåã¯ãtarããããããšãã§ããŸãã ããããããŒã¿ããŒã¹ãšãã£ã¹ã¯äžã®ãã¡ã€ã«ã®äž¡æ¹ã«ããžãã¹æ
å ±ãä¿åãã倧èŠæš¡ãªãªã³ã©ã€ã³ã¹ãã¢ãæ³åããŠãã ãããæ°ãããã¡ã€ã«ãæ¯å衚瀺ãããã³ã³ãã³ãã®åèšãµã€ãºã¯æ°çŸã®ã¬ãã€ãã§ãã
DRBDïŒ ã¯ããããã圌ãã¯Amazonã§ãã®ãã¯ãããžãŒãè©Šããããšã¯ãããŸããããšã©ãŒãçºçãããšãã®é©ç°çãªãã¬ãŒãã³ã°ã«ã€ããŠååããããè³ã«ããŸãã
copy-on-writeã¢ãŒãã®
LVMãšã¹ãããã·ã§ããã¯ããã®ãã¯ãããžãŒã«äŒŒãŠããŸãããè¿œå ã®ç¹å
žããããAmazonãæäŸããŸãã ãããã¯ããã€ã¹ã®
ã¹ãããã·ã§ããã¯ãå¿
èŠãªåæ°ã ãå®è¡ã§ããŸãã ãã®å ŽåïŒ
- å€æŽã®ã¿ãEBSãã£ã¹ã¯ã®æ¬¡ã®ã¹ãããã·ã§ããã«å
¥ããŸãã ããã«ãããã¯å®å
šã«ééçã§ããããã£ã¹ã¯å®¹éã®äœ¿çšã«é¢ããæ¯æã®è«æ±æžãèŠããšæããã«ãªããŸãã 500GBã®ãã£ã¹ã¯ãã100æã®ã¹ãããã·ã§ãããååŸããŠããããŒã¿ãé »ç¹ã«å€æŽãããããšã¯ãããŸãããçŽ600ã800GBãæ¯æãã®ã§ããã¡ããã¯ã©ã€ã¢ã³ãã«æå©ã«ãªããŸãã
- ã¹ãããã·ã§ãããåé€ã§ããŸã-ããã¯ã¢ãããŠã£ã³ããŠã®ãµã€ãºãšããŒã¿ã¹ãã¬ãŒãžã®ã³ã¹ãã®ãã©ã³ã¹ãç¶æããããã«ã ãã®å Žåãåã³ãçããŸãããä»»æã®ã¹ãããã·ã§ãããåé€ã§ããŸã-Amazonã¯æ£ããæ¹æ³ã§ããŒã¿ãèªåçã«çµ±åããŸãã ãããŠãããã¯ãããã¯ã«é¢ããç§ã®é ãçããŸãã-ã©ãã§åºæ¬çãªã¹ãããã·ã§ããã§ãããã©ãã§å¢åã¹ãããã·ã§ããã§ã-ããã¯éèŠã§ã¯ãããŸãããããªãã¯ä»»æã®äœçœ®ããäœåãªãã®ãåé€ããŸãïŒAcronisã§åãã人ã¯å©äŸ¿æ§ãé«ãè©äŸ¡ããŸãïŒã
- ãã£ã¹ã¯ã®ã¹ãããã·ã§ããã¯S3ã«ä¿åãããŸãã S3-ãããã誰ããæ¢ã«ç¥ã£ãŠããããã«ãããã¯å°ãªããšã2ã€ã®ããŒã¿ã»ã³ã¿ãŒã«ããŒã¿ãè€è£œããä»»æã®åœ¢åŒã®ãªããžã§ã¯ãã®ãªããžããªã§ãã ã€ãŸã ãã£ã¹ã¯ã®ã¹ãããã·ã§ããã¯å®è³ªçã«ãç Žå£äžå¯èœãã«ãªãããã¹ã¯ãããã®äžã®ããã¯ããããã€ãã¹ã¿ã³ãã«ããŒããã©ã€ãããã確å®ã«ä¿åãããŸã:-)ã
- ãã£ã¹ã¯ã®ã¹ãããã·ã§ããã¯ã»ãŒç¬æã«å®è¡ãããŸã-ãã®åŸãããã¯ã°ã©ãŠã³ãã§ãããŒã¿ãäžå®æéïŒAmazonãããŒããããŠããå Žåã¯æ°ååïŒS3ã«è»¢éãããŸãã
ã€ãŸãããã£ã¹ã¯äžã®é »ç¹ã«å€æŽãããã³ã³ãã³ãã®å·šå€§ãªãã©ã«ããŒã®ã¹ãããã·ã§ãããå°ãªããšã5åã«1åååŸã§ããããšãæå³ããŸã-ãããã¯S3ã«å®å
šã«ä¿åããã5ååã«1 TBã®å¯å€ããŒã¿ãããŒã«ããã¯ããå¿
èŠãããå Žå-ãããç°¡åã«è¡ãããšãã§ããŸãïŒ
- ä¿åãããã¹ãããã·ã§ãããããã£ã¹ã¯ãäœæããŸã ã
- ãã£ã¹ã¯ããµãŒããŒã«æ¥ç¶ããŸãã
ãã¡ãããS3ããEBSãã£ã¹ã¯ãååšããSANã«1TBã®ããŒã¿ãå³åº§ã«è»¢éããããšã¯æè¡çã«äžå¯èœã§ãããã®ããããããã¯ããã€ã¹ã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã§å©çšå¯èœã«ãªããŸãããããŒã¿ã¯äžå®æéããã¯ã°ã©ãŠã³ãã§ããŒã¿ã«æµãããŸãããããã£ãŠãæåã«ãã£ã¹ã¯ãæäœããé床ã¯ããã»ã©é«ããããŸããã ããããããã§ãã倧éã®ããŒã¿ã®å¢åããã¯ã¢ãããäœæããŠãããšãã°1é±éåã«5åééã§ä»»æã®ãã€ã³ãã«ããŒã«ããã¯ããã®ãããã«äŸ¿å©ããåæããå¿
èŠããããŸããïŒ :-)
EBSãã©ã€ãããã¹ãããã·ã§ãããäœæããæ©èœã«å ããŠãS3ã«ãã¡ã€ã«ãçŽæ¥éä¿¡ã§ããŸãã
s3cmdãŠãŒãã£ãªãã£ã䜿çšãããšäŸ¿å©ã§ãããã¡ã€ã«ã·ã¹ãã ããªãŒãã¯ã©ãŠããšåæ¹åã«åæã§ããŸãïŒããŒã«ã«ãã£ã¹ã¯äžã®md5ã®èšç®ãšãETagãã®s3å
ã®md5ãªããžã§ã¯ãã®ã¹ãã¬ãŒãžã«åºã¥ããŠå€æŽã®ã¿ã転éãããŸãïŒã
FUSE -
s3fsãã¯ãããžãŒã«åºã¥ãããœãªã¥ãŒã·ã§ã³ãè©ŠããŸããããéäžçãªäœ¿çšäžã«LAãå¢å ãã
é床ã®äœäžãšé·æçãªããªãŒãºã«æ°ã¥ããŸããã
ã¹ãããã·ã§ããã¬ã€ã
äžã§æžããããã«ãEBSãã£ã¹ã¯ã¯raid0ãraid10ã«çµåãããå Žåã«ååãªããã©ãŒãã³ã¹ã瀺ããŸãã RAIDãããã¯ã¢ããããæ¹æ³ã¯ïŒ åãã£ã¹ã¯ã®ã¹ãããã·ã§ããã¯é çªã«å®è¡ãããŸããïŒ :-)ããã¯äžå¯èœã§ãããã¢ããŸã³ã¯ç§ãã¡ã«äœãæäŸããªãããšãç解ããŠããŸãã
åè¯ãªäººã
ã¯äŸ¿å©ãªãŠãŒãã£ãªãã£
-ec2-consistent-snapshotãæžããŸããã ããã䜿çšããããã¹ã¯ãªããã§ãã®ããžãã¯ãç¹°ãè¿ãããšãã§ããŸãã
- ãããªãŒãºãããµããŒããããã¡ã€ã«ã·ã¹ãã ã䜿çšããŠããŸãã 圌女ã¯çŸåšããããã¯ããã€ã¹ã¬ãã«ã§ã¹ãããã·ã§ãããåã£ãŠããããšã«æ°ä»ãããããã¡ããã©ãã·ã¥ãããã©ã³ã¶ã¯ã·ã§ã³ãã³ããããããããã¯ã®å€æŽãäžæçã«åæ¢ããå¿
èŠããããŸãã æè¿ãŸã§ãXFSã¯ãã®ã³ãã³ãïŒ xfs_freeze ïŒãç解ããŠããŸãããã ãææ°ã®ãLinuxãã£ã¹ããªãã¥ãŒã·ã§ã³ã§ã¯ãä»ã®äžè¬çãªãã¡ã€ã«ã·ã¹ãã ãext3 / ext4ãxfsãjfsãreiserfsã ã ãããªãŒãºã ã§ããŸãã ã
- å€æŽãç Žæ£ããFSãžã®æžã蟌ã¿ãäžæçã«çŠæ¢ããŸãïŒâ fsfreeze -f mountpointâ
- åRAIDãã£ã¹ã¯ã®ã¹ãããã·ã§ããã®äœæïŒAWS APIåŒã³åºãCreateSnapshot ã
- FSãšã³ããªãèš±å¯ããïŒãfsfreeze -u mountpointã
xfsãããå Žåã¯ã
xfs_freezeã³ãã³ãã䜿çšã§ããŸãã
ä¿åããRAIDãæ¥ç¶ããã«
ã¯ããã£ã¹ã¯ããã·ã³ã«
æ¥ç¶ãããããããœãããŠã§ã¢RAIDãèµ·åããã¹ã¯ãªãããäœæããããšããå§ãããŸãã äžèšã®æ¹æ³ã§ã¹ãããã·ã§ããã«ä¿åãããRAIDã¯ããã¡ã€ã«ã·ã¹ãã ãã°ã倱ãããšãªãçŸããäžæããŸããæ¬çªç°å¢ã®ããŸããŸãªå Žæã§äœ¿çšããŸãã
ãã®ãããå°ãªããšã5åã«1åã®é »åºŠã§ä»»æã®éã®ããŒã¿ã䜿çšããŠs3ã§RAIDã®ã¹ãããã·ã§ãããäœæãããããããããŒã¿ãå埩ããæ¹æ³ãåŠã³ãŸããã ãããã®ããšã®å€ãã¯ãã¯ã©ãŠãå
ã®ããŸããŸãªãããžã§ã¯ãã«åœ¹ç«ã€ãšç¢ºä¿¡ããŠããŸãã
ãã·ã³å
šäœã®ã¹ãããã·ã§ãã
åã¬ã€ãã§å¥ã
ã«å
¥æµŽããã®ã§ã¯ãªãã
1ã€ã®ã³ãã³ãã§ãã·ã³ã®ãã¹ãŠã®ãã©ã€ãã®ã¹ãããã·ã§ãããäœæããæ¹ã䟿å©ãªå ŽåããããŸãã ã¹ãããã·ã§ããã¯2ã€ã®ã¢ãŒãã§äœæã§ããŸããè»ã®åæ¢ãããšåæ¢ãªãã§ãã åŸè
ã®å Žåããã£ã¹ã¯/ã¬ã€ãäžã®ããŒã¿ã®ãç Žæãã®å¯èœæ§ã«ã€ããŠè«ççã«èŠåãããŸãã
ãã¡ã€ã«ã·ã¹ãã ã®ã¹ãããã·ã§ãããæ®ããšãã¯ãæåã«ã¢ã³ããŠã³ãããããšããå§ãããŸãã ããã«ããããã¡ã€ã«ã·ã¹ãã ã®ã¡ã¿ããŒã¿ãäžè²«ããç¶æ
ã«ãªãããããŠã³ããããã€ã³ãžã±ãŒã¿ããã¯ãªã¢ããããã®ãã¡ã€ã«ã·ã¹ãã ã䜿çšãããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ãåæ¢ããäžè²«ããç¶æ
ã«ãªããŸãã xfsãªã©ã®äžéšã®ãã¡ã€ã«ã·ã¹ãã ã¯ãã¢ã¯ãã£ããã£ãããªãŒãºããã³ããªãŒãºè§£é€ã§ãããããããŠã³ã解é€ããã«ã¹ãããã·ã§ãããäœæã§ããŸãããã·ã³ã®ã¹ãããã·ã§ãããäœæããåŸãAMIïŒAmazon Machine ImageïŒãªããžã§ã¯ãã衚瀺ãããåãã©ã€ãã®ä¿åãããã¹ãããã·ã§ãããžã®ãªã³ã¯ããããŸãã 1ã€ã®ã³ãã³ã
-AWS APIåŒã³åºã
RunInstancesã䜿çšããŠããã®ãªããžã§ã¯ãããã®ãã¹ãŠã®ãã£ã¹ã¯/
RAIDã§ãµãŒããŒãå®è¡ã§ããŸãã ãã¯ãããžãŒã®åãæããŸãããïŒ çšŒåäžã®ãµãŒããŒã¯ãå
šäœãããã¯ã¢ããã§ããã ãã§ãªãã1ã€ã®ããŒã ã§ãã¹ãŠã®RAIDã䜿çšããŠãããã¯ã¢ããã®åèšãã解é€ããããšãã§ããŸãã ãã®ãã¯ãããžãŒã«ãããæšå¹Ž8æã«Amazonã§äºæ
ãçºçããå Žåãæ°åæéã®ã·ã¹ãã 管çãäžèŠã«ãªããŸãããã¹ãããã·ã§ãããããã·ã³ãåãåºããå¥ã®ããŒã¿ã»ã³ã¿ãŒã«æ§æãå±éããŸããã
ãã ããé倧ãªèœãšãç©ŽããããŸã-CreateImageã³ãã³ãã¯å®å
šã«äžéæã§ããã¹ãŠã®ãµãŒããŒãã£ã¹ã¯ããã¹ãããã·ã§ãããååŸããã®ã«1ç§ãŸãã¯10ç§ããããŸããïŒ ç§åŠççªæã®æ¹æ³ã¯ã5ç§ééã§éžæãããã¬ã€ãã§ãã·ã³ã®å®å
šãªç»åãæ®åœ±ã§ããŸãã èŠå-éçšãéå§ããåã«ã¹ã¯ãªããã培åºçã«ãã¹ãããŸã-ãã ãããã·ã³ã®å®å
šããã¯ã¢ãããäœæããæè¡ã®ãå©ç¹ãã®åã«ãæµæããã®ã¯é£ããããšãèªããªããã°ãªããŸãã:-)
MySQLã®å¢åããã¯ã¢ãã
ç§ãã¡ã®ã¿ã¹ã¯ãæãåºãããŠãã ãã-1æ¥ãããæ°çŸäžãããã®ãã©ãã£ãã¯ãšéåžžã«é »ç¹ã«å€åããæ°çŸã®ã¬ãã€ãã®ã³ã³ãã³ãã§ãããžã§ã¯ããããã¯ã¢ããããŸãïŒæãéãã³ã³ãã³ãã¯s3ã«ç§»åãããåå¥ã«ããŠã³ããŒããããŸãïŒã MySQLã®ããã¯ã¢ããã«å¯ŸããŠãããç¥ãããŠããåççãªã¢ãããŒããç¹°ãè¿ããŸãã
- ã¹ã¬ãŒãã䜿çšããè«çããã¯ã¢ããã ãã®å Žåãã¡ã€ã³ãµãŒããŒã®åäœãé
ãããŸãããããåæããŠããªããããŒã¿ãããã¯ã¢ãããããªã¹ã¯ããããŸãïŒãã®ãããããšãã°pt-table-checksumã䜿çšããŠåæãç£èŠããå¿
èŠããããŸã ïŒã
- æŠéãµãŒããŒ/ã¹ã¬ãŒãããLVMã䜿çšãããã€ããªã¹ãããã·ã§ããããŸãã¯-ãããã¯ãããã¯ã¢ãããã·ã³ã®DRBDãã£ã¹ã¯ã«ã³ããŒããŸãã
- xtrabackupãŸãã¯åæ§ã®ææããŒã«ã䜿çšããæŠéãµãŒããŒãŸãã¯ã¹ã¬ãŒãããã®å¢åãã€ããªããã¯ã¢ããã
ããŒã¿ããŒã¹ã®ããŒã¿ãå£æ»
çã«åé€ãããå Žåã«ã5ã10ååã«å€§èŠæš¡ãªãªã³ã©ã€ã³ã¹ãã¢ããã°ããããŒã«ããã¯ã§ããããã«ããããã«ïŒè€æ°ã®æ³šæããŒãã«ã®ããŒã¿ãåé€ãã誀ã£ãèŠæ±-ä»ã«èª°ãããªãã£ãã®ã§ããããïŒ:-)ïŒ-3ã€ã®ãªãã·ã§ã³ã®ã¿ãæ©èœããããã§ãã ãã ããå€æããããã«ãäœææã®ãã€ããªã€ã³ã¯ãªã¡ã³ã¿ã«ããã¯ã¢ããã¯ããã§ã«åŒ±ãEBSãã£ã¹ã¯ã«ããªãã®è² è·ããããŸããããªã«ããªäžã«åºæ¬çãªãã€ããªããã¯ã¢ããã埩å
ããã®ã«æ°æéãããããšããããŸã...æ°æéïŒ
ããã§ã¯ãMySQLãã€ããªãã°ã®äºåç·šéã䌎ãè«çããã¯ã¢ããããã®åŸ©æ§ã·ããªãªãèæ
®ããŠããŸããããããè¡ãã®ã¯ãŸã é«éã§ã¯ãããŸããã
ããã§ããAmazonã圹ç«ã¡ãŸãã MySQLã®å¢åããã¯ã¢ããã¯æ¬¡ã®ããã«è¡ãããŸãã
- MySQL / InnoDB / XtraDBãããã¡ãŒããã£ã¹ã¯ã«ãã©ãã·ã¥ããïŒããã©ãã·ã¥ããã¯ããŒãã«ãšèªã¿åãããã¯ã
- å€æŽãç Žæ£ããFSãžã®æžã蟌ã¿ãäžæçã«çŠæ¢ããŸãïŒâ fsfreeze -f mountpointâ
- ãã·ã³ã®ãã¹ãŠã®ãã£ã¹ã¯ã®ã¹ãããã·ã§ãããäœæããŸãïŒ CreateImage ã èœãšãç©Žã«ã€ããŠã¯äžèšãåç
§ããŠãã ããã æžå¿µãããå Žåã¯ãããŒã¿ããŒã¹ããåRAIDãã£ã¹ã¯ã®ã¹ãããã·ã§ãããäœæããŸããAWSAPIã¯CreateSnapshotãåŒã³åºããŸãã
- FSãšã³ããªãèš±å¯ããïŒãfsfreeze -u mountpointã
- ãã¹ãŠã®ããŒã¿ããŒã¹ã®ãã¹ãŠã®ããŒãã«ã®ã°ããŒãã«ããã¯ãUNLOCK TABLESããåé€ããŸãã
ããã§ããããMySQLããã¯ã¢ãããåããAMIãªããžã§ã¯ããäœæãããããã¯ã¢ããããå¯èœãªéãè¿
éã«èµ·åã§ããããã«æ倧éã«ãªããŸããã
ãããã£ãŠãå°ãªããšã5åã«1åã®é »åºŠã§S3ã®MySQLãµãŒããŒã®å¢åããã¯ã¢ãããäœæããã ãã§å¿«é©ã§ããããšãããããŸããã ãµãŒããŒãã¬ããªã±ãŒã·ã§ã³ã§äœ¿çšããå Žåãèšå®ã§ä¿å®çãªã¬ããªã±ãŒã·ã§ã³èšå®ãå¿ããŠããªãå ŽåãååãšããŠåé¡ãªããµãŒããŒã埩å
ããŸãïŒãŸãããŸãã¯ããã«æåã§äœæ¥ã«æ»ãããšãã§ããŸãïŒïŒ
sync_binlog = 1
innodb_flush_log_at_trx_commit = 1
sync_master_info = 1
sync_relay_log = 1
sync_relay_log_info = 1
Amazonã§ã¢ã¯ã·ã§ã³ãã¹ã¯ãªããåããæ¹æ³ã¯ïŒ
ã·ã¹ãã 管çè
ã«ã¯ãAmazon RESTã¡ãœããããã«ãã
䟿å©ãªãŠãŒãã£ãªãã£ããããŸãã 䜿çšããWebãµãŒãã¹ããšã«ããã€ãã®ãŠãŒãã£ãªãã£ãããŠã³ããŒãããããŠãŒãã£ãªãã£ãžã®åŒã³åºãã¯bashã§ã¹ã¯ãªããåãããŸãã ãµãŒããŒäžã®ããŒããŠã§ã¢ãå€æŽããã¹ã¯ãªããã®äŸã次ã«ç€ºããŸãã
éçºè
åãã«ã¯ãAmazon APIãæäœããããã®ããŸããŸãªèšèªã®ã©ã€ãã©ãªããããŸãã PHP-
AWS SDK for PHPããäœæ¥ããããã®ã©ã€ãã©ãªã次ã«ç€ºã
ãŸã ã
ã芧ã®ãšãããAmazonãªããžã§ã¯ãã䜿çšããã¹ã¯ãªããäœæäœæ¥ã¯ç°¡åã§ãã
PS
ããã§ãããžã§ã¯ãã®ã¢ãŒããã¯ãã£ã確èªã
ãŸã ã ããã¯ã¢ããã«å ããŠãåçŽãªã¯ã©ã¹ã¿ãŒèªåã¹ã±ãŒãªã³ã°æè¡ãšããŒã¿ã»ã³ã¿ãŒéã®ãã©ãã£ãã¯åãæ¿ãã«ã€ããŠæžã䟡å€ããããšæããŸãã 5æ22æ¥ã«ã1CäŒæ¥ã®äŒè°å®€ã§éå¬ãããWebã¯ã©ã¹ã¿ãŒãšé«è² è·ã«é¢ãã
ç¡æã»ãããŒãéå¬ããŸãã
ç§ã¯ãããé¢çœãããšãé¡ã£ãŠããŸããæ¥ãŠ:-)