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.5k
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
410
新規事業立ち上げからマイクロサービスについて考えてみる
spring_mt
1
1.1k
hpbn_3
spring_mt
0
91
backbone.jsの使用例 その1
spring_mt
0
320
Other Decks in Programming
See All in Programming
(Deep|Web) Link support with expo-router
mrtry
0
180
CSC509 Lecture 02
javiergs
PRO
0
160
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
4
180
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
0
190
ポケモンで考えるコミュニケーション / Communication Lessons from Pokémon
mackey0225
4
180
dbt-ga4パッケージを実業務に導入してみた話
t_tokumaru_feedcorp
0
130
tsconfig.jsonの最近の新機能 ファイルパス編
uhyo
6
1.7k
Jakarta EE as Seen Trough the Lens of the ASF
ivargrimstad
0
300
【YAPC::Hakodate 2024】TypeScriptエンジニアが感じたPerlのここが面白い
kimitashoichi
1
270
Unlocking Python's Core Magic
leew
0
130
Pydantic x Database API:turu-pyの開発
yassun7010
1
720
学生の時に開催したPerl入学式をきっかけにエンジニアが組織に馴染むために勉強会を主催や仲間と参加して職能間の境界を越えていく
ohmori_yusuke
1
140
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
4
120
The Mythical Team-Month
searls
218
43k
Documentation Writing (for coders)
carmenintech
65
4.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.7k
Agile that works and the tools we love
rasmusluckow
327
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
29
1.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
225
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.5k
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.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Λͬͯඞཁͳϛυϧ ΣΞΛΠϯετʔϧ