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
940
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
94
backbone.jsの使用例 その1
spring_mt
0
320
Other Decks in Programming
See All in Programming
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Jakarta EE meets AI
ivargrimstad
0
670
Ethereum_.pdf
nekomatu
0
470
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
Outline View in SwiftUI
1024jp
1
330
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Writing Fast Ruby
sferik
627
61k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
We Have a Design System, Now What?
morganepeng
50
7.2k
Designing for Performance
lara
604
68k
Embracing the Ebb and Flow
colly
84
4.5k
Designing for humans not robots
tammielis
250
25k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Fireside Chat
paigeccino
34
3k
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Λͬͯඞཁͳϛυϧ ΣΞΛΠϯετʔϧ