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
0
520
キースイッチ潤滑入門 / 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
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
4
1.7k
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
160
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
1.1k
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
170
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
220
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
16
4.1k
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
1.8k
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
120
Golang と Erlang
taiyow
8
1.9k
EventSourcingの理想と現実
wenas
6
2.1k
Featured
See All Featured
Designing for Performance
lara
604
68k
Side Projects
sachag
452
42k
Statistics for Hackers
jakevdp
796
220k
Fireside Chat
paigeccino
32
3k
Ruby is Unlike a Banana
tanoku
96
11k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
We Have a Design System, Now What?
morganepeng
50
7.2k
Gamification - CAS2011
davidbonilla
80
5k
How GitHub (no longer) Works
holman
311
140k
Faster Mobile Websites
deanohume
304
30k
Why Our Code Smells
bkeepers
PRO
334
57k
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ͷϓϩηεؒ௨৴ػೳΛ౷߹͢ΔͷʣɺΫϥυڥͷڥքʹ͓͚Δಈతʹ εΫϦϓτʹΑ੍ͬͯޚՄೳͳϓϩΩγΛఏڙ͠·͢ɻ