[東京]Cloud_Automatorで攻めのシステム運用 AMIMOTO スタック編

[東京]Cloud_Automatorで攻めのシステム運用 AMIMOTO スタック編

Bdaf0b291f02fe64a02cdf592a8a0c8f?s=128

AMIMOTO

May 13, 2016
Tweet

Transcript

  1. AWSͷӡ༻ࣗಈԽαʔϏε Cloud Automator Ͱ"߈Ί"ͷγεςϜӡ༻ AMIMOTOฤ @Amimoto_Ami amimoto-ami.com AMIMOTOͷαʔϏεઃܭࢥ૝ͱͦͷࠜఈʹ͋Δ૝͍

  2. WordPressϢʔβʔͷ໨త͸ίϯςϯπͷެ։ ͦΕҎ্Ͱ΋ҎԼͰ΋ͳ͍ʂ

  3. ֓ཁ AMIMOTOΛར༻͢Ε͹AWS্ʹ਺ΫϦοΫͰߴ଎ʹνϡʔχϯά͞Εͨ
 WordPressαΠτ͕Ͱ͖͕͋Γ·͢ɻ ͔͠͠ɺͦΕ͸AMIMOTOΛར༻͢ΔϝϦοτͷණࢁͷҰ֯Ͱ͔͋͠Γ·ͤΜɻ AMIMOTOΛར༻͢ΔਅͷՁ஋͸ɺʮϏδωε΁ͷूதͰ͖Δ͜ͱʯʹ͋Γ·͢ɻ ࢲͨͪAMIMOTO։ൃTeam͸ɺৗʹͦΕ͚ͩΛߟ͑ͯαʔϏεͷઃܭΛߦͬͯ·͢ɻ

  4. AMIMOTOΛࢧ͑Δٕज़ج൫ͱαʔϏε 1. Automation → పఈతʹࣗಈԽ 2. Cloud Native → ϚωʔδυαʔϏεΛϑϧ׆༻

    3. MicroServices → ૄ݁߹ͳػೳ࣮૷ ͜ΕΒʹΑͬͯɺ୭΋͕؆୯ʹಉ͡඼࣭ͷ؀ڥ΍αʔϏεͰΛ։ൃɺӡ༻؅ཧΛՄೳʹ͢ Δ͜ͱͰʮϏδωε΁ूதʯ͕Ͱ͖Δ؀ڥͮ͘ΓΛࢧԉͰ͖ΔϓϥοτϑΥʔϜΛఏڙ͠ ͍ͯ·͢ɻ
  5. ໰୊ͱ՝୊ 1.AWSͷεέʔϥϏϦςΟΛ࠷େݶʹൃشͰ͖ͳ͍ɻWordPressͷਂ͍ҋɻ 2.ංେԽ͠ଓ͚ΔσʔλϕʔεͱେྔͷPluginʹΑΔີ݁߹Խɻϝϯςφϯεෆೳঢ়ଶɻ

  6. ղܾखஈͱํ๏ 1.JIN-KEI CloudfFormation ʹΑΔ (Infrastructure as Code with WordPress) 2.MicroServices

    ߏ੒ / Server-less Architecture ʹΑΔ Ϟμϯͳ։ൃΞϓϩʔν
  7. Session1

  8. WordPress with Infrastructure as Code @Amimoto_Ami ja.amimoto-ami.com

  9. ͱΓ͋͑ͣϓϥάΠϯ WordPress + ύϑΥʔϚϯε ਓྗͰαʔόΛνϡʔχϯά ਓྗͰΞϓϦΛνϡʔχϯά

  10. ʊਓਓਓਓਓਓਓʊ ʼɹAWSؔ܎ͳ͍ɹʻ ʉY^Y^Y^Y^Y^Yʉ

  11. ໰୊఺ ͦΜͳʹGoogle͕ා͍͔ʁ ݁ہEC2 AWSͷαʔϏε࢖͑ͯͳ͍ ਓྗཔΓ͸ҋΛੜΉ

  12. Let’s ࣗಈԽ

  13. AutoScaling WordPress + ࣗಈԽ ϚωʔδυαʔϏεͷ׆༻ CloudFormationͰႈ౳Խ

  14. AutoScaling WordPress + ࣗಈԽ ϚωʔδυαʔϏεͷ׆༻ CloudFormationͰႈ౳Խ

  15. 8PSE1SFTTͰ΋ϚωʔδυαʔϏε͸࢖͑Δ w "NB[PO3%4 w "NB[PO4 w "NB[PO$MPVE'SPOU w "NB[PO$FSUJpDBUJPO.BOBHFS w

    FUDʜ Managed Services 6TF.BOHFE4FSWJDF
  16. ෺ཧ૚ 04 ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ ෺ཧ૚ 04 ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ ੹೚ڥք ੹೚ڥք

    EC2ͷ৔߹ ϚωʔδυαʔϏεͷ৔߹
  17. ϚωʔδυαʔϏεͰ ʮϝϯς͕ඞཁͳྖҬʯΛ ۃྗݮΒ͢ Managed Services 6TF.BOHFE4FSWJDF

  18. AutoScaling WordPress + ࣗಈԽ ϚωʔδυαʔϏεͷ׆༻ CloudFormationͰႈ౳Խ

  19. ϚωʔδυαʔϏεΛ࢖ͬͯ΋ɺ ߏங͕ෳࡶԽͯ͠͠·ͬͨΒ ݁ہਓྗʹґଘ͢Δ

  20. ྫ͑͹͜ͷߏ੒

  21. ઌ΄Ͳͷߏ੒Λ࡞ΔϋϯζΦϯ https://amimoto.doorkeeper.jp/events/41522

  22. ઌ΄Ͳͷߏ੒Λ࡞ΔϋϯζΦϯ https://amimoto.doorkeeper.jp/events/41522

  23. ઌ΄Ͳͷߏ੒Λ࡞ΔϋϯζΦϯ https://amimoto.doorkeeper.jp/events/41522 ख࡞ۀͩͱ΄΅೔͔͔Δ

  24. None
  25. WPϓϥάΠϯ࿈ܞ΋ࣗಈԽ CloudFormation ίʔυͰϦιʔεΛఆٛ kumogataͰϢχοτԽ

  26. GitHubʹίʔυެ։ࡁΈ https://github.com/megumiteam/amimoto-enterprise-cfn

  27. ϦιʔεຖʹϑΝΠϧΛ෼ׂ͠ɺ࠶ར༻ੑΛߴΊΔ _include 'include/vpc/vpc.rb' _include 'include/ec2/waithandle_ec2.rb' _include "include/security_group.rb" _include "include/elb.rb" _include

    'include/iam/for_stack_001.rb' _include "include/cloudfront/cf.rb" _include "include/s3/s3-media.rb" https://github.com/megumiteam/amimoto-enterprise-cfn/blob/master/ include/001-base-resource.rb
  28. AWS MPʹ΋ܝࡌࡁΈ https://aws.amazon.com/marketplace/pp/B01B3ZE1NC/

  29. Aurora൛΋ϦϦʔεࡁ(Ұ෦) https://aws.amazon.com/marketplace/pp/B01B3ZE1NC/ "VSPSB3FBEMZ

  30. ख࡞ۀͩͱ൒೔Ҏ্͔͚ͯࣗྗߏங $MPVE'PSNBUJPOͳΒ෼଴͚ͭͩ ͲͪΒ͕ϏδωεʹߩݙͰ͖·͔͢ʁ

  31. AutoScaling WordPress + ࣗಈԽ ϚωʔδυαʔϏεͷ׆༻ CloudFormationͰႈ౳Խ

  32. ϑΝΠϧγεςϜ͕ωοΫ AutoScaling αʔόͷ૿ݮΛࣗಈԽ མͪͯ΋ࣗಈͰ෮چͰ͖Δ

  33. ϑΝΠϧγεςϜ

  34. None
  35. ࣮͸CloudFormationରԠͯ͠Δ http://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws- resource-efs-filesystem.html

  36. ϓϨϏϡʔ൛ͱ͍͑Ͳɺ ޫ໌͸͍ͯ͞͠Δ

  37. AMIMOTOϚωʔδυͰͷAutoScaleߏ੒

  38. "VUP4DBMFߏ੒Λ ϝϯς͠ͳ͍ͱμϝ ͱ͍͏໰୊

  39. ྫ͑͹͜Μͳ໰୊ w $PEF%FQMPZΤʔδΣϯτ͕མͪͨΒͲ͏͢Δ͔ʁ w ಉ͡ߏ੒Λօ͕࡞ΕΔͷ͔ʁ w "84.BSLFU1MBDFʹग़ͤΔ͔ʁ

  40. Now Developing

  41. Session2

  42. AMIMOTO + Server-less Architecture @Amimoto_Ami amimoto-ami.com AMIMOTOʹ͓͚ΔαʔόϨεΞʔΩςΫνϟͷ׆༻ʹ͍ͭͯ

  43. Summary 1. Πϯϑϥϝϯςφϯε͔Βͷ։์ 2. ίετ࠷దԽ 3. MicroServicesʹΑΔૄ݁߹ͳػೳ࣮૷ AMIMOTOͷػೳ։ൃ͸ҎԼͷϝϦοτΛڗड͢ΔͨΊʹαʔόϨεΞʔΩςΫνϟͰͷ࣮ ૷ʹऔΓ૊ΜͰ͍·͢:

  44. 1. Πϯϑϥϝϯςφϯε͔Βͷ։์ 2. ίετ࠷దԽ 3. MicroServicesʹΑΔૄ݁߹ͳػೳ࣮૷

  45. ෺ཧ૚ 04 ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ ෺ཧ૚ 04 ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯ ੹೚ڥք ੹೚ڥք

    EC2ͷ৔߹ Lambdaͷ৔߹
  46. 1. Πϯϑϥϝϯςφϯε͔Βͷ։์ 2. ίετ࠷దԽ 3. MicroServicesʹΑΔૄ݁߹ͳػೳ࣮૷

  47. ࣌ؒ ίετ ࣌ؒ ίετ EC2ͷ৔߹ Lambdaͷ৔߹

  48. 1. Πϯϑϥϝϯςφϯε͔Βͷ։์ 2. ίετ࠷దԽ 3. MicroServicesʹΑΔૄ݁߹ͳػೳ࣮૷

  49. ௨ৗͷWordPressͷػೳ։ൃ 8PSE1SFTT$PSF  1MVHJO  1MVHJO  1MVHJO  1MVHJO

     1MVHJO
  50. ൃੜ͢Δ໰୊఺ • ιʔείʔυͷංେԽ • DBͷංେԽ • DB͕୯Ұো֐఺ͱͳΔ Auto Scalling͕ແҙຯʹ •

    ػೳͱίΞɺςʔϚ͕ີ ݁߹ʹ 8PSE1SFTT$PSF 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO 1MVHJO
  51. Solution MicroServicesͱ͍͏ൃ૝

  52. Microservices • γεςϜΛෳ਺ͷίϯϙʔωϯτͰߏங • ίϯϙʔωϯτ͸ͦΕͧΕಠཱͨ͠γε ςϜͱͯ͠ՔಇͰ͖Δ • ૄ݁߹ • RestfulͳAPIͰγεςϜΛ࿈݁

  53. 8PSE1SFTT$PSF $POOFDUPS1MVHJO "1* "1* "1* .JDSP4FSWJDF .JDSP4FSWJDF .JDSP4FSWJDF ͜Ε͔ΒͷWordPressͷػೳ։ൃ

  54. ࣮૷ࣄྫ 1

  55. Problem ݕࡧػೳͷڧԽ

  56. 1. શจݕࡧͷػೳ͸ͳ͍ɻ୯७ͳλΠτϧͱຊจͷLIKEݕࡧ 2. ΧελϜϑΟʔϧυΛݕࡧର৅ʹΧελϚΠζ͢Δͱٸܹʹݕࡧ͕஗͘ͳΔέʔε͕༗Δ 3. ίϯςϯπͷྔʹൺྫͯ͠DBͷෛՙ্͕͕Δ Problem

  57. AMAZON 
 Elasticsearch ੌ͍ݕࡧ

  58. Architecture 8PSE1SFTT$PSF $POOFDUPS1MVHJO "1* ".";0/&MBTUJDTFBSDI

  59. ࣮૷ࣄྫ 2

  60. Problem αΠτ಺ݕࡧ͔Βͷച্σʔλΛՄࢹԽ͍ͨ͠

  61. AMAZON 
 lambda AMAZON 
 DynamoDB AMAZON 
 API Gateway

    Server-less ArchitectureͰՄࢹԽػೳΛ࣮૷
  62. Architecture 8PSE1SFTT$PSF $POOFDUPS1MVHJO "1* "1* "1* 'VMMUFYUTFBSDI $PMMFDU TVCTDSJQUJPOEBUB 7JTVBMJTF

    TVCTDSJQUJPOEBUB
  63. None
  64. 'VMM5FYU 4FBSDI %BUB7JTVBMJTJOH %BUB$PMMFDUJPO

  65. None
  66. ࣮૷ࣄྫ 3

  67. Problem AMIMOTOͷϢʔβίϯιʔϧ͕ཉ͍͠

  68. Cognito 
 User Pools ੌ͍Ϣʔβೝূج൫

  69. None
  70. None
  71. None
  72. Server-less ArchitectureʹΑΔ։ൃख๏ͷมԽ

  73. ͳͥ։ൃख๏ͷมԽ͕ى͜Δͷ͔ 1. ssh઀ଓͷଘࡏ͠ͳ͍ੈքͰͷ։ൃɺςετɺσϓϩΠ 2. αʔόαΠυϨϯμϦϯά͔ΒΫϥΠΞϯταΠυϨϯμϦϯά΁ ࠓ·Ͱαʔό͕ଘࡏ͢ΔલఏͰൃల͖ͯͨ͠։ൃख๏͕Ұ੾࢖͑ͳ͘ͳΔ

  74. 1. ssh઀ଓͷଘࡏ͠ͳ͍ੈքͰͷ։ൃɺςετɺσϓϩΠ 2. αʔόαΠυϨϯμϦϯά͔ΒΫϥΠΞϯταΠυϨϯμϦϯά΁

  75. • API Gateway, LambdaͷϓϩδΣΫτ؅ཧ • ϩʔΧϧ؀ڥͰͷLambda࣮ߦ • API GatewayͷҰݩతͳઃఆ •

    ։ൃɺεςʔδϯάɺຊ൪؀ڥͷ੾Γସ͑ • AWS؀ڥ΁ͷσϓϩΠ • ࣗ࡞ͷΞϓϦέʔγϣϯͷGithub΁ͷެ։ Serverless Framework
  76. 1. ssh઀ଓͷଘࡏ͠ͳ͍ੈքͰͷ։ൃɺςετɺσϓϩΠ 2. αʔόαΠυϨϯμϦϯά͔ΒΫϥΠΞϯταΠυϨϯμϦϯά΁

  77. • ViewʹಛԽͨ͠UIϥΠϒϥϦ • ϓϦίϯύΠϧʹΑΔϨϯμϦϯά • ܰྔͰίʔυ͕ॻ͖΍͍͢ • API Gateway LambdaͷΞϓϦέʔγϣϯͷ


    Viewͱͯ͠࡞Γ΍͍͢ Riot.js
  78. http://qiita.com/horike37 ࠓ೔঺հͨ͠ΞʔΩςΫνϟͷৄࡉ͸QiitaͷํʹιʔείʔυؚΊͯॻ͍͍ͯ·͢ ڵຯ͋Δํ͸ੋඇͷ͍ͧͯΈ͍ͯͩ͘͞

  79. ·ͱΊ

  80. ໰୊ͱ՝୊ 1.AWSͷεέʔϥϏϦςΟΛ࠷େݶʹൃشͰ͖ͳ͍ɻWordPressͷਂ͍ҋɻ 2.ංେԽ͠ଓ͚ΔσʔλϕʔεͱେྔͷPluginʹΑΔີ݁߹Խɻϝϯςφϯεෆೳঢ়ଶɻ

  81. ղܾ

  82. ໰୊ͱ՝୊ ߏங͸ࣗಈԽͰ͖͚ͨͲ……
 ͱ͜ΖͰӡ༻͸ʁ

  83. ʊਓਓਓਓਓਓਓਓਓਓਓʊ ʼɹӡ༻΋ࣗಈԽ͍ͨ͠ɹʻ ʉY^Y^Y^Y^Y^Y^Y^Y^Y^Yʉ

  84. Next Stage

  85. @Amimoto_Ami amimoto-ami.com THANK YOU!