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

グリーにおけるChef導入事例 ~既存の資産を活かし新しい技術を導入する~

Ryota Arai
February 13, 2014

グリーにおけるChef導入事例 ~既存の資産を活かし新しい技術を導入する~

Ryota Arai

February 13, 2014
Tweet

More Decks by Ryota Arai

Other Decks in Programming

Transcript

  1. Copyright © GREE, Inc. All Rights Reserved. ࣗݾ঺հ ߥҪྑଠ άϦʔגࣜձࣾ

    ։ൃ౷ׅຊ෦ ΠϯϑϥετϥΫνϟຊ෦ ! 5XJUUFS!SZPU@B@SBJ Advent Calendar ॻ͖·ͨ͠
  2. Copyright © GREE, Inc. All Rights Reserved. ࣭໰Ͱ͢ • $IFGΛ஌͍ͬͯΔ

    • $IFGΛ࢖ͬͨ͜ͱ͕͋Δ • $IFGΛ࢓ࣄͰ࢖͍ͬͯΔ
  3. Copyright © GREE, Inc. All Rights Reserved. $IFGͱ͸ • αʔόͷߏங΍ઃఆߋ৽ΛࣗಈԽ͢Δπʔϧ

    • ྫBQBDIFΛΠϯετʔϧͯ͠ɺIUUQEDPOGΛߋ৽͢Δ • αʔόͷ͋Δ΂͖࢟Λ3VCZͰهड़͓ͯ͘͠ͱɺ
 ͦͷ࢟ʹηοτΞοϓͯ͘͠ΕΔ • Ϩγϐ • ͍ΘΏΔ*OGSBTUSVDUVSFBT$PEF • ႈ౳ੑ • Կ౓࣮ߦͯ͠΋ɺಉ͡αʔόʹͳΔ • .VUBCMF*OGSBTUSVDUVSFͱ૬ੑྑ͍ • $IFGࣾͷ044
  4. Copyright © GREE, Inc. All Rights Reserved. $IFGͱ͸ BQBDIFΛΠϯετʔϧ QBDLBHFBQBDIFEP

    BDUJPOJOTUBMM FOE ! BQBDIFΛελʔτ TFSWJDFBQBDIFEP TVQQPSUTSFMPBEUSVF BDUJPOTUBSU FOE ! BQBDIFDPOGΛςϯϓϨʔτ͔Βੜ੒ ͦͷޙɺBQBDIFΛϦϩʔυ UFNQMBUFFUDBQBDIFBQBDIFDPOGEP BDUJPODSFBUF OPUJpFTSFMPBE TFSWJDF<BQBDIF> FOE Ϩγϐʢʹ͋Δ΂͖࢟ʣͷྫ
  5. Copyright © GREE, Inc. All Rights Reserved. Α͋͘Δޫܠ ϓϩμΫτ୲౰ऀ ӡ༻୲౰ऀ

    खॱॻ TTIUIFTFSWFS TVEPBQUHFUJOTUBMMʜ TVEPWJNFUDʜ ʜ
  6. Copyright © GREE, Inc. All Rights Reserved. Α͋͘Δޫܠ ϓϩμΫτ୲౰ऀ ӡ༻୲౰ऀ

    खॱॻ TTIUIFTFSWFS TVEPBQUHFUJOTUBMMʜ TVEPWJNFUDʜ ʜ
  7. Copyright © GREE, Inc. All Rights Reserved. ಋೖഎܠ • ඇޮ཰

    • $IFGʹΑΓࣗಈԽ͠ɺޮ཰ԽΛਤΔ • ΦϖϨʔγϣϯϛεͷةݥ • $IFGʹΑΓࣗಈԽ͠ɺ҆ఆӡ༻Λ໨ࢦ͢ • ʮਓؒͷ஫ҙྗʹ͸ݶք͕͋ΓɺͲΜͳʹ஫ҙਂ͍৻ॏͳਓͰ͋ͬͯ΋ɺർ࿑΍ ࡨ֮ͳͲͰώϡʔϚϯΤϥʔΛى͜͢৔߹͕͋Δɻʯʢ8JLJQFEJBʣ • ϦʔυλΠϜ • $IFGʹΑΓࣗಈԽ͠ɺαʔόͷσϦόϦʔΛૉૣ͘ߦ͏
  8. Copyright © GREE, Inc. All Rights Reserved. #FGPSF$IFG • %FCJBOύοέʔδ

    • αʔόͷ໾ׂ͝ͱͷϝλύοέʔδ • ઃఆϑΝΠϧ͸εΫϦϓτͰੜ੒ • QPTUJOTU Πϯετʔϧޙʹ࣮ߦ͞ΕΔεΫϦϓτʣ • ઃఆ஋ • ύοέʔδ಺ • αʔό؅ཧγεςϜʹ໰͍߹Θͤ
  9. Copyright © GREE, Inc. All Rights Reserved. #FGPSF$IFG αʔό؅ཧ γεςϜ

    ߏஙର৅ͷαʔό ύοέʔδαʔό ύοέʔδ ύοέʔδ ύοέʔδ εΫϦϓτ ઃఆϑΝΠϧ ΦϖϨʔλ
  10. Copyright © GREE, Inc. All Rights Reserved. #FGPSF$IFG αʔό؅ཧ γεςϜ

    ߏஙର৅ͷαʔό ύοέʔδαʔό ύοέʔδ ύοέʔδ ύοέʔδ εΫϦϓτ ઃఆϑΝΠϧ ઃఆߋ৽ ΦϖϨʔλ
  11. Copyright © GREE, Inc. All Rights Reserved. #FGPSF$IFG αʔό؅ཧ γεςϜ

    ߏஙର৅ͷαʔό ύοέʔδαʔό ύοέʔδ ύοέʔδ ύοέʔδ εΫϦϓτ ઃఆϑΝΠϧ ઃఆߋ৽ apt-get install … ΦϖϨʔλ
  12. Copyright © GREE, Inc. All Rights Reserved. #FGPSF$IFG αʔό؅ཧ γεςϜ

    ߏஙର৅ͷαʔό ύοέʔδαʔό ύοέʔδ ύοέʔδ ύοέʔδ εΫϦϓτ ઃఆϑΝΠϧ ઃఆߋ৽ apt-get install … ΦϖϨʔλ
  13. Copyright © GREE, Inc. All Rights Reserved. #FGPSF$IFG αʔό؅ཧ γεςϜ

    ߏஙର৅ͷαʔό ύοέʔδαʔό ύοέʔδ ύοέʔδ ύοέʔδ εΫϦϓτ ઃఆϑΝΠϧ ઃఆߋ৽ apt-get install … ΦϖϨʔλ αʔό؅ཧ γεςϜ
  14. Copyright © GREE, Inc. All Rights Reserved. αʔό؅ཧγεςϜ • ࣾ಺ͷαʔό৘ใΛ؅ཧ͍ͯ͠ΔγεςϜ

    • αʔό໊ɺσʔληϯλʔɺαʔόͷঢ়ଶʢߏஙதɺຊ൪ӡ༻தɺ ނোதͳͲʣɺͲͷϓϩμΫτͰར༻͞Ε͍ͯΔ͔ɺͳͲ • ӡ༻εΫϦϓτɾπʔϧ͕ґଘ͍ͯ͠Δ • %FCJBOύοέʔδ͕ґଘ͍ͯ͠Δ
  15. Copyright © GREE, Inc. All Rights Reserved. ಋೖํ਑ • ৽نͷαʔόΛ$IFGͰߏங͍ͯ͘͠

    • ߏஙࡁΈαʔόΛ$IFGͰߋ৽͢Δ͜ͱ͸ɺةݥͱ൑அ
 ʢαʔό͕ͲͷΑ͏ͳঢ়ଶ͔͕ෆ໌ʣ • طଘͷαʔό؅ཧγεςϜΛར༻͢Δ • $IFGͰߏங͍ͯ͠ͳ͍αʔό΋ฒߦӡ༻͢Δ • ӡ༻εΫϦϓτ͕αʔό؅ཧγεςϜʹґଘ͍ͯ͠Δ • ӡ༻खॱ͕αʔό؅ཧγεςϜʹґଘ͍ͯ͠Δ • ࠞཚΛආ͚ΔͨΊɺେ͖͘มߋ͢Δ͜ͱ͸ආ͚͍ͨ • طଘͷπʔϧɾεΫϦϓτ͕ಈ͘ঢ়ଶͰҠߦ͢Δ
  16. Copyright © GREE, Inc. All Rights Reserved. $IFG0WFSWJFX web ϩʔϧ

    apache ΫοΫϒοΫ php ΫοΫϒοΫ ϊʔυʢߏஙର৅αʔόʣ
  17. Copyright © GREE, Inc. All Rights Reserved. $IFG0WFSWJFX web ϩʔϧ

    apache ΫοΫϒοΫ php ΫοΫϒοΫ ϊʔυͷଐੑ ྫ: ͜ͷαʔό͸Webαʔό ϙʔτ͸8080 ϊʔυʢߏஙର৅αʔόʣ
  18. Copyright © GREE, Inc. All Rights Reserved. $IFG0WFSWJFX web ϩʔϧ

    apache ΫοΫϒοΫ php ΫοΫϒοΫ ϊʔυͷଐੑ ྫ: ͜ͷαʔό͸Webαʔό ϙʔτ͸8080 SSH ϊʔυʢߏஙର৅αʔόʣ
  19. Copyright © GREE, Inc. All Rights Reserved. $IFG0WFSWJFX web ϩʔϧ

    apache ΫοΫϒοΫ php ΫοΫϒοΫ ϊʔυͷଐੑ ྫ: ͜ͷαʔό͸Webαʔό ϙʔτ͸8080 SSH ϊʔυʢߏஙର৅αʔόʣ
  20. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP$IFG4FSWFS Chef Solo

    web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ Chef Server ϊʔυ ϊʔυ Chef Server Chef Solo Chef Client Chef Client Chef Client
  21. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP$IFG4FSWFS Chef Solo

    web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ ϊʔυͷଐੑ web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ Chef Server ϊʔυ ϊʔυ Chef Server Chef Solo Chef Client Chef Client Chef Client
  22. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP$IFG4FSWFS Chef Solo

    web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ ϊʔυͷଐੑ web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ ϊʔυͷଐੑ Chef Server ϊʔυ ϊʔυ Chef Server Chef Solo Chef Client Chef Client Chef Client
  23. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP$IFG4FSWFS Chef Solo

    web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ ϊʔυͷଐੑ web ϩʔϧ ΫοΫϒοΫ ΫοΫϒοΫ ϊʔυͷଐੑ ϊʔυͷଐੑ Chef Server ϊʔυ ϊʔυ Chef Server Chef Solo Chef Client Chef Client Chef Client
  24. Copyright © GREE, Inc. All Rights Reserved. $IFG4FSWFSΛ΍Ίͨཧ༝ • ୯Ұো֐఺ʹͳΔ

    • ৑௕ߏ੒͸αϙʔτ͞Ε͍ͯͳ͍ʢ༗ঈͩͱͰ͖Δ໛༷ʣ • αʔό؅ཧ͕ॏෳ͢Δ • $IFG4FSWFS͸αʔό؅ཧͷ໾ׂΛ୲͏ • طଘͷαʔό؅ཧγεςϜͱ໾ׂ͕ॏෳ͢Δ • ӡ༻ • ଟ਺ͷιϑτ΢ΣΞΛ࢖͍ͬͯΔʢ݁ߏϔϏʔʣ • ʢ&SMBOHΛ࢖͑Δਓ͕͍ͳ͍ʣ • $IFG4FSWFS͸&SMBOH → Chef Solo + α
  25. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP Ћ ΫοΫϒοΫ

    ϊʔυͷଐੑ Chef Solo ϊʔυ ʢߏஙର৅αʔόʣ ϩʔϧ
  26. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP Ћ αʔό؅ཧγεςϜ

    ʁ ΫοΫϒοΫ ϊʔυͷଐੑ Chef Solo ϊʔυ ʢߏஙର৅αʔόʣ ϩʔϧ
  27. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP $IFG#SJEHF ϊʔυ

    ʢߏஙର৅αʔόʣ αʔό؅ཧγεςϜ ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ GREE Chef Client ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ Chef Bridge Chef Solo ಺੡ ಺੡ Chef Bridge nginx
  28. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP $IFG#SJEHF ϊʔυ

    ʢߏஙର৅αʔόʣ αʔό؅ཧγεςϜ ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ GREE Chef Client ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ Chef Bridge Chef Solo ಺੡ ಺੡ Chef Bridge nginx
  29. Copyright © GREE, Inc. All Rights Reserved. $IFG#SJEHF • ී௨ͷ3VCZPO3BJMTΞϓϦέʔγϣϯ

    • ಺੡ͷ؆қ$IFG4FSWFSͷΑ͏ͳ΋ͷ • ϊʔυͷઃఆɺΫοΫϒοΫɺϩʔϧΛ؅ཧ • )551"1* • ࠷খݶ • ಡΈऔΓͷΈ • αʔό؅ཧγεςϜ΁ͷ໰͍߹ΘͤΛߦ͏ • $IFG4PMPͰ͸OPEF<HSFF><EBUB@DFOUFS>
 ͳͲͱࢀরͰ͖Δ
  30. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP $IFG#SJEHF ϊʔυ

    ʢߏஙର৅αʔόʣ αʔό؅ཧγεςϜ ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ GREE Chef Client ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ Chef Bridge Chef Solo ಺੡ ಺੡ Chef Bridge nginx
  31. Copyright © GREE, Inc. All Rights Reserved. $IFG4PMP $IFG#SJEHF ϊʔυ

    ʢߏஙର৅αʔόʣ αʔό؅ཧγεςϜ ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ GREE Chef Client ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ Chef Bridge Chef Solo ಺੡ ಺੡ Chef Bridge nginx
  32. Copyright © GREE, Inc. All Rights Reserved. (3&&$IFG$MJFOU • $IFG4PMPͷϥούʔ

    • ͳʹΛߦ͏͔ • $IFG#SJEHF͔Βඞཁͳ΋ͷΛऔಘ • ϊʔυͷଐੑɺΫοΫϒοΫɺϩʔϧ • $IFG4PMPΛ࣮ߦ͢Δ • ࣗಈςετʢޙड़ʣ • ਖ਼ৗʹηοτΞοϓͰ͖͍ͯΔ͔Ͳ͏͔Λ֬ೝ
  33. Copyright © GREE, Inc. All Rights Reserved. $IFG#SJEHFWT$IFG4FSWFS $IFG#SJEHF $IFG4FSWFS

    ৑௕ੑ ˓ ෳ਺୆ߏ੒Մೳ ˚ αϙʔτ͞Ε͍ͯͳ͍ ӡ༻͠΍͢͞ ˓ ௨ৗͷ3P3ΞϓϦ ˚ "1* ˚ 3FBE0OMZ ࠷খݶ ˓ 3FBE8SJUF طଘͷαʔό؅ཧ γεςϜ ͱͷ૊Έ߹Θͤ ˓ γʔϜϨε ˚
  34. Copyright © GREE, Inc. All Rights Reserved. $IFG0WFSWJFX web ϩʔϧ

    apache ΫοΫϒοΫ php ΫοΫϒοΫ ϊʔυͷଐੑ ྫ: ͜ͷαʔό͸Webαʔό ϙʔτ͸8080
  35. Copyright © GREE, Inc. All Rights Reserved. ίϛϡχςΟΫοΫϒοΫʁ • ΦʔϓϯιʔεͳΫοΫϒοΫ

    • ඇৗʹ൚༻తʹ࡞ΒΕ͍ͯΔ • ༷ʑͳ04ɺ؀ڥͰ͏͘͝Α͏ʹ • ݁ՌɺෳࡶʹͳΓ͕ͪʜ • ࢖͍͜ͳ͢ͷ͸೉͍͠ • جຊతʹࣗࣾͰΫοΫϒοΫΛ࡞੒͍ͯ͠Δ • ίϛϡχςΟΫοΫϒοΫ͸͋·Γར༻͍ͯ͠ͳ͍
  36. Copyright © GREE, Inc. All Rights Reserved. $IFGೖ໳ • $IFG͸࠷ۙग़͖ͯͨπʔϧ

    • $IFG͸ֶशίετ͕ߴ͍ͱ͍ΘΕΔ • ͔֬ʹߴ͍ͱࢥ͏ • $IFG࢖͍ΛҭͯΔඞཁ͕͋Δ
  37. Copyright © GREE, Inc. All Rights Reserved. $IFGೖ໳ • ೖ໳$IFG4PMPʢҏ౻௚໵ஶʣ

    • ॳ৺ऀ$IFGΞϯνύλʔϯCZ+VMJBO%VOO • ࣾ಺༻νϡʔτϦΞϧ • ΫοΫϒοΫΛͭ࡞Δ • ެࣜυΩϡϝϯτ • EPDTPQTDPEFDPN • ಛʹSFTPVSDFT Chef ࢖͍Λཆ੒͢Δ
  38. Copyright © GREE, Inc. All Rights Reserved. ΫοΫϒοΫͷ։ൃ • ςετΛॻ͘

    • (JU)VC1VMM3FRVFTU • ܧଓతΠϯςάϨʔγϣϯ
  39. Copyright © GREE, Inc. All Rights Reserved. ΫοΫϒοΫͷ։ൃ • ςετΛॻ͘

    • (JU)VC1VMM3FRVFTU • ܧଓతΠϯςάϨʔγϣϯ
  40. Copyright © GREE, Inc. All Rights Reserved. ςετ • ΫοΫϒοΫʹ͸ςετΛඞͣॻ͘

    • TFSWFSTQFD5FTU,JUDIFO • ϒϥοΫϘοΫεςετ • DIFGTQFD • ϗϫΠτϘοΫεςετ • 'PPEDSJUJD • -JOU
  41. Copyright © GREE, Inc. All Rights Reserved. ͦ΋ͦ΋ɺͳͥςετΛॻ͘ͷ͔ • ։ൃΛޙԡ͢͠Δ

    • 5%%తͳ • $IFGΛ࣮ߦˠ44)ͰϩάΠϯˠ
 ͪΌΜͱઃఆ͞Ε͍ͯΔ͔֬ೝˠ࠶౓ΫοΫϒοΫΛमਖ਼
 ˠ܁Γฦ͠ • ϦάϨογϣϯΛ๷͙ • υΩϡϝϯτ୅ΘΓ • ߏஙޙͷ͕࢟Θ͔Γ΍͍͢ • ຊ൪αʔόͷߏஙςετ • ຊ൪؀ڥͰ$IFGΛ࣮ߦͨ͋͠ͱʹςετ͢Δ
  42. Copyright © GREE, Inc. All Rights Reserved. ςετ • ΫοΫϒοΫʹ͸ςετΛඞͣॻ͘

    • TFSWFSTQFD5FTU,JUDIFO • ϒϥοΫϘοΫεςετ • DIFGTQFD • ϗϫΠτϘοΫεςετ • 'PPEDSJUJD • -JOU
  43. Copyright © GREE, Inc. All Rights Reserved. TFSWFSTQFD • αʔόͷ͋Δ΂͖ঢ়ଶΛهड़

    ͯ͠ʢςετέʔεʣͦͷঢ় ଶʹͳ͍ͬͯΔ͔Λςετ͢ Δπʔϧ • ྫ
 ʮ.Z42-͕ಈ͍͍ͯΔ͔ʯ
 ʮઃఆϑΝΠϧ͕ద੾ʹ
 ੜ੒͞Ε͍ͯΔ͔ʯ describe package('mysql-server') do it { should be_installed } end ! describe service('mysql') do it { should be_running } end ! describe port(3306) do it { should be_listening } end ! describe file('/etc/my.cnf') do it { should be_file } it { should_not contain "mysqld_multi" } it { should_not contain "skip-innodb" } it { should contain "port = 3306" } end Vagrant (VirtualBox) Chef ςετ (via SSH) serverspec ΫοΫϒοΫ
  44. Copyright © GREE, Inc. All Rights Reserved. 5FTU,JUDIFO • ςετର৅ͷ؀ڥΛهड़͠


    ͦͷ؀ڥͰςετͰ͖Δ • ෳ਺ͷ։ൃऀ͕ಉ͡؀ڥͰ
 ςετΛߦ͑Δ --- driver: name: vagrant ! platforms: - name: ubuntu-13.04 - name: centos-6.5 ! suites: - name: client run_list: - recipe[postgresql::client] - name: server run_list: - recipe[postgresql::server] $ kitchen test client-ubuntu $ kitchen test server-ubuntu $ kitchen test client-centos $ kitchen test server-centos Vagrant (VirtualBox) ᶄChef ᶅςετ (via SSH) Test Kitchen ᶃVM ͷ࡞੒ serverspec ΫοΫϒοΫ
  45. Copyright © GREE, Inc. All Rights Reserved.  +FOLJOTαʔόʹܨ͕Βͳ͘ͳͬͨ໰୊ •

    ͋Δ೔ɺ+FOLJOTαʔόʹܨ͕Βͳ͘ͳͬͨ • ݪҼωοτϫʔΫͷϧʔςΟϯά͕มΘͬͨ • 7JSUVBM#PYͷ)PTU0OMZ/FUXPSL • 7.͚ͩͷωοτϫʔΫ͕ͭ͘ΕͨΒʜ • ͍ͭͰʹΫοΫϒοΫ͝ͱʹωοτϫʔΫΛ෼͚ΒΕͨΒ
 *1ΞυϨεͷ͜ͱؾʹ͠ͳͯ͘ࡁΉʜ
  46. Copyright © GREE, Inc. All Rights Reserved.  +FOLJOTαʔόʹܨ͕Βͳ͘ͳͬͨ໰୊ •

    7JSUVBM#PYͷ*OUFSOBM/FUXPSLΛ࢖ͬͯ
 ωοτϫʔΫΛ෼͚Δ platforms: - name: gree-ubuntu-12.04 driver_config: network: - ["private_network", {ip: "192.168.10.44", virtualbox__intnet: "mysql-cookbook"}] Test Kitchen Ͱ Internal Network Λ࢖͏ྫ ʢmysql-cookbook ༻ͷωοτϫʔΫ͕Ͱ͖Δʣ Host VM VM VM VM VM
  47. Copyright © GREE, Inc. All Rights Reserved.  .VUBCMF*OGSBTUSVDUVSF໰୊ •

    .VUBCMF*OGSBTUSVDUVSF
 ܁Γฦ͠αʔόʹมߋΛՃ͑ΔΠϯϑϥ • $IFGͰԿ౓΋ߋ৽͕܁Γฦ͞ΕΔՄೳੑ͕͋Δ • θϩ͔Β$IFGͰηοτΞοϓͨ͠αʔόͱ
 ಉ͡ʹͳΔอূ͸ͳ͍ • TFSWFSTQFDΛຊ൪αʔόʹ࣮ߦ͢Δ͜ͱͰɺ
 ਖ਼ৗʹߋ৽͞Ε͍ͯΔ͜ͱΛ֬ೝ͍ͯ͠Δ • (3&&$IFG$MJFOU͕ࣗಈతʹߦ͏
  48. Copyright © GREE, Inc. All Rights Reserved.  .VUBCMF*OGSBTUSVDUVSF໰୊ •

    Ϩγϐ͝ͱʹTQFDϑΝΠϧΛͭ͘Δ • DMJFOUϨγϐˠDMJFOU@TQFDSC • ͦͷαʔόͰར༻͞Ε͍ͯΔϨγϐʹରԠ͢Δ
 TQFDϑΝΠϧΛ࣮ߦ͢Δ
  49. Copyright © GREE, Inc. All Rights Reserved.  ςετʹ͕͔͔࣌ؒΔ໰୊ •

    ࡉ͔͘ςετΛճ͞ͳ͘ͳΔ • 5%%తͳ։ൃ͕΍ΓͮΒ͘ͳΔ • ςετέʔεΛߜͬͨΓ͢Δ • ໢ཏੑ͕མͪΔ • σϓϩΠʹ͕͔͔࣌ؒΔ
 ʢσϓϩΠલʹ͸ςετ͕૸Δʣ • ςετΛεΩοϓͯ͠σϓϩΠͨ͠Γʜ ςετʹ͕͔͔࣌ؒΔͱ…
  50. Copyright © GREE, Inc. All Rights Reserved.  ςετʹ͕͔͔࣌ؒΔ໰୊ •

    7.ͷ४උ • 7.ΛϩʔϧόοΫ • TBIBSB • 5FTU,JUDIFOυϥΠόʔ • -9$ %PDLFS • $IFGͷ࣮ߦ • ͕͔͔࣌ؒ͜͜Δ VM ͷ४උ Chef ͷ࣮ߦ ϛυϧ΢ΣΞͷ ΠϯετʔϧͳͲ ςετ (Serverspec)
  51. Copyright © GREE, Inc. All Rights Reserved. ςετ • ΫοΫϒοΫʹ͸ςετΛඞͣॻ͘

    • 4FSWFSTQFD5FTU,JUDIFO • ϒϥοΫϘοΫεςετ • $IFGTQFD • ϗϫΠτϘοΫεςετ • 'PPEDSJUJD • -JOU
  52. Copyright © GREE, Inc. All Rights Reserved. $IFGTQFD • DIFGTQFD͸$IFG༻ͷ


    ϢχοτςεςΟϯά
 ϑϨʔϜϫʔΫ • ओʹɺσϑΥϧτ஋ͷςετ
 Λॻ͍͍ͯΔ • ৚݅͝ͱͷ஋Λςετ • 7.Λར༻͠ͳ͍ͷͰૣ͍ • TFSWFSTQFDͱඃΔ෦෼͸
 ॻ͔ͳ͍ describe "node['apache']['port']" do context "when node['apache']['port'] is nil" do let(:attributes) do {} end it "returns default port number" do expect(chef_run.node['apache'] ['port']).to eq(80) end end end
  53. Copyright © GREE, Inc. All Rights Reserved. ςετ • ΫοΫϒοΫʹ͸ςετΛඞͣॻ͘

    • 4FSWFSTQFD5FTU,JUDIFO • ϒϥοΫϘοΫεςετ • $IFGTQFD • ϗϫΠτϘοΫεςετ • 'PPEDSJUJD • -JOU
  54. Copyright © GREE, Inc. All Rights Reserved. 'PPEDSJUJD • ΫοΫϒοΫͷ-JOUπʔϧ

    • ΫοΫϒοΫʹ౷ҰײΛ࣋ͨͤΔ • ಉ͜͡ͱ͢Δͷʹෳ਺ͷॻ͖ํ͕͋Δ • ϧʔϧʹै͍ͬͯͳ͍ͱܯࠂ͕ग़Δ
  55. Copyright © GREE, Inc. All Rights Reserved. ΫοΫϒοΫͷ։ൃ • ςετΛॻ͘

    • (JU)VC1VMM3FRVFTU • ܧଓతΠϯςάϨʔγϣϯ
  56. Copyright © GREE, Inc. All Rights Reserved. (JU)VC • 1VMM3FRVFTUͰมߋΛ౤͛Δ

    • NBTUFSʹ௚઀QVTIͨ͠Γ͠ͳ͍ • <8*1>Ͱ1VMM3FRVFTUΛ౤͛Δ
  57. Copyright © GREE, Inc. All Rights Reserved. (JU)VC • มߋʹର͢Δςετ͕ύε͍ͯ͠Δ͜ͱΛ֬ೝ

    • +FOLJOT • 1VMM3FRVFTU্Ͱٞ࿦ • มߋͷཧ༝΍มߋʹର͢Δٞ࿦͕࢒Δ • ʮͳΜͰɺ͜ͷ஋มߋ͞ΕͯΔΜͩΖ͏ʯ • νϟοτʹ௨஌ • (JU)VCͷ/PUJpDBUJPOʹؾ͔ͮͳ͍ਓ΋͍Δ
  58. Copyright © GREE, Inc. All Rights Reserved. ܧଓతΠϯςάϨʔγϣϯʢ$*ʣ • +FOLJOTΛར༻ͯ͠$*

    • σϓϩΠ·ͰࣗಈͰߦΘΕΔ • (JU)VCʹQVTI • +FOLJOT͕ςετ • +FOLJOT͕σϓϩΠ GitHub Jenkins Chef Bridge push ςετ σϓϩΠ
  59. Copyright © GREE, Inc. All Rights Reserved. ϊʔυͷଐੑ • ͲͷΫοΫϒοΫΛར༻͢Δ͔

    • ͲͷϩʔϧΛར༻͢Δ͔ • ߏஙର৅αʔόͷઃఆ஋ • "QBDIFͷϙʔτ൪߸ɺ4FSWFS/BNF • .Z42-ͷόΠϯυ͢ΔΞυϨεɺϙʔτ൪߸ɺEBUBEJS
  60. Copyright © GREE, Inc. All Rights Reserved. ϊʔυͷଐੑ • ͲͷΫοΫϒοΫΛར༻͢Δ͔

    • ͲͷϩʔϧΛར༻͢Δ͔ • ߏஙର৅αʔόͷઃఆ஋ • "QBDIFͷϙʔτ൪߸ɺ4FSWFS/BNF • .Z42-ͷόΠϯυ͢ΔΞυϨεɺϙʔτ൪߸ɺEBUBEJS
  61. Copyright © GREE, Inc. All Rights Reserved. ϊʔυͷଐੑͷόϦσʔγϣϯ • ϊʔυઃఆͷόϦσʔγϣϯ

    • ඞཁͳϊʔυͷઃఆ஋͸ΫοΫϒοΫʹΑͬͯҟͳΔ • BQBDIFͳΒϙʔτ൪߸ɺNZTRMͳΒόοϑΝϓʔϧ αΠζɺͳͲ • ઃఆ஋͕ద੾ʹઃఆ͞Ε͍ͯΔ͔ΛνΣοΫ • ΫοΫϒοΫʹόϦσʔγϣϯϧʔϧΛಉࠝ • ϊʔυͰར༻͞Ε͍ͯΔΫοΫϒοΫͷϧʔϧΛ
 ಡΈࠐΉ
  62. Copyright © GREE, Inc. All Rights Reserved. ϊʔυͷଐੑͷόϦσʔγϣϯ object do

    object "apache" do string "dir" array("listen_ports") { integer(minimum: 0, maximum: 65535) } end end { "apache": { "dir": "/var/www", "listen_ports": [80] } } { "apache": { "listen_ports": [-1] } } ਖ਼͍͠ ޡΓ [missing_property][at apache] Missing required property: dir [minimum][at apache/ listen_ports] Value -1 is less than or equal to 0 Τϥʔͳ͠ όϦσʔγϣϯϧʔϧ
  63. Copyright © GREE, Inc. All Rights Reserved. ϊʔυͷଐੑͷڞ௨Խ • ෳ਺ͷϊʔυͰڞ௨ͷઃఆ͕ग़ͯ͘Δ

    • ॏෳ͢Δهड़͕૿͑Δ • मਖ਼࿙ΕͳͲʹͭͳ͕Γ͕ͪ • ڞ௨෦෼ΛҰՕॴʹॻ͚ΔΑ͏ʹ • ϊʔυઃఆ͸:".-Ͱॻ͘ • $IFGʹ౉Δલʹ+40/ʹม׵͍ͯ͠Δ • :".-ͷΞϯΧʔͱࢀর • ΞϯΧʔ͸ࣗಈతʹੜ੒͞ΕΔ • ϧʔϧʹ͕ͨͬͯ͠ɺࢀরΛॻ͘
  64. Copyright © GREE, Inc. All Rights Reserved. શମ૾ αʔό؅ཧγεςϜ ΫοΫϒοΫ

    ϊʔυͷଐੑ ϩʔϧ GREE Chef Client ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ Chef Bridge Chef Solo nginx Jenkins GitHub
  65. Copyright © GREE, Inc. All Rights Reserved. ӡ༻͍ͯ͘͠ͱ • ো֐͕ൃੜͨ͠Γ

    • αʔόʹෆ۩߹͕ͰͨΓʜ • ͲΜͳઃఆͰߏங͚ͨͬ͠ʜ • ߏங࣌ʹมͳϩάग़ͯͳ͔͔ͬͨͳʜ • ͍ͭߋ৽͚ͨͬ͠ʜ
  66. Copyright © GREE, Inc. All Rights Reserved. ӡ༻͍ͯ͘͠ͱ • ো֐͕ൃੜͨ͠Γ

    • αʔόʹෆ۩߹͕ͰͨΓʜ • ͲΜͳઃఆͰߏங͚ͨͬ͠ʜ • ߏங࣌ʹมͳϩάग़ͯͳ͔͔ͬͨͳʜ • ͍ͭߋ৽͚ͨͬ͠ʜ ߏஙϩά͕ݟ͍ͨ
  67. Copyright © GREE, Inc. All Rights Reserved. ϩά • ࣮ߦϩά͸ࣗಈͰ%#ʹอଘ͞ΕΔ

    • 8FC6*͔ΒӾཡՄೳ • ϊʔυʹ͸ϩάΛอଘͤͣɺεςʔτϨεʹ • *NNVUBCMFͳੈք΁ߦ͖͍ͨͱ͍͏ࢥ͍
  68. Copyright © GREE, Inc. All Rights Reserved. ϩά • $IFGͷ3FQPSU)BOEMFSΛ


    ར༻ͯ͠ϩάΛૹ৴ Chef Report / Exception Handler Fluentd MongoDB Ruby on Rails
  69. Copyright © GREE, Inc. All Rights Reserved. શମ૾ αʔό؅ཧγεςϜ ΫοΫϒοΫ

    ϊʔυͷଐੑ ϩʔϧ GREE Chef Client ΫοΫϒοΫ ϊʔυͷଐੑ ϩʔϧ Chef Bridge Chef Solo nginx Jenkins GitHub DB ϩά
  70. Copyright © GREE, Inc. All Rights Reserved. ·ͱΊ άϦʔʹ$IFGΛಋೖ͢Δ্Ͱ ࣮ફͨ͠ϓϥΫςΟεΛ঺հ͠·ͨ͠

    ! ࢀߟʹͳͬͨͱ͜Ζ͕ͻͱͭͰ΋͋Ε͹޾͍Ͱ͢ ! ҆ఆͨ͠ΠϯϑϥΛεϐʔσΟʹఏڙͰ͖ΔΑ͏ʹ ܧଓతʹվળ͍͖ͯ͠·͢