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

スタートアップに入ってまずやったインフラTIPS

kotamat
May 30, 2018

 スタートアップに入ってまずやったインフラTIPS

kotamat

May 30, 2018
Tweet

More Decks by kotamat

Other Decks in Technology

Transcript

  1.   4$065&3ͱ͸ ແྉͰ
 ܝࡌٻਓ ϓϩͷ ΤʔδΣϯτ
 ࣾ  ਓ௒ͷΤʔδΣϯτωοτϫʔΫΛ׆༻ͨ͠ਓࡐ঺հ

    ͭͷ૭ޱͰ͝঺հऀͷ฼ूஂΛ࠷େԽ͢Δ͜ͱ͕Ͱ͖·͢ ݸਓͷ
 εΧ΢λʔ
  ਓ ٻਓΛ৐ͤΔ͚ͩʂ
  2. Before • masterϒϥϯνʹϚʔδ͞ΕͨΒଈຊ൪ʹ൓ө • ҰԠϑϩϯτ͚ͩ͸Heroku Review App্ཱ͕͕͍ͪͬͯͨ ͕ɺॏ͗ͯ͢࢖͑ͳ͍ʝ • ෆ۩߹ใࠂ͕͋ͬͨͱͯ͠΋ɺ࠶ݱ·Ͱʹ͕͔͔࣌ؒΔ

    or ࠶ݱ Ͱ͖ͳ͍ • ࣾһʹϦϦʔεલʹ֬ೝͯ͠΋Β͏ͱ͖͸ɺࣗ෼ͷ1$͔Β 0.0.0.0ͰϏϧυͯ͠ϩʔΧϧωοτϫʔΫͰݟͯ΋Β͏ɻ
  3. DBϚεΩϯά • ݸਓ৘ใΛӅͨ͢ΊͷγϯΫલॲཧ • ςʔϒϧ໊ɺΧϥϜ໊ɺՃ޻ํ๏Λࢦఆͯ͠ϚεΩϯάΛߦ͏ • Ճ޻ํ๏ • ࢦఆͨ͠஋ʹॻ͖׵͑ •

    จࣈྻ຤ඌʹsuffixΛ௥Ճ • ਺஋ΛϥϯμϜͳ΋ͷʹॻ͖׵͑ • 3จࣈ໨Ҏ߱Λଞͷจࣈʹॻ͖׵͑ • yamlͰઃఆ
  4. yamlྫ - table_name: users columns: - name: email suffix: x

    - name: numeric_data calc: true - name: last_name len: 1 - name: tel - name: default default: 18793jjdiaerheihu3qoh4u3qh4u3i2qhu43qh - name: uri conditions: - condition: "`status`='active'" value: some/path/of/uri - condition: "`status`='pending'" value: other/path/of/uri - table_name: companies columns:
  5. IaC

  6. σΟϨΫτϦߏ੒ ᵓᴷᴷ global ᵓᴷᴷ service1 ᴹ ᵓᴷᴷ ansible ᴹ ᴹ

    ᵓᴷᴷ app ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ec2-boot ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ecs ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ nginx ᴹ ᴹ ᴹ ᵓᴷᴷ defaults ᴹ ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᴹ ᵓᴷᴷ tasks ᴹ ᴹ ᴹ ᵋᴷᴷ templates ᴹ ᴹ ᵋᴷᴷ php ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᵋᴷᴷ policies ᵓᴷᴷ service2 ڞ௨෦෼ͷهड़
  7. σΟϨΫτϦߏ੒ ᵓᴷᴷ global ᵓᴷᴷ service1 ᴹ ᵓᴷᴷ ansible ᴹ ᴹ

    ᵓᴷᴷ app ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ec2-boot ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ecs ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ nginx ᴹ ᴹ ᴹ ᵓᴷᴷ defaults ᴹ ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᴹ ᵓᴷᴷ tasks ᴹ ᴹ ᴹ ᵋᴷᴷ templates ᴹ ᴹ ᵋᴷᴷ php ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᵋᴷᴷ policies ᵓᴷᴷ service2 αʔϏεͷUGϑΝΠ ϧͷ؅ཧ
  8. σΟϨΫτϦߏ੒ ᵓᴷᴷ global ᵓᴷᴷ service1 ᴹ ᵓᴷᴷ ansible ᴹ ᴹ

    ᵓᴷᴷ app ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ec2-boot ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ecs ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ nginx ᴹ ᴹ ᴹ ᵓᴷᴷ defaults ᴹ ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᴹ ᵓᴷᴷ tasks ᴹ ᴹ ᴹ ᵋᴷᴷ templates ᴹ ᴹ ᵋᴷᴷ php ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᵋᴷᴷ policies ᵓᴷᴷ service2 "OTJCMFͷ؅ཧ
  9. σΟϨΫτϦߏ੒ ᵓᴷᴷ global ᵓᴷᴷ service1 ᴹ ᵓᴷᴷ ansible ᴹ ᴹ

    ᵓᴷᴷ app ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ec2-boot ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ ecs ᴹ ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᴹ ᵓᴷᴷ nginx ᴹ ᴹ ᴹ ᵓᴷᴷ defaults ᴹ ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᴹ ᵓᴷᴷ tasks ᴹ ᴹ ᴹ ᵋᴷᴷ templates ᴹ ᴹ ᵋᴷᴷ php ᴹ ᴹ ᵓᴷᴷ handlers ᴹ ᴹ ᵋᴷᴷ tasks ᴹ ᵋᴷᴷ policies ᵓᴷᴷ service2 ͭ໨Ҏ߱ͷαʔϏε