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
Let's visualize your Spring Cloud Applications!...
Search
Shin Tanimoto
November 18, 2016
Programming
5
16k
Let's visualize your Spring Cloud Applications! #jsug #springday
Spring Day 2016 講演資料
2016-11-18
Shin Tanimoto
November 18, 2016
Tweet
Share
More Decks by Shin Tanimoto
See All by Shin Tanimoto
クラウドネイティブ時代のコンテナ環境におけるJavaアプリケーションのメトリクス・ログ・トレースモニタリング
shintanimoto
5
2.2k
26 Java Years
shintanimoto
0
49
Let’s Have Fun with Reactive Programming, Using Reactor and WebFlux
shintanimoto
0
230
Monitoring and Visualizing Your (Micro)services
shintanimoto
0
340
現代に求められるJavaコミュニティとは / What should be the Java Community of Today?
shintanimoto
0
880
人生がときめく「学び」の魔法 / The Life-Changing Magic of Studying
shintanimoto
6
1.6k
業務で使いたいWebFluxによるReactiveプログラミング / Introduction to Reactive Programming using Spring WebFlux
shintanimoto
9
9.1k
from old Java to modern Java (2017) #jjug
shintanimoto
4
1.6k
Spring Cloud Sleuth + Zipkin with Elasticsearch #zipkin_jp
shintanimoto
1
1.2k
Other Decks in Programming
See All in Programming
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
130
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
190
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
350
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Scaling GitHub
holman
458
140k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Thoughts on Productivity
jonyablonski
67
4.4k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Fireside Chat
paigeccino
34
3.1k
Code Reviewing Like a Champion
maltzj
520
39k
Designing for Performance
lara
604
68k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Transcript
Let’s Visualize Your Spring Cloud Applications! #sd2016r26 Shin Tanimoto Acroquest
Technology Co., LTD
Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࣗݾհ
2 • ୩ຊ ৺ (Shin Tanimoto) - Acroquest Technologyגࣜձࣾ - ιϦϡʔγϣϯΞʔΩςΫτ - JavaOne / SpringOneεϐʔΧʔ - JJUG / ؔδϟό - Twitter : @cero_t (ຊޠ) - Facebook : shin.tanimoto (ӳޠ)
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3 ຊͷςʔϚɿ Spring Cloud Applicationͷ ʮՄࢹԽʯ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4 ͦͦ Spring Cloud Applicationͱʁ Eureka, Config, Hystrix, Zuul, Session, Stream … ɾɾɾͳͲΛͬͨཁ͢ΔʹϚΠΫϩαʔϏε
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 5 αʔϏε͕૿͖͑ͯͨΒ ৭ʑͱେมʹͳΔ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6 #1 ϚΠΫϩαʔϏε։ൃ ͷۤ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. Devͷਓʁ Opsͷਓʁ ྆ํΔਓʁ 7
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏε։ൃͷۤ Devͷۤ αʔϏεͷ͕Εͯ͠·͍ɺ αʔϏεಉ࢜ͷґଘ͕͔ؔΒͳ͘ͳΔ ͜ͷαʔϏεΛվम͢ΔͱɺͲ͜ʹӨڹ͢Δʁ ͍·ى͖ͨΤϥʔɺͲ͕͜ݪҼͳͷʁ ͦͦΘΕͯͳ͍αʔϏεͳ͍ͷʁ 8
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏε։ൃͷۤ Opsͷۤ ࢹ͖͢αʔόϓϩηεͷ͕ଟ͍ 1000ݸͷϓϩηεͯ͢ਖ਼ৗʹಈ͍͍ͯΔʁ ϩάϑΝΠϧ͕ࢄͯ͠͠·͏ ͍·ى͖ͨΤϥʔΛௐΔͨΊʹɺ ͲͷϩάϑΝΠϧΛݟΕ͍͍ͷʁ 9
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏε։ൃͷۤ OpsΛߟྀͨ͠Devͷۤ ͷஹީΛϩά͔Βݕͮ͠Β͍ ͜ͷerrorϝοηʔδແࢹ͍͍ͯ͠ͷʁ ͜ͷinfoϝοηʔδແࢹ͍͍ͯ͠ͷʁ APIͷ༷͚ͩͰͳ͘ɺϩΪϯά༷·Ͱ ࣄલʹશܾͯΊ͖ͬͯकΒͤΔͷʁ 10
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏε։ൃͷۤ 11 ཱʹΑͬͯۤҟͳΔ͕ ͍ͣΕʹͤΑαʔϏεϩά͕ ૿͑ͨ͜ͱͰ ݟΔ͖ͷ͕ࡶԽ͢Δ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 12 ͦ͜ͰՄࢹԽͰ͢Α
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 13 #2 ՄࢹԽʹ͏πʔϧ܈
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 2. ՄࢹԽʹ͏πʔϧ܈ ຊհ͢Δπʔϧ܈ αʔϏεؒͷґଘੑΛՄࢹԽ Spring Cloud Sleuth + Zipkin ϩάϑΝΠϧΛՄࢹԽ Elasticsearch + Logstash + Kibana + Filebeat αʔόϓϩηεͷঢ়ଶΛՄࢹԽ Elasticsearch + Kibana + Metricbeat 14
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 15 ඦฉҰݟʹ͔ͣ͠
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 2. ՄࢹԽʹ͏πʔϧ܈ Spring Cloud Sleuth + Zipkin 16 ϘτϧωοΫ Λ୳͢
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 2. ՄࢹԽʹ͏πʔϧ܈ Spring Cloud Sleuth + Zipkin 17 αʔϏεؒͷ ґଘੑΛѲ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 2. ՄࢹԽʹ͏πʔϧ܈ Elasticsearch + Logstash + Kibana + Filebeat 18 Ϩϕϧผʹ ϩά݅ΛѲ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 2. ՄࢹԽʹ͏πʔϧ܈ Elasticsearch + Kibana + Metricbeat 19 Ϧιʔεঢ়گ ΛѲ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 20 Ͱߏங͕େมͳΜͰ͠ΐ͏ʁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 21 ͍ɺ10ਓ݄Ͱ1000ສԁʹͳΓ·͢ʂ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 22 ɾɾɾͱ͔Ͱͳ͍ͬͯͰ͢ɻ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 23 #3 αʔϏεґଘੑͷ ՄࢹԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ ԿͷͨΊʹΔͷʁ αʔϏεͷվम࣌ʹɺͦͷӨڹൣғΛ֬ೝ͍ͨ͠ Τϥʔ͕ൃੜͨ͠ࡍʹɺ֬ೝ͖͢ൣғΛಛఆ͍ͨ͠ ͠ɺ࣮ࡍʹΘΕ͍ͯͳ͍αʔϏε͕͋Εఀࢭ ͍ͨ͠ → ओʹ։ൃऀ͚ͷՄࢹԽͰ͋Δ 24
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͰαʔϏεґଘੑΛՄࢹԽ Spring Cloud Sleuthͱʁ Distributed Tracing ෳαʔόΛލ͕ΔϦΫΤετʹڞ௨ͷIDΛৼͬͯ ʢHTTP/AMQPϔομͳͲͰͤ͞ͳ͕Βʣ ॲཧΛͰ͖ΔΑ͏ʹ͢ΔΈ Zipkinͱʁ Distributed Tracing Visualization ෳαʔόΛލ͕ΔϦΫΤετΛՄࢹԽ͢Δ 25
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͷΠϝʔδ 26 Microservice1 Microservice2 طʹ࡞ͬͯ͋Δ ϚΠΫϩαʔϏε
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͷΠϝʔδ 27 Microservice1 Microservice2 Zipkin Server HTTP Zipkin UI Server SleuthΛͬͯ ݺͼग़͠ใΛ zipkinʹૹΔ ੵ ՄࢹԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + Zipkinͷద༻ Spring Cloud Sleuth ϚΠΫϩαʔϏεͷpom.xmlͷdependenciesʹ ʮspring-cloud-starter-zipkinʯΛՃ ίʔυͷมߋҰͳ͠ Zipkin ৽نϓϩδΣΫτΛ࡞ͬͯpom.xmlʹ ʮzipkin-serverʯͱʮzipkin-autoconfigure-uiʯΛՃ MainΫϥεΛҰͭ࡞Δ 28
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Zipkinαʔόͷ։ൃ 29 @SpringBootApplication @EnableZipkinServer public class ZipkinApplication { public static void main(String[] args) { SpringApplication.run(ZipkinApplication.class, args); } }
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ Spring Cloud Sleuth + ZipkinͷΠϝʔδ 30 Microservice1 Microservice2 Zipkin Server HTTP Zipkin UI Server Zipkin Client (spring-cloud-starter-zipkin) Zipkin UI (zipkin-autoconfigure-ui) Zipkin Server (zipkin-server)
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 3. αʔϏεґଘੑͷՄࢹԽ 31 Demo
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 32 ͜͏͍͏ࣄ͕؆୯ʹͰ͖Δ͔Β Spring CloudΛ͏Μͩ ͍ͬͯ͏ײ֮ɺ͋Γ·͢
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 33 #4 ϩάͷՄࢹԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 34 ͦͦϩάͬͯ ৗతʹݟͯ·͢ʁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 35 ͕ى͖ͨ࿈བྷΛड͚͔ͯΒ ݪҼΛ֬ೝ͢ΔͨΊ͚ͩʹ ϩάΛͬͯͨΓͯ͠·ͤΜʁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 36 ৗతʹϩάΛݟͯ ఆ֎ͷࣄ͕ൃੜ͍ͯ͠ͳ͍͔Λ ֬ೝ͢Δ͜ͱͰ αʔϏεϨϕϧ͕֨ஈʹ্͕Δ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 37 ͱݴ͑ɺϩάΛͰݟΔͷແཧɻ ͔ͩΒՄࢹԽ͢ΔΜͰ͢
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ԿͷͨΊʹΔͷʁ ΞϓϦέʔγϣϯϩάͷՄࢹԽ γεςϜ͕҆ఆՔಇ͍ͯ͠Δ͔ͷѲ ఆ͠ͳ͍͕ى͖͍ͯͳ͍͔ʁ ΞΫηεϩάͷՄࢹԽ దʹϨεϙϯεΛฦ͍ͤͯΔ͔Ͳ͏͔ͷѲ HTTPεςʔλεͷ400൪ɺ500൪͕ൃੜ͍ͯ͠ͳ͍͔ʁ ϨεϙϯελΠϜ͕େ͖͘ͳ͍ͬͯͳ͍͔ʁ ٸܹͳΞΫηε૿ͳͲ͕ى͖͍ͯͳ͍͔ͷѲ SNSχϡʔεαΠτͳͲͰऔΓ্͛ΒΕͨʁ ߈ܸΛड͚ͨʁ 38
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ElasticελοΫͰϩάΛՄࢹԽ Elasticsearch ࢄશจݕࡧΤϯδϯɻϩάσʔλΛੵ͢Δ Kibana ՄࢹԽ༻ͷUI Filebeat σʔλసૹπʔϧͰ͋ΔBeatsγϦʔζͷҰͭɻ ϑΝΠϧΛಡΈࠐΈɺLogstashʹసૹ͢Δɻ Logstash σʔλͷՃɾసૹπʔϧ Filebeat͔ΒσʔλΛड͚औΓɺՃͯ͠ɺElasticsearchʹసૹ͢Δ 39
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 40 Microservice1 Microservice2 طʹ࡞ͬͯ͋Δ ϚΠΫϩαʔϏε
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 41 Microservice1 Microservice2 Filebeat Filebeat FilebeatͰ ϩάΛಡΈࠐΈ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 42 Microservice1 Microservice2 Filebeat Filebeat Logstash LogstashͰ ϩάΛύʔεͯ͠ JSONԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 43 Microservice1 Microservice2 Filebeat Filebeat Elasticsearch Kibana Logstash σʔλͷੵ ՄࢹԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ 44 Demo
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ͰͳͥElasticsearchͳͷʁ ElasticελοΫʹΑΔɺऩूɾՃɾੵɾՄࢹԽͷҰ؏ੑ πʔϧͷΈ߹ΘͤΛ໎Θͳ͍͍ͯ͘ Elasticsearchͷෳࡶͳ݅ͰϑΟϧλΛֻ͚ͨ͏͑ͰͷՄࢹԽͳͲ༰қ ʮϩάऩूͱՄࢹԽʯΛతͱͨ͠߹ɺOSSͰଞͷબࢶ͕΄΅ͳ͍ʢ༻ ͰSplunkͳͲ͋Γʣ ʮ࣌ܥྻͷσʔλʯΛѻ͏͍͔ͭ͋͘Δ͕ɺϩάͦͷͷΛѻ͑ Δͷ΄ͱΜͲͳ͍ AWSͷCloud Watch LogsͳͲϩάΛऩू͢Δ͕ɺෳࡶͳϑΟϧλͳͲֻ ͚ΒΕͳ͍ 45
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 4. ϩάͷՄࢹԽ ͰͳͥElasticsearchͳͷʁ ʮ͋ͱ͔Βʯूܭ࣠Λม͑ΒΕΔڧ͞ ࣌ܥྻͷσʔλΛه͢ΔϝτϦΫεπʔϧͰɺͨͱ͑ޙ͔Βʮಛఆͷ Ҭ͔ΒͷΞΫηεʯ͚ͩʹߜͬͨੳͳͲ͕͍͠ ࣄલʹܾΊͨΛੵ͢Δ͜ͱ͕ओతͳͷͰ ϩάϑΝΠϧΛղੳ͢ΔπʔϧͰɺςϥόΠτڃͷղੳΛ͢Δ͜ͱࠔɻ ElasticsearchͳΒݕࡧͷߴ͞ͱ͍͏ྗΛ׆͔ͯ͠ɺूܭ࣠Λม͑ͳ͕Βߴ ʹݕࡧ͕Ͱ͖Δɻ ͭ·Γɺ͍ͬͨΜࡶʹϩάΛElasticsearchʹೖΕ͓͍ͯͯɺ ޙ͔ΒܾΊͨ࣠Ͱੳ͢Δɺͱ͍͏ΞδϦςΟͷߴ͍ରԠ͕औΓ͍͢ 46
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 47 #5 γεςϜϦιʔε ͷՄࢹԽ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 48 ElasticsearchೖΕͨΜͩ͠ ͍ͭͰʹϦιʔεՄࢹԽ͠Α͏ͥ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 5. γεςϜϦιʔεͷՄࢹԽ ԿͷͨΊʹΔͷʁ γεςϜ͕҆ఆՔಇ͍ͯ͠Δ͔ͷѲ CPU༻͕ߴಅ͍ͯ͠ͳ͍͔ʁ ϝϞϦ͕ϦʔΫ͍ͯ͠ͳ͍͔ʁ σΟεΫͷ༰ྔ͕ރׇͯ͠ɺγεςϜఀࢭੇલʹͳ͍ͬͯͳ͍͔ʁ ਖ਼ຯͷɺ͜Εօ͞Μɺ͍ͬͯΔͱࢥ͍·͢ɻ ZabbixɺMackerelɺDataDogɺCloud WatchͳͲɺ ྑ͍πʔϧଟ͋Γ·͢ɻ 49
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 50 ͰɺΞΫηε͕ٸ૿ͨ͠ͱ͖ʹ CPU༻͕ͲΕ͙Β͍ʹͳͬͯ ϨεϙϯελΠϜ͕Ͳ͏ͳ͔ͬͨ ૬ؔΛݟͨ͘ͳ͍ʁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 51 ElasticsearchͰϦιʔεใ ूΊΕ ϩάใͱϦιʔεใΛ ฒͯ֬ೝͰ͖Δ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 5. γεςϜϦιʔεͷՄࢹԽ ElasticελοΫͰϩάΛՄࢹԽ Elasticsearch ࢄશจݕࡧΤϯδϯɻϩάσʔλΛੵ͢Δɻ͖ͬ͞આ໌͠·ͨ͠ɻ Kibana ՄࢹԽ༻ͷUIɻ͖ͬ͞આ໌͠·ͨ͠ɻ Metricbeat Ϧιʔεใͷऩूπʔϧɻ ϦιʔεใΛಡΈऔͬͯɺLogstashʹసૹ͢Δɻ MySQLPostgreSQLɺRedisɺnginxͳͲͷϛυϧΣΞͷAPIΛୟ͍ͯ ใΛऩू͢Δػೳ͋Δʢࠓճઆ໌͠ͳ͍Αʣ 52
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 5. γεςϜϦιʔεͷՄࢹԽ ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 53 Microservice1 Microservice2 Metricbeat Metricbeat MetricbeatͰ ϦιʔεΛಡΈࠐΈ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 5. γεςϜϦιʔεͷՄࢹԽ ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 54 Microservice1 Microservice2 Metricbeat Metricbeat Elasticsearch Kibana σʔλͷੵ ՄࢹԽ Ճ͠ͳ͍ͷͰ Logstashෆཁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 5. γεςϜϦιʔεͷՄࢹԽ 55 Demo
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 56 ͱ͜ΖͰɺ ϩάใͱϦιʔεใ͚ͩͰͳ͘ ͦ͜ʹച্ֹۚͳͲฒΕ ɾɾɾ͋ͱ͔Δͳʁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 57 ”CPUεϖοΫ͕Γͳͯ͘ ΞΫηεΛࡹ͘͜ͱ͕Ͱ͖ͣ ͦͷ͍ͤͰചΓ্͕͛མͪ·ͨ͠”
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 58 γεςϜࢿΛଅ͚ͩ͢ͷ ใΛఏڙͰ͖ΔՄೳੑ͕͋Δ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 59 #6 ՄࢹԽͱKafka
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 60 ݴ͍͔͚ͨͬͨͩͪΌ͏Μ͔ͱ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 61 ࠓճͷՄࢹԽͷ͓͞Β͍
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka Spring Cloud Sleuth + ZipkinͷΠϝʔδ 62 Microservice1 Microservice2 Zipkin Server HTTP Zipkin UI Server
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 63 Microservice1 Microservice2 Filebeat Filebeat Elasticsearch Kibana Logstash
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 64 ͠ZipkinLogstash͕མͪͨΓ ElasticsearchͷΩϟύγςΟΛ ӽ͑ͨΒʁ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 65 ใͷܽམɺͦΕΛ͍͗ͨ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka KafkaΛ༻͍ͨγεςϜͷ҆ఆԽ Apache Kafkaͱ ͻͱ͜ͱͰݴ͏ʮΩϡʔͷΑ͏ͳͷʯ ͨͩ͠աڈ1िؒʢσϑΥϧτઃఆʣͷσʔλΛอ͓࣋ͯ͠Γɺ ͍ͭͰ࠶ૹՄೳ ͍ํ ϚΠΫϩαʔϏε͔ΒZipkinͷؒʹKafkaΛڬΉ BeatsͱLogtashElasticsearchͷؒʹKafkaΛڬΉ 66
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka Spring Cloud Sleuth + ZipkinͷΠϝʔδ 67 Microservice1 Microservice2 Zipkin Server HTTP Zipkin UI Server
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka Spring Cloud Sleuth + ZipkinͷΠϝʔδ 68 Microservice1 Microservice2 Zipkin Server Zipkin UI Server Kafka
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka Spring Cloud Sleuth + ZipkinͷΠϝʔδ 69 Microservice1 Microservice2 Zipkin Server Zipkin UI Server Kafka spring-cloud-sleuth-stream spring-cloud-stream-binder-kafka zipkin-autoconfigure-ui spring-cloud-sleuth-zipkin-stream spring-cloud-stream-binder-kafka
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka Spring Cloud Sleuth + ZipkinͷΠϝʔδ 70 Name artifactId Log HTTP Kafka Sleuth spring-cloud-starter-sleuth Service Sleuth Stream spring-cloud-sleuth-stream Service Zipkin Client spring-cloud-starter-zipkin Service Zipkin Stream spring-cloud-sleuth-zipkin-stream Zipkin Zipkin UI spring-boot-starter zipkin-autoconfigure-ui Zipkin Zipkin Zipkin Server spring-boot-starter zipkin-server Zipkin Stream Kafka spring-cloud-stream-binder-kafka Both
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 71 Microservice1 Microservice2 Filebeat Filebeat Elasticsearch Kibana Logstash
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka ElasticελοΫʹΑΔՄࢹԽͷΠϝʔδ 72 Microservice1 Microservice2 Filebeat Filebeat Elasticsearch Kibana Logstash Kafka
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka ͳͥKafkaΛ͏ͷ͔ʁ େྔͷΞΫηεʹΑΔՄࢹԽγεςϜશମͷఀࢭΛ͙ ElasticsearchLogstash͕աෛՙʹΑΓఀࢭ͢Δ ͦͷؒʹདྷͨϝοηʔδ͕ফࣦͯ͠͠·͏͜ͱΛ͙ LogstashͷઃఆΛमਖ਼ͨ͠ޙʹɺ࠶ૹͰ͖Δ Logstashͷઃఆʹϛε͕͋Γɺύʔεʹࣦഊͯ͠͠·ͬͯɺ ઃఆΛͨ͠͏͑ͰKafka͔ΒऔΓͤਖ਼͘͠గਖ਼Ͱ͖Δ ཁ͢ΔʹՄࢹԽγεςϜͷ҆ఆԽ ՄࢹԽͷॏཁੑ͕͍߹ɺผʹͳͯ͘ྑ͍ ηΩϡϦςΟ༻్ͰՄࢹԽ͢Δ߹ͳͲɺͥͻೖΕ͍ͨΑͶʁ 73
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 6. ՄࢹԽͱKafka Spring Cloud Streamͷྑ͍ྫͱݴ͑Δ Spring Cloud StreamɺҰݟ͢Εʮࣗʹ͋·Γؔͷͳ͍ͷʯͱ ଊ͑ͯ͠·͍͕ͪ ͰࠓճͷՄࢹԽɺશʹSpring Cloud Streamͱಉ͡ྲྀΕʹͳΔ ʮ͜ͷαʔϏεʗϛυϧΣΞΛࢭΊͯɺϝοηʔδΛܽམͤ͞Δ͜ͱͳ ͘ॲཧͰ͖Δ͔ʁʯͱ͍͏ࢹͰߟ͑ΕɺSpring Cloud StreamͷϝϦοτ ͕·ͨݟ͑ͯ͘Δ ༨ஊ͚ͩͲɺBeatsͱLogstashͷؒόοΫϓϨογϟʔܕͷಠࣗϓϩ τίϧͳͷͰɺ͜͜Λਅʹߟ͑ΔͱɺόοΫϓϨογϟʔͷϝϦοτ ·ͨݟ͑ͯ͘Δɻͦͷ·͍ͨͣΕʂ 74
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. 75 ·ͱΊ
Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright
© Acroquest Technology Co., Ltd. All rights reserved. ·ͱΊ DevܥSpring Cloud Sleuth + ZipkinʹΑΔ αʔϏεґଘੑͷՄࢹԽΛ͙͢Δ͖ OpsܥElasticελοΫΛͬͯϩάͷՄࢹԽΛ ͙͢Δ͖ োγεςϜఀࢭ͕ى͖Δ͜ͱେલఏͱͯ͠ɺ KafkaΛ༻͍ͨ҆ఆԽΛݕ౼͢Εɺ ؾ͍ͮͨΒSpring Cloud StreamόοΫϓϨογϟʔͷ ϝϦοτ͕͔ΔΑ͏ʹͳΔΑʂ 76
Copyright © Acroquest Technology Co., Ltd. All rights reserved. 77
Enjoy visualizing your Spring Cloud Applications!