Upgrade to Pro — share decks privately, control downloads, hide ads and more …

しくじり先生 on AWS

963e2ef268dd26917f8ec5e62b499d0d?s=47 saramune
December 01, 2020

しくじり先生 on AWS

Cloud Operator Days Tokyo 2020の発表資料です。
https://cloudopsdays.com/
アーカイブのYouTubeはこちら。
https://www.youtube.com/watch?v=IQvduOpgF5E

963e2ef268dd26917f8ec5e62b499d0d?s=128

saramune

December 01, 2020
Tweet

Transcript

  1. ͘͠͡Γઌੜ on AWS $0%5

  2. ࠓ೔͓఻͑͢Δ͜ͱ w ͘͠͡Γ w ݪҼ w ڭ܇

  3. ࠓ೔͓఻͑͢Δ͜ͱ w ͘͠͡Γ w ݪҼ w ڭ܇ ͋ɺ͏ͪͷ؀ڥ Ͳ͏͔ͩͬͨͳʁ

  4. ࠓ೔͓఻͑͢Δ͜ͱ w ͘͠͡Γ w ݪҼ w ڭ܇ ·͊ɺେৎ෉͔ͳ

  5. ࠓ೔͓఻͑͢Δ͜ͱ w ͘͠͡Γ w ݪҼ w ڭ܇ ·͊ɺେৎ෉͔ͳ ⼤変なことになりますよ ...たぶん

  6. ࠓ೔͓఻͑͢Δ͜ͱ w ͘͠͡Γ w ݪҼ w ڭ܇ ͋ɺ͏ͪͷ؀ڥ Ͳ͏͔ͩͬͨͳʁ ͱɺࢥͬͨΒ

  7. ࠓ೔͓఻͑͢Δ͜ͱ w ͘͠͡Γ w ݪҼ w ڭ܇ Ϥγʂ ͥͻ֬ೝΛʂ

  8. ಉ͘͡͠͡Γ͕ੈք͔Βͳ͘ͳΓ·͢Α͏ ئΘ͘͹

  9. ͘͠͡Γઌੜ on AWS ͱ͍͏Θ͚Ͱ ʙԶΈ͍ͨʹͳΔͳʂʂʙ

  10. ஫ҙࣄ߲ w "84Λ৮ͬͨ͜ͱ͋Δӡ༻ॳ৺ऀɾதڃऀͷํ޲͚Ͱ͢ w ͕ɺ&$ -BNCEB౳Α͘࢖͍ͦ͏ͳαʔϏε͸ղઆ͠·ͤΜ w ͘͠͡Γ͸ࣄ࣮ʹج͍͍ͮͯ·͕͢ந৅Խ͍ͯ͠·͢ w ͋͘·Ͱٕज़໘ʹϑΥʔΧε͠·͢

    w +"84%":4Ͱൃදͨ͠΋ͷʹՃච͍ͯ͠·͢ w λΠτϧͿΕͿΕͰ͢Έ·ͤΜ
  11. w ݹ԰ܒհ w ॴଐɿJSFUגࣜձࣾDMPVEQBDL w ໾৬ɿ։ൃ͕͋ΓͷΠϯϑϥΤϯδχΞ w ࢓ࣄɿ"84ͱΠνϟΠνϟ w झຯɿυϥϜ

    ࣗݾ঺հ
  12. ʹ͍ͭͯ AWSΛ׆༻͠ͳ͕ΒϏδωεʹूதͰ͖Δ ίϯγΣϧδϡαʔϏε ͓٬༷ 24࣌ؒ365೔ͷ؂ࢹӡ༻อक ఆֹ՝ۚɾ੥ٻॻ෷͍

  13. "1/$POTVMUJOH1BSUOFSPGUIF:FBSड৆ʂ

  14. ໨࣍ w ͘͠͡Γ̍ɽʁʁʁ w ͘͠͡Γ̎ɽʁʁʁ w ͘͠͡Γ̏ɽʁʁʁ w ͘͠͡Γ̐ɽʁʁʁ

  15. ͷ͍͢͝ͻͱͨͪ "84(BNF%BZͰ༏উͨ͠ͻͱ ৘ใࢽʹدߘͨ͠ͻͱ

  16. "UIFOBͰສԁͷ੥ٻ͕͖ͨͻͱ ͘͠͡Γ̍ɽ

  17. ཁ݅ w $MPVE'SPOU&-#ͷϩάΛ෼ੳ͍ͨ͠ w ෼ੳͷछྨ͸ݻఆ w ேʹલ೔෼ͷ෼ੳσʔλΛӾཡ͍ͨ͠ w Ӿཡऀʹ42-Λҙࣝͤ͞ͳ͍ w

    ର৅ͷϩά͸౦ژͱΦϨΰϯͷ4ʹ֨ೲࡁΈ
  18. w $MPVE'SPOU&-#ͷϩάΛ෼ੳ͍ͨ͠ w ෼ੳͷछྨ͸ݻఆ w ேʹલ೔෼ͷ෼ੳσʔλΛӾཡ͍ͨ͠ w Ӿཡऀʹ42-Λҙࣝͤ͞ͳ͍ w ର৅ͷϩά͸౦ژͱΦϨΰϯͷ4ʹ֨ೲࡁΈ

    ཁ݅ "UIFOBΛ࢖ͬͯΈΑ͏
  19. ͓͞Β͍ɿ"UIFOBͱ͸ w ֓ཁʢυΩϡϝϯτΑΓʣ w ඪ४42-Λ࢖༻ͯ͠"NB[PO4Ͱͷσʔλͷ௚઀෼ੳΛ؆қԽ ͢ΔΠϯλϥΫςΟϒͳΫΤϦαʔϏεͰ͢ w ྉۚ w εΩϟϯ͞Εͨσʔλ<5#>͋ͨΓ<64%>

  20. ߏ੒ਤ w ໷ؒόονͱͯ͠-BNCEBΛ࠶ؼ࣮ߦ͠ճΫΤϦΛൃߦ w ෼ੳ݁ՌΛผͷ4όέοτʹ֨ೲ͠ɺϢʔβ͕Ӿཡ

  21. ਺೔ޙ "UIFOBΊͪΌͪ͘Ό࢖ΘΕͯ·͢ΑͶ ࢖͍͗͢ͳͷͰ੍ݶ͔͚·͢Ͷ

  22. ਺೔ޙ "UIFOBΊͪΌͪ͘Ό࢖ΘΕͯ·͢ΑͶ ࢖͍͗͢ͳͷͰ੍ݶ͔͚·͢Ͷ

  23. Α͘Α͘ݟͯΈΔͱ σʔλసૹྔ͕170[TB]௒͑ͯΔʂ ※౦ژ → ΦϨΰϯ

  24. <5#>ສԁ͔ͩΒ σʔλసૹྉ͚ۚͩͰ170ສԁʂ

  25. ͳͥʁ w ໷ؒόονͷ-BNCEB͕ແݶϧʔϓ w ΤϥʔϋϯυϦϯάͰ͖ͣʹແݶʹσʔλసૹ͕ൃੜ w σʔλ֨ೲ4ͷ͕ͭ౦ژϦʔδϣϯ w 4 ౦ژ

    ˠ"UIFOB ΦϨΰϯ ΁ͷసૹྉ͕͔͔Δ
  26. w -BNCEBͰ࠶ؼ͸ΞϯνύλʔϯʢυΩϡϝϯτΑΓʣ Կ͕͍͚ͳ͔ͬͨͷ͔

  27. ΞϯνύλʔϯɺμϝɺθολΠ ڭ܇̍ɽ

  28. ΞϯνύλʔϯΛ஌Δʹ͸ w "84Ϋϥ΢υαʔϏε׆༻ࢿྉू w #MBDL#FMUͳͲ

  29. ໨࣍ w ͘͠͡Γ̍ɽ"UIFOBͰສԁͷ੥ٻ͕͖ͨͻͱ w ͘͠͡Γ̎ɽʁʁʁ w ͘͠͡Γ̏ɽʁʁʁ w ͘͠͡Γ̐ɽʁʁʁ

  30. &$͕෮چͰ͖ͳ͍Ͱ͖ͨͷʹϔϯ ͘͠͡Γ̎ɽ

  31. &$ͷόοΫΞοϓͱ͍͑͹ w &#4εφοϓγϣοτΛऔಘ͢Δ w ࣮ମ͸4ʹอ؅͞ΕΔ w "NB[PO.BDIJOF*NBHF ".* Λ࡞੒͢Δ w

    Πϯελϯε࡞੒ʹඞཁͳ৘ใΛ·ͱΊͨ΋ͷ w 04ɺ&#4εφοϓγϣοτͳͲ
  32. ͋Δ೔ &$ͷΠϯελϯελΠϓมߋΛ ͓ئ͍͠·͢

  33.  &$ఀࢭ  ΠϯελϯελΠϓมߋ  &$ىಈ ࡞ۀ։࢝

  34.  &$ఀࢭ  ΠϯελϯελΠϓมߋ  &$ىಈ͠ͳ͍ʁ ࡞ۀ։࢝

  35.  &$ఀࢭ  ΠϯελϯελΠϓมߋ  &$ىಈ͠ͳ͍ʁ  ".*όοΫΞοϓ͔Βىಈ ࡞ۀ։࢝

  36.  &$ఀࢭ  ΠϯελϯελΠϓมߋ  &$ىಈ͠ͳ͍ʁ  ".*όοΫΞοϓ͔Βىಈ  ىಈ͠ͳ͍

    ࡞ۀ։࢝
  37. ͳͥʁ w ιϑτ΢ΣΞىҼͰىಈͰ͖ͳ͍͜ͱ͕ʢكʹʣ͋Δ w CPPUྖҬͰΤϥʔͳͲݪҼ͸༷ʑ

  38. ෮چํ๏ w յΕͨΠϯελϯεͷσʔλΛαϧϕʔδ  ผͰΠϯελϯεΛ࡞੒  ໰୊ͷ&#4ΛΞλον  ඞཁͳσʔλΛίϐʔ

  39. ·ͨผͷ͋Δ೔ όοναʔόΛ".*͔Β ෮ݩ͍ͯͩ͘͠͞

  40.  ".*͔Β&$্ཱͪ͛  ىಈɺಈ࡞֬ೝ໰୊ͳ͠  όονॲཧ։࢝ ࡞ۀ։࢝

  41.  ".*͔Β&$্ཱͪ͛  ىಈɺಈ࡞֬ೝ໰୊ͳ͠  όονॲཧʜऴΘΒͳ͍ʁ ࡞ۀ։࢝

  42.  ".*͔Β&$্ཱͪ͛  ىಈɺಈ࡞֬ೝ໰୊ͳ͠  όονॲཧʜऴΘΒͳ͍ʁ  ͍ͭ΋͸͙͢ऴΘΔͷʹ ࡞ۀ։࢝

  43.  ".*͔Β&$্ཱͪ͛  ىಈɺಈ࡞֬ೝ໰୊ͳ͠  όονॲཧʜऴΘΒͳ͍ʁ  ͍ͭ΋͸͙͢ऴΘΔͷʹ  ࣌ؒҎ্͔͔ͬͯΔ

    ࡞ۀ։࢝
  44. ".*෮ݩޙ͸ॳظԽ͕ඞཁ w ".* &#4 ෮ݩޙ͸ॳظԽ͠ͳ͍ͱύϑΥʔϚϯε͕མͪΔ w ॳճΞΫηε࣌ʹ4͔ΒϒϩοΫ͕μ΢ϯϩʔυ͞ΕΔ

  45. ".*ͱͬͯΔ͔Β҆શɺͰ͸ͳ͍ w ".*͔Βىಈ͢Δ͜ͱΛʢࣄલʹʣ֬ೝ͢Δ w ಛʹ".*͔Βͷ෮چ͸ඇৗ࣌Ͱ͋Δ͜ͱ΋͋Δ w ඇৗ࣌ʹཔΈͷߝ͕ಈ͔ͳ͍ͷ͸௧͍ w ".*͔Βىಈͨ͠ޙͷΦϖϨʔγϣϯ΋֬ೝ͢Δ w

    ΞϓϦͷಈ࡞֬ೝ w όονͷಈ࡞֬ೝ w FUD
  46. ͦΕɺͪΌΜͱ෮چͰ͖Δʁ ڭ܇̎ɽ

  47. ۩ମతʹ͸ʁ w ϦϦʔεલʹຊ൪૬౰ͷ".*ͰϦετΞࢼݧΛ͢Δ w ༗ࣄͷࡍͷϦϋʔαϧ΋݉ͶΔ w &$ʹ໰୊͕ੜͨ͜͡ͱΛ૝ఆͯ͠࡟আˠϦετΞ w ".*͔Β৽نͰ&$Λ࡞੒͢Δ w

    &$Λ࡟আ͢Δͷ͸ͪΐͬͱͱ͍͏৔߹ w ".*͔Βਖ਼ৗʹىಈ͢Δ͔ͷΈΛ֬ೝ͍ͨ͠ͱ͖ͷ͓खܰҊ
  48. ໨࣍ w ͘͠͡Γ̍ɽ"UIFOBͰສԁͷ੥ٻ͕͖ͨͻͱ w ͘͠͡Γ̎ɽ&$͕෮چͰ͖ͳ͍Ͱ͖ͨͷʹϔϯ w ͘͠͡Γ̏ɽʁʁʁ w ͘͠͡Γ̐ɽʁʁʁ

  49. ͪΐͬͱٳܜ

  50. ͘͠͡Γ൪֎ฤ ͳΜ͔੥ٻߴ͘ͳ͍ʁ 170ສԁͱ·Ͱ͸͍͔ͳͯ͘΋…

  51. ͳΜ͔੥ٻߴ͘ͳ͍ʁ

  52. ͳΜ͔੥ٻߴ͘ͳ͍ʁ ࢖Θͳ͍EC2͸ࢭΊͯΔͷʹ…

  53. &$ఀࢭͯ͠Δ͔Β՝ۚ͞Ε·ͤΜʁ w &#4͸՝ۚ͞ΕΔ w <(#>͋ͨΓ<64%> w ౦ژϦʔδϣϯHQ w ఀࢭͨ͠Πϯελϯεʹؔ࿈ͮ͘&MBTUJD*1͸՝ۚ͞ΕΔ w

    ࣌ؒ͋ͨΓ<64%> w ͪΓͭ΋
  54. ͳΜ͔੥ٻߴ͘ͳ͍ʁ ࢖Θͳ͍EC2͸ࢭΊͯΔͷʹ… ࢖Θͳ͍AMI͸ফͯ͠Δͷʹ…

  55. 4OBQTIPU࢒ͬͯ·ͤΜ͔ʁ w ".*Λ࡟আͯ͠΋&#4ͷ4OBQTIPU͸࢒Δ w <(#>͋ͨΓ<64%> w ͜Ε΋ͪΓͭ΋

  56. ͳΜ͔੥ٻߴ͘ͳ͍ʁ ࢖Θͳ͍EC2͸ࢭΊͯΔͷʹ… ࢖Θͳ͍AMI͸ফͯ͠Δͷʹ… ͯ͜ͱ͸RDSܥ΋…?

  57. 3%4ͷͪΓͭ΋ϙΠϯτ w खಈ4OBQTIPU͸ࣗಈͰ࡟আ͞Εͳ͍ w <(J#>͋ͨΓ<64%> w ౦ژϦʔδϣϯHQ w ͜Ε΋΍ͬͺΓͪΓͭ΋

  58. EBS ਖ΋ੵ΋Ε͹ ࢁͱͳΔ ڭ܇ ൪֎ฤ ɽ

  59. ໨࣍ w ͘͠͡Γ̍ɽ"UIFOBͰສԁͷ੥ٻ͕͖ͨͻͱ w ͘͠͡Γ̎ɽ&$͕෮چͰ͖ͳ͍Ͱ͖ͨͷʹϔϯ w ͘͠͡Γ̏ɽʁʁʁ w ͘͠͡Γ̐ɽʁʁʁ

  60. -BNCEBಥવͷࢮ ͘͠͡Γɽ

  61. w 4ʹ[JQϑΝΠϧΛΞοϓϩʔυ w -BNCEBͰ[JQΛల։ɺผͷ4΁อ؅ ߏ੒ਤ

  62. ͋ΔλΠϛϯάͰ LambdaͰΤϥʔ͕සൃ

  63. $MPVE8BUDI-PHTʂʂ /PTQBDFMFGUPOEFWJDF

  64. $MPVE8BUDI-PHTʂʂ /PTQBDFMFGUPOEFWJDF

  65. -BNCEBͷσΟεΫ༰ྔʁʁʁ w Ұ࣌తͳϑΝΠϧஔ͖৔ͱͯ͠UNQ͕ར༻Մೳ w 4ʹΞοϓϩʔυ͢ΔલͷϑΝΠϧͳͲ w UNQ͸<.#>͔͠࢖͑ͳ͍ w <.#>Ҏ্ͷϑΝΠϧΛஔ͜͏ͱ͢ΔͱΤϥʔʹͳΔ w

    ֤ϑΝΠϧ͸<.#>Ҏ಺ʹ΋ؔΘΒͣރׇ
  66. ͳͥރׇͨ͠ͷ͔ʁ w -BNCEBͷ࣮ߦ؀ڥ͸࠶ར༻͞ΕΔ w ղౚͨ͠ϑΝΠϧΛফ͍ͯ͠ͳ͔ͬͨ w -BNCEBͷ࣮ߦ؀ڥͱͱ΋ʹ࡟আ͞ΕΔ૝ఆͩͬͨ w ࠶ར༻͞ΕΔ͜ͱΛҙ͍ࣝͯ͠ͳ͔ͬͨ

  67. ରࡦ w ϑΝΠϧΛ࡟আ͢ΔΑ͏ʹमਖ਼ w UNQͷ഑ԼʹҰ࣌σΟϨΫτϦΛ࡞੒ͦ͜͠ʹ[JQղౚ w ؔ਺ऴྃ࣌ʹ্هσΟϨΫτϦ͝ͱ࡟আ

  68. Lambda͸࢖͍੾ΓɺͰ΋ͳ͍ ڭ܇ɽ

  69. ໨࣍ w ͘͠͡Γ̍ɽ"UIFOBͰສԁͷ੥ٻ͕͖ͨͻͱ w ͘͠͡Γ̎ɽ&$͕෮چͰ͖ͳ͍Ͱ͖ͨͷʹϔϯ w ͘͠͡Γ̏ɽ-BNCEBಥવͷࢮ w ͘͠͡Γ̐ɽʁʁʁ

  70. ࢥΘ͵Ϧιʔε͕ރׇ ͘͠͡Γɽ

  71. ߏ੒ਤ w 8FCαΠτ w &-# w &$ w &'4 w

    3%4
  72. ͋Δ೔ʜ αΠτ͕ͭͳ͕Βͳ͍…஗͍…

  73. ॳಈ֬ೝʂ

  74. ॳಈ֬ೝʂ EC2ಈ͍ͯΔʂ

  75. ॳಈ֬ೝʂ EC2ಈ͍ͯΔʂ CPUɺϝϞϦ༨༟͋Γʂ

  76. ॳಈ֬ೝʂ EC2ಈ͍ͯΔʂ CPUɺϝϞϦ༨༟͋Γʂ DB͕ϘτϧωοΫͰ΋ͳͦ͞͏

  77. ॳಈ֬ೝʂ EC2ಈ͍ͯΔʂ CPUɺϝϞϦ༨༟͋Γʂ DB͕ϘτϧωοΫͰ΋ͳͦ͞͏ ͳΜͩɾɾɾʁ

  78. Μʜʁ     

  79.      Μʜʁ EFSͷόʔετΫϨδοτ࢖͍੾ͬͯΔʂ

  80. &'4ͷόʔετΫϨδοτͱ͸ w &'4ͷ3FBE8SJUFੑೳ͸࢖༻͍ͯ͠Δ༰ྔʹґଘ w <(#>͋ͨΓ<,J#ඵ> w ੑೳෆ଍ͷ৔߹͸όʔετΫϨδοτ͕࢖͑Δ w ΫϨδοτΛফඅͯ͠38ੑೳΛҰ࣌తʹҾ্͖͛Δ w

    جຊੑೳະຬͳΒΫϨδοτஷۚ w ΫϨδοτΛ࢖͍੾Δͱجຊੑೳࢭ·Γ
  81. αΠτμ΢ϯͷݪҼ w جຊੑೳͰ͸αΠτͷӾཡʹ଱͑ΒΕͳ͔ͬͨ w ը૾ͱ͔ಡΈࠐΜͩΓ͢ΔͱجຊੑೳΛ͙͢௒͑Δ w ΫϨδοτ͕ރׇͯ͠ύϑΥʔϚϯε͕ग़ͤͳ͘ͳͬͨ w ৗʹ38͕ൃੜͨͨ͠ΊΫϨδοτճ෮ͷ༨஍͕ͳ͔ͬͨ w

    ΫϨδοτͷ؂ࢹ͕Ͱ͖͍ͯͳ͔ͬͨ w &'4ͷ࢖ΘΕํར༻༧ఆͷ༰ྔΛ೺ѲͰ͖͍ͯͳ͔ͬͨ
  82. ରࡦ w ϓϩϏδϣϯυεϧʔϓοτʹมߋ w ༧ΊύϑΥʔϚϯεΛࢦఆͰ͖ΔϞʔυ w ΫϨδοτͱ͍͏֓೦͔Β։์ w όʔετΑΓߴίετ

  83. ΫϨδοτʹ͸ؾΛ͚ͭΖ ڭ܇ɽ

  84. ͦͷଞόʔετΫϨδοτ͕͋ΔαʔϏε w &$ͷ$16 w UܥͷΈ w &#4 w 3%4΋ର৅ͳͷͰ஫ҙ ˢ஫ҙॻ͖͕ग़ͯ͘Δ

  85. ͘͠͡Γ·ͱΊ w ͘͠͡Γ̍ɽ"UIFOBͰສԁͷ੥ٻ͕͖ͨͻͱ w ͘͠͡Γ̎ɽ&$͕෮چͰ͖ͳ͍Ͱ͖ͨͷʹϔϯ w ͘͠͡Γ̏ɽ-BNCEBಥવͷࢮ w ͘͠͡Γ̐ɽࢥΘ͵Ϧιʔε͕ރׇ

  86. ڭ܇·ͱΊ w ڭ܇̍ɽΞϯνύλʔϯɺμϝɺθολΠ w ڭ܇̎ɽͦΕɺͪΌΜͱ෮چͰ͖Δʁ w ڭ܇̏ɽ-BNCEB͸࢖͍੾ΓɺͰ΋ͳ͍ w ڭ܇̐ɽΫϨδοτʹ͸ؾΛ͚ͭΖ

  87. ʢ࠶ܝʣ΋͠গ͠Ͱ΋ؾʹͳͬͨΒ w ͘͠͡Γ w ݪҼ w ڭ܇ Ϥγʂ ͥͻ֬ೝΛʂ

  88. w ΤϯδχΞ w Πϯϑϥ w ηΩϡϦςΟ w σʔλ w ΞϓϦ

    w 1. w ࣾ಺Πϯϑϥ w Ӧۀ એ఻ Ϋϥ΢υͱΠνϟΠνϟ͍ͨ͠ਓืूத
  89. Thank you