Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Puppet & Chef
Search
Shinya Tsunematsu
June 21, 2013
Programming
12
3.6k
Puppet & Chef
新卒研修でやった座学の内容。
既に Puppet & serverspec で研修を進めていたので、まとめと周辺知識の関連付け。
Shinya Tsunematsu
June 21, 2013
Tweet
Share
More Decks by Shinya Tsunematsu
See All by Shinya Tsunematsu
GMOペパボでのSREの実践 / SRE Practices of GMO Pepabo, Inc.
tnmt
3
4.4k
ペパボサービスインフラの今までこれから / pepabo infra past and future
tnmt
3
640
知らなかった、時に困るWebサービスのセキュリティ対策 / Where Do We Start With Information Security?
tnmt
19
9.1k
IaaSをいじっている人が PaaSについて考えたこと / Should We Prepare Own PaaS?
tnmt
5
2.1k
成長を支援する “ふりかえり”の技術 / How to lockback using "furik"
tnmt
7
1.5k
こんにちわ福岡 / hello-fukuoka
tnmt
0
1.2k
Inside Nyah & Future - A case of "Private Cloud" using OpenStack -
tnmt
0
240
OpenStackクラスタ間マイグレーション事例 Havana to Mitaka / OpenStack Migration Case (Shift from Havana to Mitaka)
tnmt
1
1.1k
ペパボのプライベートクラウド "Nyah" その後 / Pepabo's PrivateCloud "Nyah" After That
tnmt
8
13k
Other Decks in Programming
See All in Programming
Vue3の一歩踏み込んだパフォーマンスチューニング2024
hal_spidernight
3
3.1k
JaSST 24 九州:ワークショップ(は除く)実践!マインドマップを活用したソフトウェアテスト+活用事例
satohiroyuki
0
270
カスタムしながら理解するGraphQL Connection
yanagii
1
1.2k
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
23k
Pinia Colada が実現するスマートな非同期処理
naokihaba
2
160
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
1k
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.3k
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
890
Identifying User Idenity
moro
6
8k
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
410
Golang と Erlang
taiyow
8
1.9k
Featured
See All Featured
Code Review Best Practice
trishagee
64
17k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
It's Worth the Effort
3n
183
27k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
800
The Language of Interfaces
destraynor
154
24k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Designing for Performance
lara
604
68k
Designing for humans not robots
tammielis
249
25k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Transcript
2013/06/21 @tnmt Puppet Chef ͷجૅ ͳΜͰඞཁͳͷͱ͔
ຊͷΞδΣϯμ ✤ Puppet, Chefͱ ✤ Puppet, Chefͷඞཁੑ ✤ Puppet, Chefͷߏ
✤ ΠϯϑϥͷίʔυԽͱͦͷपลࣝ
Puppet, Chefͱ
Puppet, Chef ✤ Provisioning Framework < Configuration Management Framework
Configuration Management ✤ ߏཧͷλεΫྫ ✤ ωοτϫʔΫઃఆ ✤ Ϣʔβ࡞ɾཧ ✤ ιϑτΣΞΠϯετʔϧઃఆ
✤ ͜ΕΒΛ”͋Δ͖ঢ়ଶ”ʹҡ࣋͢Δ͜ͱ͕ߏཧ ✤ ͦΕΛ࣮ݱ͢ΔͨΊͷπʔϧ͕Puppet, Chef
Puppet, Chefͷඞཁੑ
ৄ͘͠ ✤ mizzy͞ΜͷPuppet࿈ࡌॳճ http://gihyo.jp/admin/serial/01/ puppet/0001 ✤ antipop͞Μͷ”ೖPuppet”ୈ1ষ ʮͳͥPuppet͕ඞཁͳͷ͔ʁʯ ✤
Λࢀߟʹ…͍ͬͯ͏ͱ͋ΕͳͷͰ࣮ࡍಡΈ߹Θͤ
ߏཧλεΫͷ࣮ݱํ๏ʢ̍ʣ ✤ खॱॻʹΑΔखಈઃఆ ✤ ख࡞ۀʹΑΔ࣌ؒͷϩε ✤ ΦϖϨʔγϣϯϛεͷՄೳੑ ✤ खॱॻͷߋ৽Εɺܗ֚Խɺ߹ੑҡ͕͍࣋͠
ߏཧλεΫͷ࣮ݱํ๏ʢ̎ʣ ✤ εΫϦϓτʹΑΔࣗಈԽ ✤ εΫϦϓτͷ࣭ҡ͕࣋ݸਓͷεΩϧʹΑΔ ✤ ߏมߋͷै͕͍͠ʢޙड़͢Δႈੑʣ
͜͜Ͱ ✤ खॱॻ͕ͻͲ͍ͱ͜ΖΛݟͤΔʢٽ͖ͳ͕Βʣ
Chef, Puppetେࣄɾخ͍͜͠ͱ ✤ ႈੑ ✤ ίʔυ࣭ͷۉҰԽ ✤ ίϥϘϨʔγϣϯՄೳ
ႈੑ ✤ Կ࣮ߦͯ͠ಉ͡ঢ়ଶʹͳΔ͜ͱ ✤ ৽نɾطଘʹରͯ͠ͷૢ࡞Ͱಉ͡
ίʔυ࣭ͷۉҰԽ ✤ େମ୭͕ॻ͍ͯࣅͨΑ͏ͳײ͡ʹͳΔ ✤ ݚमͰ࡞ͬͯΔ manifest ݟͯͦ͏ͩΑͶʁ ✤ ଞͷਓ͕ॻ͍ͯΔͷΛݟΕେମԿͬͯΔ͔͔Δ ✤
ී௨ʹ͍ͬͯΕݸਓͷεΩϧʹ͋Μ·Γࠨӈ͞Εͳ͍ ✤ ෳࡶͳه๏ॻ͖࢝ΊΔͱ·ͨผ͚ͩͲ…
ίϥϘϨʔγϣϯՄೳ ✤ ΤϯδχΞಉ࢜Ͱ૬ޓʹվળ͕Մೳ ✤ Opsಉ࢜ͰɻDev͕ॻ͍͍͍ͨͬͯ (DevOps) ✤ VCSΛ༻͍ͨվળ (Pull Request,
ϨϏϡʔ) ✤ Մೳͱ͍͏ϝϦοτ
Puppet, Chefͷߏ
Puppet, Chefͷൺֱ ݴޠ σΟϨΫτϦߏ Puppet ֎෦DSL ൺֱతࣗ༝ Chef ෦DSL (Ruby)
ܾ·͍ͬͯΔ
ͱ͍͑ ✤ ઌ΄Ͳͷ֤ϓϩμΫτͷ༷తͳͱ͜ΖͷൺֱͰ ✤ ʢೖ Puppet ʹهࡌͯ͋͠Δʣ ✤ ࣮ࡍʹఏڙ͞ΕΔػೳͱͯ͠େ͖ࠩ͘ͳ͍ ✤
Ҏ߱ڞ௨͍ͯ͠Δӡ༻ʢ͍ํʣͷઆ໌
Master, Agentܕ ✤ Puppetͷmanifest, Chefͷrecipe Λूதཧ͢ΔϚελʔɺద༻͢Δ ΤʔδΣϯτͷܗΛऔΔ͜ͱ͕ग़དྷΔ ✤ طଘͷϖύϘࡐ͜ͷߏΛऔ͍ͬͯΔͱ͜Ζ͕ଟ͍ ✤
nodeใͷཧ͕ඞཁ ✤ PuppetͩͱςΩετʢ࣮ྫʣɺLDAPͳͲऔΕΔ ✤ ‘puppet agent’ ‘chef-client’
Puppetͷྫ
୯ମͰ࣮ߦ ✤ manifest, recipe Λద༻͢Δαʔόʹஔͯ͠୯ମͰ࣮ߦ͢Δ ✤ Master, AgentܕΑΓ͓खܰ ✤ ‘puppet
apply’, ‘chef-solo’ ✤ ࠷ۙͪ͜Β͕ਓؾग़͖ͯͯΔʢޙड़ʣ
ΠϯϑϥͷίʔυԽ
ίϥϘϨʔγϣϯՄೳͱॻ͍ͨ ✤ Manifest, Cookbooks Λόʔδϣϯཧग़དྷͯɺෳਓͰཧ ✤ ϨϏϡʔͨ͠Γվળͨ͠Γग़དྷΔ ✤ ͜Εͬͯී௨ʹϓϩάϥϜͱҰॹ
ϓϩάϥϜͱҰॹ ✤ ͜ΜͳྲྀΕ͕ग़དྷΔΑ͏ʹͳΔ ✤ खݩͷvagrantͰmanifestrecipeΛ࡞ͯ͠ (development) ✤ ࣾͷmaglicaڥͳͲͰ֬ೝͯ͠ (integration) ✤
࣮ࡍͷαʔϏεͷεςʔδϯάͰ֬ೝͯ͠ (staging) ✤ ຊ൪ʹೖ (production)
ϓϩάϥϜͱҰॹ ✤ ͜͏͍͏ͱ͖୯ମ࣮ߦ͕ศརͩͶ ✤ ֤ڥʹpupper-serverchef-serverΛߏங͢Δͷ͠ΜͲ͍ ✤ ͔ͦ͠ΕΒӡ༻ʹͦΕͳΓʹख͕͔͔ؒΔ
Vagrant ✤ ‘vagrant provision’ ίϚϯυ ✤ http://docs-v1.vagrantup.com/v1/docs/provisioners.html ✤ ࡞ͬͯյͯ͠ͱ͍͏ͷ͕؆୯ʹग़དྷΔ
ࠓ·ͰͷδϨϯϚ ✤ manifestrecipeͷ֬ೝ͕େม ✤ ࡞ ✤ ద༻ ✤ ֬ೝ ʢࢹʣ
໘ͳ͜ͱCI ✤ ͜͜࠷͍ۙτϐοΫ ✤ ϓϩάϥϚϒϧʹαʔόߏங͕ग़དྷΔΑ͏ʹͳͬͨ ✤ ֬ೝςετΛCIͰճͤΔΑͱ͍͏ͷͰઌਓ͕ϊϋΛஷΊͯڞ༗ ͖͍ͯͯ͠Δ
ႈੑສࡀ ✤ طଘͷαʔόͷద༻ ✤ ৽نαʔόͷߏங ✤ ͲͪΒʹͰ͑ΔɺͲͪΒ֬ೝग़དྷΔ
CIྫ (Puppet) ✤ “Ukigumo ͱ serverspec Ͱ Puppet ͷܧଓతΠϯςάϨʔγϣϯ” ✤
http://mizzy.org/blog/2013/03/27/2/ ✤ puppet-lxc-box Ͱ࡞ͬͨίϯςφʹରͯ͠ܧଓతʹ puppet apply ͠ ͯ݁ՌΛϨϙʔτ
CIྫ (Chef) ✤ “Vagrant + Chef Solo + serverspec +
Jenkins ͰαʔόʔߏஙΛ CI” ✤ http://d.hatena.ne.jp/naoya/20130520/1369054828 ✤ vagrant ʹΑͬͯ࡞ͨ͠ vm ʹରͯ͠ɺ৽ن࡞→knife-soloద༻ →serverscpec→ഁغ ͱ͍͏ྲྀΕ
ઌ΄ͲͷCIͷλΠτϧΛݟ͢ ✤ “Ukigumo ͱ serverspec Ͱ Puppet ͷܧଓతΠϯςάϨʔγϣϯ” ✤ “Vagrant
+ Chef Solo + serverspec + Jenkins ͰαʔόʔߏஙΛ CI”
serverspecʹ͍ͭͯ ✤ ࠓͷ hbstudy#45 Ͱʂʂ̍
͓·͚ʣ͏̍ͭͷςετ ✤ αʔϏεࢹ (ϞχλϦϯά͡Όͳͯ͘ࢮ׆ࢹͳͲ) ✤ ϖύϘͰNagiosΛ͍ͬͯΔ ✤ NagiosपΓࠇా͞Μ͕ࠓͯ͘͠Ε·͢ ✤ serverspec͕ϗϫΠτϘοΫεςετͳΒ,
αʔϏεࢹϒϥοΫϘ οΫεςετ ✤ ʢهʣ࣮ࡍӡ༻தͷNagiosը໘ΛݟͯΈͨ