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

Cloud Foundryことはじめ

Cloud Foundryことはじめ

11/9に開催されたOSS User's Meetingの発表資料のリファインです

Naoto TAKAHASHi

December 02, 2015
Tweet

More Decks by Naoto TAKAHASHi

Other Decks in Technology

Transcript

  1. ηοτΞοϓ 8FC 8FC "1 %# -# -# "1 "1 ϋʔυͳΒଟ෼ख࡞ۀ

    Ϛγϯ༻ҙͯ͠ɺ
 apacheೖΕͯɾɾɾ ϋʔυͳΒଟ෼ख࡞ۀ Ϛγϯ༻ҙͯ͠ɺϛυϧೖΕͯɺ
 ΞϓϦΛσϓϩΠͯ͠ɺ
 σʔλϕʔεͱͷ઀ଓΛઃఆͯ͠ɾɾ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ
 ςʔϒϧ࡞ͬͯɾɾɾ
  2. ηοτΞοϓ 8FC 8FC "1 %# -# -# "1 "1 ϋʔυͳΒଟ෼ख࡞ۀ

    Ϛγϯ༻ҙͯ͠ɺ
 apacheೖΕͯɾɾɾ ϋʔυͳΒଟ෼ख࡞ۀ Ϛγϯ༻ҙͯ͠ɺϛυϧೖ ΞϓϦΛσϓϩΠͯ͠ɺ
 σʔλϕʔεͱͷ઀ଓΛઃ Ϛγϯ༻ҙͯ͠ɺDBೖΕ ςʔϒϧ࡞ͬͯɾɾɾ
  3. Cloud Foundry 8FC 8FC "1 %# -# -# "1 "1

    }Cloud Foundry͕༻ҙ ϛυϧ͸Cloud Foundry͕༻ҙ
 ΞϓϦͷσϓϩΠʗೖΕସ͑ͷΈ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ
 ςʔϒϧ࡞ͬͯɾɾɾ
 ͜͜͸ͦΜͳʹมΘΒͳ͍
  4. ηοτΞοϓ͸chef͕shell͔ 8FC 8FC "1 %# -# -# "1 "1 }

    Cloud Foundry͕༻ҙ ϛυϧ͸Cloud Foundry͕༻ҙ
 ΞϓϦͷσϓϩΠʗೖΕସ͑ͷΈ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ
 ςʔϒϧ࡞ͬͯɾɾɾ
 ͜͜͸ͦΜͳʹมΘΒͳ͍
  5. Operations 8FC 8FC "1 %# -# -# "1 "1 }

    Cloud Foundry͕༻ҙ cf push cf bind-service cf create-service
  6. Process 8FC 8FC "1 %# -# -# "1 "1 }

    Cloud Foundry͕༻ҙ cf push –i <num> cf scale–i <num>
  7. The twelve-factor app I. ίʔυϕʔε (Codebase)
 όʔδϣϯ؅ཧ͞Ε͍ͯΔ1ͭͷίʔυϕʔεͱ
 ෳ਺ͷσϓϩΠ II. ґଘؔ܎

    (Dependencies)
 ґଘؔ܎Λ໌ࣔతʹએݴ͠෼཭͢Δ III. ઃఆ (Config)
 ઃఆΛ؀ڥม਺ʹ֨ೲ͢Δ IV. όοΫΤϯυαʔϏε (Backing Services)
 όοΫΤϯυαʔϏεΛΞλον͞ΕͨϦιʔεͱͯ͠ѻ͏ V. ϏϧυɺϦϦʔεɺ࣮ߦ (Build, release, run)
 ϏϧυɺϦϦʔεɺ࣮ߦͷ3ͭͷεςʔδΛݫີʹ෼཭͢Δ VI. ϓϩηε (Processes)
 ΞϓϦέʔγϣϯΛ1ͭ΋͘͠͸ෳ਺ͷεςʔτϨεͳϓϩ VII. ϙʔτόΠϯσΟϯά (Port binding)
 ϙʔτόΠϯσΟϯάΛ௨ͯ͠αʔϏεΛެ։͢Δ VIII. ฒߦੑ (Concurrency)
 ϓϩηεϞσϧʹΑͬͯεέʔϧΞ΢τ͢Δ IX. ഇغ༰қੑ (Disposability)
 ߴ଎ͳىಈͱάϨʔεϑϧγϟοτμ΢ϯͰݎ࿚ੑΛ࠷େԽ ͢Δ X. ։ൃ/ຊ൪Ұக (Dev/prod parity)
 ։ൃɺεςʔδϯάɺຊ൪؀ڥΛͰ͖Δ͚ͩҰகͤͨ͞ঢ়ଶ Λอͭ XI. ϩά (Logs)
 ϩάΛΠϕϯτετϦʔϜͱͯ͠ѻ͏ XII. ؅ཧϓϩηε (Admin processes)
 ؅ཧλεΫΛ1ճݶΓͷϓϩηεͱ࣮ͯ͠ߦ͢Δ
  8. The twelve-factor app I. ίʔυϕʔε (Codebase)
 όʔδϣϯ؅ཧ͞Ε͍ͯΔ1ͭͷίʔυϕʔεͱ
 ෳ਺ͷσϓϩΠ II. ґଘؔ܎

    (Dependencies)
 ґଘؔ܎Λ໌ࣔతʹએݴ͠෼཭͢Δ III. ઃఆ (Config)
 ઃఆΛ؀ڥม਺ʹ֨ೲ͢Δ IV. όοΫΤϯυαʔϏε (Backing Services)
 όοΫΤϯυαʔϏεΛΞλον͞ΕͨϦιʔεͱͯ͠ѻ͏ V. ϏϧυɺϦϦʔεɺ࣮ߦ (Build, release, run)
 ϏϧυɺϦϦʔεɺ࣮ߦͷ3ͭͷεςʔδΛݫີʹ෼཭͢Δ VI. ϓϩηε (Processes)
 ΞϓϦέʔγϣϯΛ1ͭ΋͘͠͸ෳ਺ͷεςʔτϨεͳϓϩ ηεͱ࣮ͯ͠ߦ͢Δ VII. ϙʔτόΠϯσΟϯά (Port binding)
 ϙʔτόΠϯσΟϯάΛ௨ͯ͠αʔϏεΛެ։͢Δ VIII. ฒߦੑ (Concurrency)
 ϓϩηεϞσϧʹΑͬͯεέʔϧΞ΢τ͢Δ IX. ഇغ༰қੑ (Disposability)
 ߴ଎ͳىಈͱάϨʔεϑϧγϟοτμ΢ϯͰݎ࿚ੑΛ࠷େԽ ͢Δ X. ։ൃ/ຊ൪Ұக (Dev/prod parity)
 ։ൃɺεςʔδϯάɺຊ൪؀ڥΛͰ͖Δ͚ͩҰகͤͨ͞ঢ়ଶ Λอͭ XI. ϩά (Logs)
 ϩάΛΠϕϯτετϦʔϜͱͯ͠ѻ͏ XII. ؅ཧϓϩηε (Admin processes)
 ؅ཧλεΫΛ1ճݶΓͷϓϩηεͱ࣮ͯ͠ߦ͢Δ
  9. Cloud Controller ϦϙδτϦ໊শɿcloud_controller_ng
 ௨শɿCC
 https://github.com/cloudfoundry/cloud_controller_ng 3PVUFS $$ %&" %&" ϧʔλ͸ΞϓϦέʔγϣϯͱڞ༗


    ੍ޚ༻ͷಛผϧʔτΛܦ༝ Cloud Foundryͷ৺ଁ෦
 CC͸ɺAPIαʔόͱͯ͠ػೳ͠
 γεςϜશମͷ൑அɾ੍ޚΛߦ͏
  10. HM9000 ϦϙδτϦ໊শɿhm9000
 ௨শɿHealth Manager
 https://github.com/cloudfoundry/hm9000 $$ %&" %&" ͋͘·ͰΞϓϦέʔγϣϯͷ؂ࢹͰ͋Γɺ
 Cloud

    Foundryͷίϯϙʔωϯτͷ؂ࢹ͸͠ͳ͍ ΞϓϦέʔγϣϯͷࢮ׆؂ࢹ
 DEA্Ͱ࣮ߦ͍ͯ͠ΔΞϓϦέʔγϣϯͷࢮ׆؂ࢹΛߦ͍ɺ ࢦఆ͞Εͨϓϩηε਺ʹ߹Θͳ͚Ε͹ɺ ىಈʗఀࢭΛߦ͏ࢦࣔΛCCʹରͯ͠ૹ৴͢Δ ). ࢦࣔ ௥Ճʗ࡟আ ؂ࢹ
  11. Application Execution ϦϙδτϦ໊শɿdea_ng
 ௨শɿdea(Droplet Execution Agent)
 https://github.com/cloudfoundry/dea_ng ΞϓϦέʔγϣϯ͸
 wardenίϯςφʹΑִͬ͑཭ɾӡ༻͞ΕΔ ΞϓϦέʔγϣϯ࣮ߦ؅ཧ


    ΞϓϦέʔγϣϯ͕࣮ߦ͞ΕΔͨΊͷϗετػೳΛఏڙ
 ɾΞϓϦέʔγϣϯϏϧυ
 ɾΞϓϦέʔγϣϯ࣮ߦ؅ཧ XBSEFO XBSEFO dea warden
 Linuxίϯςφٕज़Λϕʔεʹ
 Cloud Foundry্ͰΞϓϦέʔγϣϯΛ
 ࣮ߦ͢ΔͨΊʹඞཁ࠷௿ػೳͷΈ࣮૷
  12. Service Brokers ࣮ମ͸ɺCloud ControllerͷதͷػೳͱαʔϏεଆͷBrokerͷػೳ XBSEFO XBSEFO dea NZTRM QPTUHSFT $$

    shred αʔϏεͷ࡞੒ɾ࡟আ
 ͓ΑͼɺΞϓϦέʔγϣϯͱͷόΠϯυʗΞϯόΠϯυΛߦ͏ 4FSWJDF#SPLFS SFEJT
  13. Message Bus ϦϙδτϦ໊শɿgnats
 ௨শɿnats
 https://github.com/nats-io/gnats ΞϓϦέʔγϣϯ͸
 wardenίϯςφʹΑִͬ͑཭ɾӡ༻͞ΕΔ ίϯϙʔωϯτؒ௨৴ XBSEFO XBSEFO

    dea warden
 Linuxίϯςφٕज़Λϕʔεʹ
 Cloud Foundry্ͰΞϓϦέʔγϣϯΛ
 ࣮ߦ͢ΔͨΊʹඞཁ࠷௿ػೳͷΈ࣮૷