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
Ruby App on Netflix Microservices Stack
Search
Naoto Takai
August 29, 2015
Programming
6
1k
Ruby App on Netflix Microservices Stack
At Tokyu RubyKaigi 09 #tqrk09
Naoto Takai
August 29, 2015
Tweet
Share
More Decks by Naoto Takai
See All by Naoto Takai
Building the Perfect Custom Keyboard
takai
1
530
キースイッチ潤滑入門 / A Brief Introduction to Lube MX Switches
takai
2
770
みなさん、分かっていますか / What is a difference?
takai
1
860
The Design Philosophy of Kuroko2
takai
3
2.1k
Agile and DevOps with Ruby
takai
2
1k
Software Quality and Testing #1
takai
5
640
Microservices in Action
takai
37
5.3k
How We Use Jenkins?
takai
21
8.3k
COOKPAD and Test Automation
takai
19
2.7k
Other Decks in Programming
See All in Programming
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
Quine, Polyglot, 良いコード
qnighy
4
640
Jakarta EE meets AI
ivargrimstad
0
510
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
みんなでプロポーザルを書いてみた
yuriko1211
0
260
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
受け取る人から提供する人になるということ
little_rubyist
0
230
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Jakarta EE meets AI
ivargrimstad
0
580
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
The Pragmatic Product Professional
lauravandoore
31
6.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Designing Experiences People Love
moore
138
23k
Designing the Hi-DPI Web
ddemaree
280
34k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Building Adaptive Systems
keathley
38
2.3k
Building Applications with DynamoDB
mza
90
6.1k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Transcript
/FUqJYͷNJDSPTFSWJDFTελοΫͰ 3VCZΞϓϦέʔγϣϯΛಈ͔ͯ͠ΈΔ
None
σϞ
docker-machine ls NAME ACTIVE DRIVER STATE URL default * virtualbox
Running tcp://192.168.99.100:23 docker inspect -f '{{range $p, $conf := .NetworkSettings.Ports} {{(index $conf 0).HostPort}} {{end}}' zuul_messenger 8080/tcp -> 8000 curl http://192.168.99.100:8000 {"message":"Minnano Wedding is hiring."}
Έͳ͞Μɺ͜Μͳ͜ͱʹ͓ࠔΓͰ͔͢ʁ
w ରԠσόΠε͕ଟ͍ʢҎ্ʣ w τϥϑΟοΫ͕ଟ͍ʢશถͷʣ
ͨͿΜ͍ͳ͍ʜʜ
/FUqJYελοΫNJDSPTFSWJDFT ΞʔΩςΫνϟͷදྫ
EPO`UFWFODPOTJEFSNJDSPTFSWJDFT VOMFTTZPVIBWFBTZTUFNUIBUTUPP DPNQMFYUPNBOBHFBTBNPOPMJUI IUUQNBSUJOGPXMFSDPNCMJLJ.JDSPTFSWJDF1SFNJVNIUNM
IUUQNBSUJOGPXMFSDPNCMJLJ.JDSPTFSWJDF1SFNJVNIUNM
৫ʹΑͬͯʮෳࡶʯͷఆٛҟͳΔ
None
ڞ௨ϥϯλΠϜαʔϏεͱϥΠϒϥϦʔ ϚΠΫϩαʔϏεΛՃ͢ΔϥϯλΠϜίϯςφʔͱϥΠϒϥϦʔɺαʔϏεɻ ΫϥυϓϥοτϑΥʔϜɺ/FUqJYͷେ෦ΛΊΔαʔϏε܈ͷجૅͰ͋ΓɺςΫϊϩδʔελοΫͰ͢ɻ ΫϥυϓϥοτϑΥʔϜɺΫϥυαʔϏεΞϓϦέʔγϣϯϥΠϒϥϦɺΞϓϦέʔγϣϯίϯς φ͔Βߏ͞Ε·͢ɻಛʹϓϥοτϑΥʔϜʹΑͬͯɺ&VSFLBʹΑΔαʔϏεσΟεΧόϦɺ"SDIBJVTʹΑΔ ࢄઃఆཧɺ3JCCPOʹΑΔϨδϦΤϯεͰΠϯςϦδΣϯτͳϓϩηεʗαʔϏεؒ௨৴ͳͲ͕ɺఏڙ͞ Ε·͢ɻ୯ҰͷαʔϏεݺͼग़͠ʹͱͲ·Βͳ͍৴པੑΛఏڙ͢ΔͨΊʹɺ)ZTUSJYʹΑͬͯϥϯλΠϜͰಠ ཱͨ͠ϨΠςϯγͱোੑ͕ఏڙ͞Ε·͢ɻ͜ΕΒͷϥΠϒϥϦʔαʔϏεɺ+7.ϕʔείϯςφͰ ͋ΕͲͷΑ͏ͳڥͰಈ࡞͠·͢ɻ ·ͨɺϓϥοτϑΥʔϜ+7.ίϯςφαʔϏεΛɺ,BSZPOͱ(PWFSOBUPSɺඇ+BWBϥϯλΠϜڥ͚ʹ
1SBOBαΠυΧʔʹΑΓɺఏڙ͠·͢ɻ1SBOB͕ΠϯελϯεͰϓϩΩγػೳΛఏڙ͢Δͷʹର͠ɺ;VVM ʢ)ZTUSJYͱ&VSFLBɺ3JCCPOͷϓϩηεؒ௨৴ػೳΛ౷߹͢ΔͷʣɺΫϥυڥͷڥքʹ͓͚Δಈతʹ εΫϦϓτʹΑ੍ͬͯޚՄೳͳϓϩΩγΛఏڙ͠·͢ɻ
ύϧεͷϑΝϧγͷϧγ͕ ύʔδͰίΫʔϯʘ ?P? ʗ
ڞ௨ϥϯλΠϜαʔϏεͱϥΠϒϥϦʔ ϚΠΫϩαʔϏεΛՃ͢ΔϥϯλΠϜίϯςφʔͱϥΠϒϥϦʔɺαʔϏεɻ ΫϥυϓϥοτϑΥʔϜɺ/FUqJYͷେ෦ΛΊΔαʔϏε܈ͷجૅͰ͋ΓɺςΫϊϩδʔελοΫͰ͢ɻ ΫϥυϓϥοτϑΥʔϜɺΫϥυαʔϏεΞϓϦέʔγϣϯϥΠϒϥϦɺΞϓϦέʔγϣϯίϯς φ͔Βߏ͞Ε·͢ɻಛʹϓϥοτϑΥʔϜʹΑͬͯɺ&VSFLBʹΑΔαʔϏεσΟεΧόϦɺ"SDIBJVTʹΑΔ ࢄઃఆཧɺ3JCCPOʹΑΔϨδϦΤϯεͰΠϯςϦδΣϯτͳϓϩηεʗαʔϏεؒ௨৴ͳͲ͕ɺఏڙ͞ Ε·͢ɻ୯ҰͷαʔϏεݺͼग़͠ʹͱͲ·Βͳ͍৴པੑΛఏڙ͢ΔͨΊʹɺ)ZTUSJYʹΑͬͯϥϯλΠϜͰಠ ཱͨ͠ϨΠςϯγͱোੑ͕ఏڙ͞Ε·͢ɻ͜ΕΒͷϥΠϒϥϦʔαʔϏεɺ+7.ϕʔείϯςφͰ ͋ΕͲͷΑ͏ͳڥͰಈ࡞͠·͢ɻ ·ͨɺϓϥοτϑΥʔϜ+7.ίϯςφαʔϏεΛɺ,BSZPOͱ(PWFSOBUPSɺඇ+BWBϥϯλΠϜڥ͚ʹ
1SBOBαΠυΧʔʹΑΓɺఏڙ͠·͢ɻ1SBOB͕ΠϯελϯεͰϓϩΩγػೳΛఏڙ͢Δͷʹର͠ɺ;VVM ʢ)ZTUSJYͱ&VSFLBɺ3JCCPOͷϓϩηεؒ௨৴ػೳΛ౷߹͢ΔͷʣɺΫϥυڥͷڥքʹ͓͚Δಈతʹ εΫϦϓτʹΑ੍ͬͯޚՄೳͳϓϩΩγΛఏڙ͠·͢ɻ
w ରԠσόΠε͕ଟ͍ʢҎ্ʣ w τϥϑΟοΫ͕ଟ͍ʢશถͷʣ
ରԠσόΠε͕ଟ͍͔ΒɺσόΠε͝ͱͷࠩҟΛ ड͚ೖΕɺσόΠεຖʹ࠷దԽ͞ΕͨϨεϙϯε Λฦ٫͢Δඞཁ͕͋Δɻ
ΫϥΠΞϯτ 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε 3FTPVSDFCBTFE"1*
ΫϥΠΞϯτ 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε "1*(BUFXBZ &YQFSJFODFCBTFE"1* Ϋϥυڥͷڥքʹ͓͚Δ
ಈతʹεΫϦϓτʹΑ੍ͬͯ ޚՄೳͳϓϩΩγ
ରԠσόΠε͕ଟ͍͔ΒɺҰ෦ͷσόΠε͕ར༻ ͢Δ෦ͷͨΊ͚ͩʹɺΞϓϦέʔγϣϯશମ͕ Τϥʔʹͳͬͯ΄͘͠ͳ͍ɻ
ΫϥΠΞϯτ 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε "1*(BUFXBZ
ΫϥΠΞϯτ 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε 3&45GVM"1* Ϧιʔε "1*(BUFXBZ ϨΠςϯγͱোੑ
ରԠσόΠε͕ଟ͍͔ΒɺҰ෦ͷσόΠε͕ར༻ ͢Δ෦ͷͨΊ͚ͩʹɺΞϓϦέʔγϣϯશମΛ εέʔϧͤͨ͘͞ͳ͍ɻ
ϩʔυόϥϯα "1*(BUFXBZ αʔϏε ϊʔυ αʔϏε ϊʔυ αʔϏε ϊʔυ αʔϏεͷ͕૿Ճ͢ΔʹͭΕ ϩʔυόϥϯαͷཧ͕ࠔʹ
ͳΔ
"1*(BUFXBZ αʔϏε ϊʔυ αʔϏε ϊʔυ αʔϏε ϊʔυ ΫϥΠΞϯταΠυϩʔυόϥϯγϯά ʹΑΔϨδϦΤϯεͰΠϯςϦδΣϯτ ͳϓϩηεʗαʔϏεؒ௨৴
αʔϏεσΟεΧόϦʹΑΔ ಈతͳϊʔυͷొͱཁٻ "1*(BUFXBZ αʔϏε ϊʔυ αʔϏε ϨδετϦ ొ Ұཡ
αʔϏεϨδετϦͷొͳͲΛ ఏڙ͢Δ+7.ίϯςφαʔϏε αʔϏε ϨδετϦ ొ ϔϧενΣοΫ ίϯςφαʔϏε ΞϓϦέʔγϣϯ
ϦΫΤετ ΫϥΠΞϯτ ΞϓϦέʔγϣϯ "1*(BUFXBZ αʔϏε ϨδετϦ Ϩεϙϯε ొ ϦΫΤετ Ұཡ
Ϩεϙϯε ΞϓϦέʔγϣϯ ίϯςφαʔϏε ΞϓϦέʔγϣϯ ίϯςφαʔϏε ϩʔυόϥϯγϯάʴ ϨΠςϯγɾোϨΠϠʔ
;VVM 3JCCPO )ZTUSJY &VSFLB ,BSZPO 1SBOB ϦΫΤετ ΫϥΠΞϯτ ΞϓϦέʔγϣϯ "1*(BUFXBZ
αʔϏε ϨδετϦ Ϩεϙϯε ొ ϦΫΤετ Ұཡ Ϩεϙϯε ΞϓϦέʔγϣϯ ίϯςφαʔϏε ΞϓϦέʔγϣϯ ίϯςφαʔϏε ϩʔυόϥϯγϯάʴ ϨΠςϯγɾোϨΠϠʔ
require 'sinatra' require 'sinatra/json' get '/' do json(message: 'Minnano Wedding
is hiring.') end get '/status' do json(status: 'OK') end
w αʔϏεϨδετϦͷࣗࣗͷొ w αʔϏεϨδετϦ͔ΒͷϔϧενΣοΫ w ଞαʔϏεͷσΟεΧόϦͱΫϥΠΞϯταΠυ ϩʔυόϥϯγϯά w ઃఆใͷऔಘɺߋ৽ʢࠓճݴٴ͍ͯ͠ͳ͍ʣ
αΠυΧʔύλʔϯʹΑΓ ଞαʔϏεϊʔυʹରͯ͠ ΠϯελϯεͰϓϩΩγ ػೳΛఏڙ αʔϏε ϨδετϦ 1SBOB BQQSC αʔϏε ϊʔυ
αʔϏε ϊʔυ ϦΫΤετ ϦΫΤετ ొ ϔϧενΣοΫ ϦΫΤετ ϔϧε νΣοΫ
cat Procfile app: rackup -E production --host 0.0.0.0 plana: prana/bin/Prana
-c config.properties cat config.properties prana.host.healthcheck.url=http://localhost:9292/status prana.host.healthcheck.timeout=1500 prana.proxy.req.acceptencoding=gzip eureka.name=MESSENGER eureka.vipAddress=MESSENGER eureka.port=9292 eureka.serviceUrl.default=http://eureka:8080/eureka/v2/ eureka.validateInstanceId=false
docker run -d --name exhibitor netflixoss/exhibitor:1.5.2 docker run -d --name
eureka -d netflixoss/eureka:1.1.142 docker run -d --name messenger --link eureka:eureka \ takai/messenger bundle exec foreman start docker run -e "origin.zuul.client.DeploymentContextBasedVipAddr -d --name zuul_messenger \ --link eureka:eureka netflixoss/zuul:1.0.28
ڞ௨ϥϯλΠϜαʔϏεͱϥΠϒϥϦʔ ϚΠΫϩαʔϏεΛՃ͢ΔϥϯλΠϜίϯςφʔͱϥΠϒϥϦʔɺαʔϏεɻ ΫϥυϓϥοτϑΥʔϜɺ/FUqJYͷେ෦ΛΊΔαʔϏε܈ͷجૅͰ͋ΓɺςΫϊϩδʔελοΫͰ͢ɻ ΫϥυϓϥοτϑΥʔϜɺΫϥυαʔϏεΞϓϦέʔγϣϯϥΠϒϥϦɺΞϓϦέʔγϣϯίϯς φ͔Βߏ͞Ε·͢ɻಛʹϓϥοτϑΥʔϜʹΑͬͯɺ&VSFLBʹΑΔαʔϏεσΟεΧόϦɺ"SDIBJVTʹΑΔ ࢄઃఆཧɺ3JCCPOʹΑΔϨδϦΤϯεͰΠϯςϦδΣϯτͳϓϩηεʗαʔϏεؒ௨৴ͳͲ͕ɺఏڙ͞ Ε·͢ɻ୯ҰͷαʔϏεݺͼग़͠ʹͱͲ·Βͳ͍৴པੑΛఏڙ͢ΔͨΊʹɺ)ZTUSJYʹΑͬͯϥϯλΠϜͰಠ ཱͨ͠ϨΠςϯγͱোੑ͕ఏڙ͞Ε·͢ɻ͜ΕΒͷϥΠϒϥϦʔαʔϏεɺ+7.ϕʔείϯςφͰ ͋ΕͲͷΑ͏ͳڥͰಈ࡞͠·͢ɻ ·ͨɺϓϥοτϑΥʔϜ+7.ίϯςφαʔϏεΛɺ,BSZPOͱ(PWFSOBUPSɺඇ+BWBϥϯλΠϜڥ͚ʹ
1SBOBαΠυΧʔʹΑΓɺఏڙ͠·͢ɻ1SBOB͕ΠϯελϯεͰϓϩΩγػೳΛఏڙ͢Δͷʹର͠ɺ;VVM ʢ)ZTUSJYͱ&VSFLBɺ3JCCPOͷϓϩηεؒ௨৴ػೳΛ౷߹͢ΔͷʣɺΫϥυڥͷڥքʹ͓͚Δಈతʹ εΫϦϓτʹΑ੍ͬͯޚՄೳͳϓϩΩγΛఏڙ͠·͢ɻ