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
550
キースイッチ潤滑入門 / A Brief Introduction to Lube MX Switches
takai
2
780
みなさん、分かっていますか / What is a difference?
takai
1
880
The Design Philosophy of Kuroko2
takai
3
2.2k
Agile and DevOps with Ruby
takai
2
1.1k
Software Quality and Testing #1
takai
5
650
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
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
590
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
5.9k
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.7k
Package Traits
ikesyo
1
210
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
2
2.7k
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
Rubyでつくるパケットキャプチャツール
ydah
0
170
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
선언형 UI에서의 상태관리
l2hyunwoo
0
270
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
300
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
170
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Unsuck your backbone
ammeep
669
57k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
Building Applications with DynamoDB
mza
93
6.2k
Gamification - CAS2011
davidbonilla
80
5.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Thoughts on Productivity
jonyablonski
68
4.4k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
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ͷϓϩηεؒ௨৴ػೳΛ౷߹͢ΔͷʣɺΫϥυڥͷڥքʹ͓͚Δಈతʹ εΫϦϓτʹΑ੍ͬͯޚՄೳͳϓϩΩγΛఏڙ͠·͢ɻ