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
chef-soloの簡単な使い方
Search
Spring_MT
June 07, 2013
Programming
4
930
chef-soloの簡単な使い方
Groovenauts Public Hands-on 02 - Chef+serverspecで発表した内容です。
Spring_MT
June 07, 2013
Tweet
Share
More Decks by Spring_MT
See All by Spring_MT
Deep Environment Parity CDNT 2019
spring_mt
5
3.2k
環境の一致について考えてみる / Environment Parity
spring_mt
4
7k
1人でできる Docker Kubernetes(GKE)を 使った新規サービス立ち上げ / Docker and Kubernetes(GKE) for new services
spring_mt
19
7.6k
CI CD Test on ReRep
spring_mt
3
3.2k
Swagger (OpenAPI 2.0) を使ったAPI仕様Drivenな開発 / API-Spec-Driven development with Swagger
spring_mt
9
3.2k
Rails on GKEで運用する Webアプリケーションの紹介/Rails on GKE
spring_mt
0
420
新規事業立ち上げからマイクロサービスについて考えてみる
spring_mt
1
1.1k
hpbn_3
spring_mt
0
92
backbone.jsの使用例 その1
spring_mt
0
320
Other Decks in Programming
See All in Programming
Java ジェネリクス入門 2024
nagise
0
600
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
23
11k
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.2k
hotwire_or_react
harunatsujita
8
4k
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
110
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
offers_20241022_imakiire.pdf
imakurusu
2
360
qmuntal/stateless のススメ
sgash708
0
120
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
430
僕がつくった48個のWebサービス達
yusukebe
18
17k
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
390
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Making the Leap to Tech Lead
cromwellryan
132
8.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
1
39
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Testing 201, or: Great Expectations
jmmastey
38
7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Scaling GitHub
holman
458
140k
How GitHub (no longer) Works
holman
311
140k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
KATA
mclloyd
29
13k
Transcript
chef-soloΛͬͯ ؆୯ϓϩϏδϣχϯά ΫοΩϯά @Spring_MT
Profile twitter : @Spring_MT Company : 10xLab Engineer
chefͱ? RubyͷγεςϜཧπʔϧ γεςϜߏஙͷࣗಈԽ ӡ༻࡞ۀͷࣗಈԽ
᷿Ͱ ͜͏͍ΘΕͯ ·͕͢ɻɻɻ
None
ࣗಈԽ͢Δ΄Ͳ αʔόʔ ࣋ͬͯͶ͑Α
ͦΕͰ chefΛ ͏ͷʁ
chefͷ͍͍ͱ͜Ζ ઃܭॻ(cookbook)ΛͤΔ(ൿͷλ ϨԽΛࢭ) ઃܭॻ͕ϓϩάϥϚϒϧʹॻ͚Δ
puppetʁ ผʹͲͬͪͰྑ͍Ͱ͢ ͖ͳํΛ͓͍Լ͍͞
ͱɺ ͍ͬͯΈͨͷͷ
chefͱpuppet ෦DSL(chef) or ֎෦DSL(puppet) ͷҧ͍ chefͷ߹෦DSLͳͷͰɺதʹ rubyͷίʔυΛͦͷ··ॻ͚Δ
chefͷཁૉ
Chef-Server API Chef-Solr Indexer RabbitMQ Chef-Server WebUI Knife CouchDB Solr
Ruby CouchDB (chef 11ͩͱ PostgreSQL?) RabbitMQ Solr Erlang ϛυϧΣΞ Chef-Client client
chefͷߏཁૉ chef-server ใΛूͯ͠ཧ͢Δαʔόϓϩηεɻ֤ Client ͱ JSON/REST ελΠϧͰ ௨৴͢Δɻ WebUI chef-server
ͷ Web ΠϯλʔϑΣʔεɻ chef-client ઃఆΛద༻͢Δ֤ϚγϯʹΠϯετʔϧ͞ΕΔσʔϞϯɻఆظతʹ chef-server ΛϙʔϦϯάͯ͠ɺͦͷ༰ʹैͬͯϨγϐΛ࣮ߦ͢Δɻ knife chef-server ʹొ͞Ε͍ͯΔใͷऔಘɾมߋΛߦ͏πʔϧɻ chef-solo αʔόແ͠ͰϨγϐΛ࣮ߦ͢Δπʔϧɻ
None
େ͖͍ɻɻɻɻ
chef chefΛ”Full Stack”Ͱ͏ͷίε τେ͖͍(ཧɺӡ༻ͱ͔Ͱ) chefͷڥ࡞Δ͚ͩͰɺ݁ߏαʔ όʔ͏͠ɺਓࡐ͍Δ
None
chef-solo chef-soloࣗಈԽͷ෦Λશ͘ Θͳ͍ ઃܭॻ(cookbook)ͷ෦ͷΈ͏
10xlabͰͷ chef
ALL AWS! Ruby(1.9.3), Fluentd and Chef in all servers 10xlab
Infra
public subnet Co-Work subnet utility APP redis worker subnet storage
subnet fluentd deliver worker proxy varnish + sinatra Watch subnet network Gateway NAT SSLͷม DB(MySQL on EC2)
10xlabͷํ chefશ෦͏ʹΠϯϑϥͷن খ͍͞ chefཧίετ >> chefͷϝϦοτ ࣗಈԽͦ͜·Ͱඞཁͳ͍ ઃܭॻ͓͖͍ͯͨ͠
cookbook ઃܭॻ͕ೖ͍ͬͯΔ جຊతʹϛυϧΣΞ୯ҐͰ࡞Δ 10xlabͰvpcͷαϒωοτຖʹ cookbookͷdirΛ͚͍ͯΔ
cookbookͷॻ͖ํ 10xlabͷ߹ ίʔυΛࢄͤ͞ͳ͍ OSͱ͔ͷ݅ذͱ͔ߟ͑ͣʹ γϯϓϧʹ·ͱΊΔ
ઃܭॻ(cookbook) ޙ͔Βݟͯ ͔ΔΑ͏ʹ ͠·͠ΐ͏
cookbook hogehoge/ README.md attributes : cookbookͰ͏ڞ௨ͷมΛ֨ೲ definitions : files :
୯ʹίϐʔͯ͠͏ͨΊͷϑΝΠϧΛஔ͘ libraries : metadata.rb : Cookbook ͷઆ໌ͱ͔ͷϝλใ providers : recipes : ॲཧखॱΛهࡌ resources : templates : confϑΝΠϧΛ֨ೲ
cookbook recipesͱtemplatesʹूதͤ͞Δ Ұ෦ɺڞ௨ͷมΛηοτ͢Δ࣌ ʹattributesΛ͏
࣮ࡍͷrecipe
chef-solo ୯Ұαʔόʔ͚ ෳαʔόʔΛཧͰ͖ͳ͍
cap_chef chef-soloΛ֤αʔόʔͰಈ͔͢ πʔϧ capistranoͱͷΈ߹Θͤ @fujiwaraͷπʔϧΛͪΐͬͱม͑ ͚ͨͩ knife-solo͕͋Δ͚Ͳɻɻɻɻ
cap_chefͷׂ roleʹΑͬͯαʔόʔຖͷidentiy Λൃݱͤ͞Δ ϛυϧΣΞͷΠϯετʔϧͱ ઃఆ
cap_chef ݩͰchef soleΛ͏ͨΊͷઃఆ ϑΝΠϧ(solo.rb)Λ࡞ cookbooksΛಉظ ઌͰϊʔυͷଐੑΛॻ͍ͨself.json ࡞ ઌͰchef-soloΛୟ͘
cookbookͷಉظ rsyncͰಉظ
None
αʔόʔͷsetup
खॱ େ͖͘2ͭ chefΛೖΕΔ·Ͱ chef͕ೖͬͨ͋ͱ
chefΛೖΕΔ·Ͱ ݁ߏ·͍͠ ͜Ε֤ʑͳΜͱ͔͢Δ(͠ͳ͍ͱ Ͳ͏͠Α͏ͳ͍)
ͨͱ͑ system rubyΛͬͯ߈ͰchefΛ ͍ΕΔ(ଟ1.8.7͕ଟ͍) kickstartͱ͔Ͱ͍Ε͓ͯ͘
10xlabͰ AWS EC2ͷuser_dataΛͬͯ ৭ʑηοτΞοϓ͢ΔதͰchefΛ ͍Ε͍ͯΔ
user_data EC2Λ্ཱͪ͛ͨ࣌ʹ্ཱͪ͛ ޙʹΒͤΔεΫϦϓτΛొͰ ͖ΔΈ
user_dataͰ ηοτΞοϓྫ * ϢʔβʔՃ * sshઃఆ * rootύεϫʔυͷઃఆ * ৭ʑyum
install . . . . . . * rbenvͰruby Πϯετʔϧ . . . . . . * gem install chef
chef͕ೖͬͨΒ cap_chefΛͬͯඞཁͳϛυϧ ΣΞΛΠϯετʔϧ