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
540
キースイッチ潤滑入門 / A Brief Introduction to Lube MX Switches
takai
2
780
みなさん、分かっていますか / What is a difference?
takai
1
870
The Design Philosophy of Kuroko2
takai
3
2.1k
Agile and DevOps with Ruby
takai
2
1.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
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
760
Haze - Real time background blurring
chrisbanes
1
510
MCP with Cloudflare Workers
yusukebe
2
220
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
Refactor your code - refactor yourself
xosofox
1
260
103 Early Hints
sugi_0000
1
230
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
4
540
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
780
Featured
See All Featured
Site-Speed That Sticks
csswizardry
2
190
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Writing Fast Ruby
sferik
628
61k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Scaling GitHub
holman
458
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Designing for humans not robots
tammielis
250
25k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Being A Developer After 40
akosma
87
590k
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ͷϓϩηεؒ௨৴ػೳΛ౷߹͢ΔͷʣɺΫϥυڥͷڥքʹ͓͚Δಈతʹ εΫϦϓτʹΑ੍ͬͯޚՄೳͳϓϩΩγΛఏڙ͠·͢ɻ