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

膨大なサーバ群を制御するソフトウェアと Infrastructure as Code

膨大なサーバ群を制御するソフトウェアと Infrastructure as Code

2016年2月27日(土)のSIGPXの発表資料
http://sigpx.org/

Tsubasa Yumura

February 26, 2016
Tweet

More Decks by Tsubasa Yumura

Other Decks in Programming

Transcript

  1. ๲ େ ͳ α ʔό ܈ Λ ੍ ޚ ͢

    Δ ι ϑ τ ΢ Σ Ξ ͱ I n f r a s t r u c t u re a s C o d e ࠃ ཱ ݚ ڀ ։ ൃ ๏ ਓ ৘ ใ ௨ ৴ ݚ ڀ ػ ߏ ๺ ཮ ઌ ୺ Պ ֶ ٕ ज़ େ ֶ Ӄ େ ֶ ౬ ଜ ཌྷ / Ts u b a s a Y U M U R A @ y u m u 1 9 S I G P X 2 0 1 6 / 0 2 / 2 7
  2. S I G P X 2 0 1 6 /

    0 2 / 2 7 W h o a m I ? 2 • ౬ ଜɹཌྷʢ @yumu19 ʣ • ੴ઒ࡏॅͷࣾձਓֶੜ • ࠃཱݚڀ։ൃ๏ਓ ৘ใ௨৴ݚڀػߏ(NICT)ɹɹɹɹɹɹ ๺཮StarBEDٕज़ηϯλʔ ༗ظٕज़һ • ๺཮ઌ୺Պֶٕज़େֶӃେֶ(JAIST) ത࢜ޙظ՝ఔ
  3. S I G P X 2 0 1 6 /

    0 2 / 2 7 W h o a m I ? • ෺ཧܥ(๺େ ஍ٿՊֶՊ / ౦େ ஍ٿ࿭੕Պֶઐ߈)ग़਎ • ଔۀ͢Δ·ͰFortranҰے • ௒ߴ૚େؾ(ి཭ݍ)ͷϞσϦϯά • Ӊ஦ϓϥζϚதͷߴΤωϧΪʔిࢠՃ଎ϝΧχζϜ 3
  4. S I G P X 2 0 1 6 /

    0 2 / 2 7 W h o a m I ? • ౦ࣳͰεϚʔτϋ΢εͷݚڀ։ൃ • KoozytͰARΞϓϦɺҐஔ৘ใΞϓϦͷ։ൃ • ݚڀɺ։ൃɺӡ༻ • ΫϥΠΞϯτɺαʔόɺΠϯϑϥɺUI 4
  5. S I G P X 2 0 1 6 /

    0 2 / 2 7 W h o a m I ? • PICALA: ௌߨऀͷײ৘Λর໌৭Ͱදݱ͢ΔΠϯλϥΫ ςΟϒͳϓϨθϯςʔγϣϯ 5
  6. S I G P X 2 0 1 6 /

    0 2 / 2 7 W h o a m I ? • ৸ฦΓϒϩοΫͣ͘͠ 6
  7. S I G P X 2 0 1 6 /

    0 2 / 2 7 W h o a m I ? • ͓͏ͪϋοΫಉ޷ձ 7
  8. ๲େͳαʔό܈Λ੍ޚ͢Διϑτ΢ΣΞͱInfrastructure as Code S I G P X 2 0

    1 6 / 0 2 / 2 7 ʢ ௝ ͠ ͘ ʣ ࢓ ࣄ བྷ Έ ͷ ࿩ Λ ͠ · ͢
  9. S I G P X 2 0 1 6 /

    0 2 / 2 7 ๺ ཮ S t a r B E D ٕ ज़ η ϯ λ ʔ • ੈք࠷େن໛ͷωοτϫʔΫςετϕου • 1400୆௒ͷαʔό͕Քಇ 9 http://starbed.nict.go.jp/
  10. S I G P X 2 0 1 6 /

    0 2 / 2 7 S p r i n g O S • StarBEDαʔό܈Λޮ཰తʹར༻͢ΔͨΊͷιϑτ΢ΣΞ܈ • Power Manager: αʔόͷిݯ؅ཧ • Switch Manager: VLANઃఆɺϙʔτઃఆ౳Λ؅ཧ • Experiment Resource Manager: ϊʔυ؅ཧ 10 T. Miyachi, K. Chinen, Y. Shinoda, “StarBED and SpringOS: Large-scale General Purpose Network Testbed and Supporting Software”
  11. S I G P X 2 0 1 6 /

    0 2 / 2 7 11
  12. S I G P X 2 0 1 6 /

    0 2 / 2 7 A W S C L I • Amazon Web ServiceΛCLIͰૢ࡞ • ଞͷΫϥ΢υαʔϏεͰ΋ಉ༷ͷπʔϧ͕͋Δ • Azure CLI (Microsoft Azure) • gcutil (Google Cloud Platform) 12
  13. S I G P X 2 0 1 6 /

    0 2 / 2 7 C h e f • ઃఆϑΝΠϧͷͱ͓ΓαʔόΛߏங͢Δπʔϧ • Ϩγϐ(Ruby)ʹखॱΛهड़(ྉཧͷϝλϑΝʔ) 13    #  Cookbook  Name::  railsapp_cookbook      #  Recipe::  user_ops          user  'ops'  do          action  :create          supports  :manage_home  =>  true          home  "/home/ops"          shell  "/bin/bash"      end   http://easyramble.com/customize-own-chef-cookbooks-recipes.html
  14. S I G P X 2 0 1 6 /

    0 2 / 2 7 A n s i b l e • ઃఆϑΝΠϧͷͱ͓ΓαʔόΛߏங͢Δπʔϧ • ChefʹࣅͯΔ(SSHར༻ͰΤʔδΣϯτϨε) • playbook.ymlʹखॱΛهड़ 14 -­‐  hosts:  test-­‐servers      become:  yes      tasks:          -­‐  name:  be  sure  httpd  is  installed              yum:  name=httpd  state=installed          -­‐  name:  be  sure  httpd  is  running  and  enabled              service:  name=httpd  state=started  enabled=yes   http://yteraoka.github.io/ansible-tutorial/
  15. S I G P X 2 0 1 6 /

    0 2 / 2 7 Va g r a n t • VM(Virtual Box౳)ͷCLIߏ੒؅ཧπʔϧ • ίϚϯυҰͭͰVMΛߏஙͨ͠ΓϩάΠϯͨ͠Γফڈͨ͠ΓͰ͖Δ • Vagrantfileʹαʔόߏ੒Λهड़ 15    config.vm.define  :node1  do  |node|          node.vm.box  =  "centos6"          node.vm.network  :forwarded_port,  guest:  22,  host:  2001,  id:  "ssh"          node.vm.network  :private_network,  ip:  "192.168.33.11"      end      config.vm.define  :node2  do  |node|          node.vm.box  =  "centos6"          node.vm.network  :forwarded_port,  guest:  22,  host:  2002,  id:  "ssh"          node.vm.network  :forwarded_port,  guest:  80,  host:  8000,  id:  "http"          node.vm.network  :private_network,  ip:  "192.168.33.12"      end   http://yteraoka.github.io/ansible-tutorial/
  16. S I G P X 2 0 1 6 /

    0 2 / 2 7 D o c k e r • ίϯςφܕԾ૝Խٕज़ • ϗετͱΧʔωϧΛڞ༗͍ͯ͠ΔͷͰϋΠύʔόΠβ ܕԾ૝Խ(VMware౳)ΑΓ΋ܰྔ • Dockerhub(ϦϙδτϦ) • ΠϝʔδΛpull/push • Dockerfile • هड़ͨ͠ͱ͓ΓʹίϯςφΛߏங • Docker Compose • ෳ਺୆؅ཧ 16
  17. S I G P X 2 0 1 6 /

    0 2 / 2 7 I n f r a s t r u c t u re a s C o d e • Πϯϑϥ(αʔό)؀ڥઃఆΛίʔυͰهड़ • खॱॻɺൿ఻ͷλϨ(γΣϧεΫϦϓτ)͔Βͷ୤٫ • ႈ౳ੑ(΂͖ͱ͏͍ͤ)ɿԿճ΍ͬͯ΋ಉ݁͡ՌʹͳΔ • ChefɺVagrant͕޿·͖ͬͯͨ2012೥ࠒ͔Βҙࣝ͞Ε ͩͨ͠(ݸਓͷײ૝Ͱ͢) 17
  18. S I G P X 2 0 1 6 /

    0 2 / 2 7 I n f r a s t r u c t u re a s C o d e • πʔϧͷ෼ྨ • Bootstrap(ىಈ/ߏ੒؅ཧ) • Configuration(ઃఆ) • Orchestration(શମ؅ཧ) 18
  19. S I G P X 2 0 1 6 /

    0 2 / 2 7 I n f r a s t r u c t u re a s C o d e • Immutable Infrastructure • Immutable: ෆมͷ • ex. Immutable Array • ෆมͷΠϯϑϥ • มߋΛՃ͑Δ৔߹͸ɺΠϯϑϥΛ௚઀मਖ਼ͤͣʹίʔυΛ मਖ਼ͯ͠࡞Γͳ͓͢ • Ծ૝ԽͷීٴɺAWSͳͲͷIaaSɺCIͱͷ૬ੑ 19
  20. S I G P X 2 0 1 6 /

    0 2 / 2 7 S D N • Software Defined Network • ωοτϫʔΫػث(εΠονɾϧʔλ)ͷॲཧΛίʔυ Ͱهड़ • OpenFlow͕༗໊ͳن֨ 20
  21. S I G P X 2 0 1 6 /

    0 2 / 2 7 S O R A C O M • IoTσόΠε޲͚σʔλ௨৴αʔϏεϓϥοτϑΥʔϜ • ௨৴ͷैྔ՝ۚ • SIM1ຕ͝ͱʹLTEճઢͷ੍ޚ • ҉߸ԽαʔϏε΍ೝূαʔϏε౳ͷఏڙ 21
  22. S I G P X 2 0 1 6 /

    0 2 / 2 7 ͓ Θ Γ ʹ • ϓϩάϥϜ͕ର৅ͱ͢ΔྖҬͷ֦େ 22 while(true)      printf  “Hello”   end ܭࢉػ಺ ܭࢉػϦιʔεࣗମ Program the Real World ܭࢉػͷ֎ͷੈք