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

Web系のクラウドインフラに転職したとき最初にやっていったこと / web-infra-jobchange-start-study

VTRyo
October 06, 2018

Web系のクラウドインフラに転職したとき最初にやっていったこと / web-infra-jobchange-start-study

2018/10/6 インフラ勉強会資料

VTRyo

October 06, 2018
Tweet

More Decks by VTRyo

Other Decks in Technology

Transcript

  1. WebܥͷΫϥ΢υΠϯϑϥʹ
    స৬ͨ͠ͱ͖࠷ॳʹ΍͍ͬͯͬͨ͜ͱ
    VTRyo

    View Slide

  2. ͓͠ͳ͕͖
    • ॳ৺ऀͷਓͰ΋ֶͼ΍͍͢΋ͷ
    • WebΠϯϑϥΛେࡶ೺ʹͰ΋ֶ΂Δ΋ͷ
    • WebΠϯϑϥͰΑ͘ग़ͯ͘Δ΋ͷ

    View Slide

  3. ࠓ೔ͷ
    ొஃཧ༝

    View Slide

  4. View Slide

  5. ͦͷຊਓ͕͍Δͷ͔͸
    Θ͔Βͳ͍…͆

    View Slide

  6. Bio
    • https://vtryo.me/

    View Slide

  7. Bio
    • https://vtryo.me/
    ͨ͘͞Μॻ͍ͯΔ͚Ͳ
    2017೥·Ͱ΄΅εΫγϣ৬ਓ

    View Slide

  8. Bio
    • https://vtryo.me/
    స৬ͯ͠ͲΜͳ͜ͱ͔Β
    ࢝Ί͍͔ͯͬͨͷ࿩

    View Slide

  9. Bio(ਤ)

    View Slide

  10. ࠷ॳ͸Կ΋஌Βͳ͍
    ঢ়ଶͰͷస৬ͩͬͨ

    View Slide

  11. స৬࣌ͷεςʔλε
    • ஌ࣝɿLPIC1, CCNA
    • WebαʔόʁDBαʔόʁAPαʔόʁ

    ໊લ͸஌ͬͯΔɻͲ͏ͳ͍ͬͯΔ͔͸஌Βͳ͍
    • ͕ͩAWSΛ࢖͍ͬͯΔWebاۀʹస৬ͨ͠

    ʢύογϣϯͱߦಈྗͰ࠾༻ͯ͘͠Εͨ໛༷ʣ

    View Slide

  12. ΍΂͑…

    View Slide

  13. WebΫϥ΢υΠϯϑϥͷൣғ͸޿͍
    • WebاۀʹWebαʔόʢ౰ͨΓલ͕ͩʣ
    • ౰࣌LAMPߏ੒ʢˡҙຯ౴͑ΒΕ·͔͢ʁʣ
    • ࣗಈԽ
    • ϞχλϦϯά
    • ো֐ରԠ
    • etc…

    View Slide

  14. Ͳ͔͜Β΍Ε͹…

    View Slide

  15. ࣗ෼Ͱษڧ͢Δʹ΋୭͔ʹฉ͔ͳ͍ͱ
    ͲΜͳπʔϧ͕͋Δͷ͔΋Θ͔Βͳ͍

    View Slide

  16. ࠓ೔͸ͦΕΛ
    ղফ͍ͯ͜͠͏ͧ

    View Slide

  17. ମݧஊʹͳͬͯ͠·ͬͯ
    ਃ͠༁ͳ͍Ͱ͕͢
    Կ͔ͷࢀߟʹͳΕ͹…

    View Slide

  18. ΠϯϑϥΛେࡶ೺ʹ
    Θ͔Γͭͭ
    ॳ৺ऀ΋ͱ͖ͬͭ΍͍͢΋ͷ…

    View Slide

  19. View Slide

  20. WordpressͰϒϩάΛߏங͢Δ
    • LinuxͳͲͷجຊૢ࡞
    • Webαʔό
    • MySQL
    • PHP
    • υϝΠϯʹؔ͢Δ͜ͱ

    View Slide

  21. ͓͢͢Ίͷཧ༝
    • Ұ൪ϊ΢ϋ΢͕ཷ·͍ͬͯΔWordpress
    • WebϖʔδΛߏ੒͢Δͷʹඞཁ࠷௿ݶͷ͜ͱ͕Θ͔Δ
    • Linuxʹ͍ͭͯ΋ৄ͘͠ͳΔ
    • AWS΍VPSͳͲαʔό΋͙͢आΓΒΕΔ
    • ׬੒͢Δͱࣗ෼ͷϒϩάͱͯ͠࢖͑Δ

    View Slide

  22. ԾʹWordpressͰͷ

    ্ཱ͕ͪ͛ऴΘͬͨΒʁ

    View Slide

  23. ࣗಈԽͯ͠ΈΑ͏ͥ

    View Slide

  24. VagrantͱAnsible͸͍͍ษڧ
    • Vagrant্ͰԾ૝LinuxΛ্ཱͪ͛ɺͦ͜ʹ
    AnsibleͰWordpressΛࣗಈߏங͢Δ
    • ໌ࣔతʹύοέʔδΠϯετʔϧͨ͠Γɺϛυ
    ϧ΢ΣΞͷؔ܎ੑΛֶ΂Δ
    • ͩ͜ΘΕ͹ϫϯϥΠφʔͰWordpressΛཱͯΔ
    ͱ͜·ͰͰ͖Δ
    ࢀߟʢʁʣɿhttps://github.com/VTRyo/ansible_for_wordpressɹ

    View Slide

  25. Ansible͕

    ૬౰ษڧʹͳͬͨ

    View Slide

  26. AnsibleΛ਌Έ͍ͨʹ
    ࢥ͍ͬͯΔ

    View Slide

  27. Vagrant͔Β΍ͬͨ΄͏͕͍͍ཧ༝

    Dockerͷ͋Γ͕ͨΈΛײ͡ΒΕΔ
    ʢDockerfileΛࣗ෼Ͱॻ͘ͳΒผʣ

    View Slide

  28. खಈͰۤ࿑ͯ͠ߏஙͨ͠΋
    ͷΛࣗಈԽ͢Δͷ͸ָ͍͠

    View Slide

  29. ͞ΒʹԠ༻

    View Slide

  30. DockerͰߏங͢Δ
    • DockerͰWordpressͷಠࣗΠϝʔδΛॻ͍ͯΈ
    Δ
    • docker-composeͰཱͯΒΕΔΑ͏ʹͯ͠ΈΔ

    View Slide

  31. ͜ΕͰେࡶ೺ʹWebΠϯϑϥͷ
    ߏ੒Έ͍ͨͳͷ͕෼͔͔ͬͨ΋

    View Slide

  32. ϓϩάϥϛϯά͕Ͱ͖ͳ͔ͬͨࣗ෼ʹͱͬͯ
    AnsibleͷYamlهड़͸ॿ͔ͬͨ

    View Slide

  33. ಉ༷ʹYamlͰॻ͚Δٕज़͸
    ͱ͖ͬͭ΍͔ͬͨ͢

    View Slide

  34. ࣮ࡍɺYamlʹ͢Δ͜ͱͰ
    ͱ͖ͬͭ΍͔ͨͬͨ͘͢͠ͱ
    Ansibleͷਓ͕ݴ͍ͬͯΔ

    View Slide

  35. YamlͰॻ͚ΔΠϯϑϥ
    • Ansibleʢϛυϧ΢ΣΞߏ੒ʣ
    • PackerʢΠϝʔδߏ੒ʣ
    • Dockerʢίϯςφʣ
    • DatadogʢϞχλϦϯάʣ
    • CircleCIʢCIπʔϧʣ
    • ΄͔ͨ͘͞Μ

    View Slide

  36. ͭ·Γ
    Yaml͕ॻ͚Δͱ
    WebΠϯϑϥ͸͔ͳΓ෯͕޿͕Δ

    View Slide

  37. ͳͷʹ
    Yaml͸ͱ͖ͬͭ΍͍͢ʂ

    View Slide

  38. Α໊͘લ͕ͰΔ
    ٕज़

    View Slide

  39. View Slide

  40. WebܥτϨϯυʢʁʣ
    • TerraformʢΠϯϑϥͦͷ΋ͷΛίʔυԽ͢Δʣ
    • CircleCIʢ͍ΘΏΔCIπʔϧʣ
    • VulsʢLinux੬ऑੑ਍அʣ
    • RedashʢBIπʔϧʣ

    View Slide

  41. • TerraformʢΠϯϑϥͦͷ΋ͷΛίʔυԽ͢Δʣ
    • CircleCIʢ͍ΘΏΔCIπʔϧʣ
    • VulsʢLinux੬ऑੑ਍அʣ
    • RedashʢBIπʔϧʣ
    WebܥτϨϯυʢʁʣ

    View Slide

  42. TerraformͬͯԿʁ
    "84Ҏ֎ͷϦιʔε΋Ұॹʹ؅ཧͰ͖Δ

    View Slide

  43. ࣅͨΑ͏ͳࣗಈԽπʔϧͱͷҧ͍͸ʁ
    5FSSBGPSN͸ϨΠϠʔ͕ҧ͏ʂ

    View Slide

  44. CircleCIͱ͸ʁ
    • CircleCIͱ͸ɺܧଓతΠϯςάϨʔγϣϯ(σϦ
    όϦʔ)αʔϏεͰ͢ɻίϛοτ͔ΒσϓϩΠ·
    ͰͷύΠϓϥΠϯΛ࡞੒͠ɺܧଓతͳ౷߹/഑৴
    Λ࢖༻ͯ͠ιϑτ΢ΣΞ։ൃϓϩηεΛࣗಈԽ
    Ͱ͖·͢ɻ

    View Slide

  45. CircleCIͱ͸ʁ
    ࣗಈςετΛ࣮ߦͨ͠Γ͢Δ
    Jenkins΍WerckerͳͲ΋ಉ͡

    View Slide

  46. Vulsͱ͸ʁ
    • ੬ऑੑΛ਍அͯ͘͠ΕΔOSS
    • ͜͜࠷ۙऔΓೖΕΔձࣾଟ͠

    View Slide

  47. Vulsͱ͸ʁ
    • Go੡ͳͷͰඇৗʹ؆୯ʹಋೖͰ͖Δ
    • ηΩϡϦςΟҙࣝ޲্

    View Slide

  48. Redashͱ͸ʁ
    • BIπʔϧ
    • Python੡
    • ϏδωεαΠυͷਓ΋SQLॻ͍ͯ࢖ͬͯͨΓ͢Δ
    • Hotͳπʔϧ
    • AWSͳΒAMI͕ఏڙ͞Ε͍ͯΔ

    View Slide

  49. ٻਓ͔ΒݟΔ
    Hotϫʔυ

    View Slide

  50. View Slide

  51. View Slide

  52. View Slide

  53. 1,2೥Ґલ·Ͱͱ͸
    શવҧ͏ؾ͕͢Δ

    View Slide

  54. Πϯϑϥ΋ྲྀΕ͕ૣ͍

    View Slide

  55. جૅΛ཈͑ͭͭ
    ৽͍͜͠ͱ΋΍Βͳ͍ͱ

    View Slide

  56. Ҏ্

    View Slide

  57. Ҏ߱
    ࠂ஌Ͱ͢

    View Slide

  58. ηΠνϣ΢ɾδϟʔχʔ
    ΧΠθϯɾδϟʔχʔ
    ஶऀ͔ΒڐՄ΋Βͬͯ·͢ʈʈ
    ݱνΣοΫ਺ɿ
    Boothʹͯ
    ແྉαϯϓϧ൛ެ։தʂ

    View Slide

  59. ηΠνϣ΢ɾδϟʔχʔ
    ΧΠθϯɾδϟʔχʔ
    ஶऀ͔ΒڐՄ΋Βͬͯ·͢ʈʈ
    ݱνΣοΫ਺ɿ
    ෺ཧຊɿ200෦
    DLΧʔυɿ600෦
    രࢮ֮ޛʂʂ
    Boothʹͯ
    ແྉαϯϓϧ൛ެ։தʂ

    View Slide

  60. WebܥͷΫϥ΢υΠϯϑϥʹ
    స৬ͨ͠ͱ͖࠷ॳʹ΍͍ͬͯͬͨ͜ͱ
    VTRyo
    ׬

    View Slide