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

Ubuntu VPS から CoreOS クラスタに移行した話 #w8lt

Ubuntu VPS から CoreOS クラスタに移行した話 #w8lt

#w8lt 第一回 (2015-04-22) の発表資料です
http://w8lt.connpass.com/event/14297/

Daisuke Fujita

April 22, 2015
Tweet

More Decks by Daisuke Fujita

Other Decks in Technology

Transcript

  1. Ubuntu VPS ͔Β CoreOS Ϋϥελʹ
 Ҡߦͨ͠࿩ 2015-04-22 W8LT#1 @dtan4 IUUQHMPCFWJFXTDPNEDJNESFBNTDMPVETDMPVETKQH

  2. #w8lt
 ։࠵͓ΊͰͱ͏͍͟͝·͢
 :tada:

  3. Daisuke Fujita @dtan4 ܭࢉ޻ֶઐ߈ ಙాݚ M2

  4. None
  5. 2014.07-2015.04 ͘͞Β VPS + Ubuntu 2015.04- DigitalOcean + CoreOS

  6. 2014.07-2015.04 ͘͞Β VPS + Ubuntu 2015.04- DigitalOcean + CoreOS

  7. ͘͞Β VPS + Ubuntu VPS 2G Ubuntu 14.04 ߏ੒؅ཧ: Chef

    ΞϓϦέʔγϣϯ: Docker ίϯςφ ֎෦ετϨʔδ: S3 DNS αʔϏε: Route53 ؂ࢹܥ: Datadog, Papertrail
  8. ͘͞Β VPS + Ubuntu ap-northeast1 (Tokyo) VPS 2G nginx-proxy Web

    App Worker Web App redis postgres dd-agent
  9. None
  10. ৭ʑͭΒ͍ Chef ׂ͕Γͱ͠ΜͲ͍ʢႈ౳ੑͱ͸ʁʣ ౓ॏͳΔηΩϡϦςΟΞοϓσʔτ ssh ͯ͠ docker run ͢ΔίϯςφखಈσϓϩΠ postgres,

    redis ίϯςφͷσʔλӬଓԽͯ͠ͳ͍ Docker 1.1
  11. None
  12. CoreOS ͢΂ͯͷΞϓϦέʔγϣϯΛ
 Docker ίϯςφͱͯ͠ಈ͔͢ Core ೖΕସ͑ʹΑΔࣗಈΞοϓσʔτ (like Chrome) etcd +

    fleet ʹΑΔΫϥελϦϯά CoreOS is designed for security, consistency, and reliability
  13. 2014.07-2015.04 ͘͞Β VPS + Ubuntu 2015.04- DigitalOcean + CoreOS

  14. DigitalOcean + CoreOS 1GB Droplet * 1 + 512MB Droplet

    * 1 (to be 2) CoreOS stable ߏ੒؅ཧ: Terraform + cloud-config ΞϓϦέʔγϣϯ: Docker ίϯςφ ֎෦ετϨʔδ: S3 DNS αʔϏε: Route53 ؂ࢹܥ: Datadog, Papertrail
  15. DigitalOcean + CoreOS ap-northeast1 (Tokyo) sgp1 (Singapole) nginx-proxy Web App

    Worker redis postgres dd-agent Web App etcd web db
  16. DigitalOcean + CoreOS ʢཧ૝ʣ ap-northeast1 (Tokyo) sgp1 (Singapole) nginx-proxy Web

    App Worker redis postgres dd-agent load balancer Web App etcd lb web db
  17. CoreOS Droplets web (1GB)
 Web ΞϓϦέʔγϣϯ, Worker db (512MB)
 PostgreSQL,

    Redis σʔλετΞ
 ϗετϚγϯʹσʔλӬଓԽ lb (512MB)
 Route53 ͔ΒͷΞΫηεΛ web ʹதܧ͢Δ
  18. Infrastructure as Code ͢΂ͯͷΠϯϑϥΛίʔυͰ؅ཧ Git ʹΑΔόʔδϣϯ؅ཧɺPull Request ܕ։ൃ CI ΍

    ChatBot ͱ࿈ܞͯ͠ਓͷखΛհ͞ͳ͍
 Πϯϑϥͷߋ৽
  19. Cloud-Config YAML Ͱ CoreOS Λઃఆ Ϣʔβʔ؅ཧ
 Ξοϓσʔτ੍ޚ
 ىಈ͢ΔαʔϏεͷࢦఆ… αʔϏε؅ཧ͸ fleet

    ʹ
 Ҡߦ͢Δ͔΋
  20. None
  21. terraform Hashicorp ϓϩμΫτ
 ઈࢍ։ൃத AWS, DigitalOcean …Λ
 ίʔυͰ؅ཧ͢Δ terraform apply

    Ͱ
 ຊ൪ʹҰൃͰ൓ө
  22. None
  23. AWS ౦ژϦʔδϣϯ͕͋Δ (ap-northeast-1) ଞͷαʔϏε (Route53, ELB, S3…) ͱͷ࿈ܞɺ
 ಉҰϦʔδϣϯͰ૊ΊΔ ϥϯχϯάίετ͕ʢݸਓӡ༻ʹ͸ʣߴ͍

  24. DigitalOcean ϥϯχϯάίετ͕͍҆ సૹྔ 1TB ·Ͱ͸ແྉ ࠷΋ۙͯ͘γϯΨϙʔϧͳͷͰ
 ౦ژͷϚγϯʹൺ΂ϨΠςϯγ͕ൃੜ͢Δ

  25. ݄ʑͷ͓ࢧ෷ྉۚ sakura VPS 2G
 1,552ԁ DigitalOcean 1g*1 + 512mb*2
 20.88

    USD = 2,499ԁ t2.micro*3
 43.9 USD = 5,254ԁ t2.micro*1 + ELB + db.t2.micro + cache.t2.micro
 76.72 USD = 9,179ԁ Πϯελϯε͸੍࣌ؒ՝ۚc"84BQOPSUIFBTUc3PVUFͱ4ͱసૹྔ͸ؚ·ͳ͍
  26. ෭࢈෺ dtan4/c2y
 Cloud-Config Λ Ruby DSL Ͱॻ͘ dtan4/terraforming
 طଘͷϦιʔεΛ terraform

    ܗࣜʹม׵
  27. ·ͱΊ ͘͞Β VPS ຊ౰ʹίεύ͕ྑ͍ AWS ࢖͍͍ͨ… ͢΂ͯͷΞϓϦΛίϯςφԽ͢Δ ·ͩґଘؔ܎ͱϗετΞοϓσʔτͰ
 ফ໣ͯ͠Δͷʁ