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
93
backbone.jsの使用例 その1
spring_mt
0
320
Other Decks in Programming
See All in Programming
CSC509 Lecture 12
javiergs
PRO
0
160
CSC509 Lecture 09
javiergs
PRO
0
140
CSC509 Lecture 11
javiergs
PRO
0
180
Contemporary Test Cases
maaretp
0
130
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
Amazon Qを使ってIaCを触ろう!
maruto
0
400
Outline View in SwiftUI
1024jp
1
330
Macとオーディオ再生 2024/11/02
yusukeito
0
370
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Realtime API 入門
riofujimon
0
150
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
Featured
See All Featured
Scaling GitHub
holman
458
140k
How STYLIGHT went responsive
nonsquared
95
5.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Practical Orchestrator
shlominoach
186
10k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Code Review Best Practice
trishagee
64
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
A better future with KSS
kneath
238
17k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
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Λͬͯඞཁͳϛυϧ ΣΞΛΠϯετʔϧ