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
Outline View in SwiftUI
1024jp
1
330
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
300
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Jakarta EE meets AI
ivargrimstad
0
600
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
140
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
役立つログに取り組もう
irof
28
9.6k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
CSC509 Lecture 11
javiergs
PRO
0
180
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
A better future with KSS
kneath
238
17k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Navigating Team Friction
lara
183
14k
Why Our Code Smells
bkeepers
PRO
334
57k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
A Philosophy of Restraint
colly
203
16k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
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ͷϓϩηεؒ௨৴ػೳΛ౷߹͢ΔͷʣɺΫϥυڥͷڥքʹ͓͚Δಈతʹ εΫϦϓτʹΑ੍ͬͯޚՄೳͳϓϩΩγΛఏڙ͠·͢ɻ