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
950
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.3k
Rails on GKEで運用する Webアプリケーションの紹介/Rails on GKE
spring_mt
0
430
新規事業立ち上げからマイクロサービスについて考えてみる
spring_mt
1
1.1k
hpbn_3
spring_mt
0
97
backbone.jsの使用例 その1
spring_mt
0
320
Other Decks in Programming
See All in Programming
From Translations to Multi Dimension Entities
alexanderschranz
2
130
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
Security_for_introducing_eBPF
kentatada
0
110
CSC305 Lecture 26
javiergs
PRO
0
140
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
270
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
110
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
370
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
160
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
97
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Practical Orchestrator
shlominoach
186
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
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Λͬͯඞཁͳϛυϧ ΣΞΛΠϯετʔϧ