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
Mackerelでサーバ監視はじめた話
Search
Hirokazu Sugiuchi
June 01, 2015
0
1.7k
Mackerelでサーバ監視はじめた話
社内勉強会用
Hirokazu Sugiuchi
June 01, 2015
Tweet
Share
More Decks by Hirokazu Sugiuchi
See All by Hirokazu Sugiuchi
FFLT_12.pdf
critical_alert
0
70
AWS認定 ソリューションアーキテクトアソシエイトを受けてきた話
critical_alert
1
370
Hue で始める おうちハック入門
critical_alert
1
2.1k
Blue/Green deploymentへの道のり
critical_alert
1
130
入門Let's Encrypt
critical_alert
2
2.4k
Featured
See All Featured
A Tale of Four Properties
chriscoyier
158
23k
Practical Orchestrator
shlominoach
187
10k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
8
700
Being A Developer After 40
akosma
90
590k
Adopting Sorbet at Scale
ufuk
75
9.3k
Scaling GitHub
holman
459
140k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.6k
Code Reviewing Like a Champion
maltzj
522
39k
Optimizing for Happiness
mojombo
377
70k
Producing Creativity
orderedlist
PRO
344
40k
The Invisible Side of Design
smashingmag
299
50k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
MackerelͰ αʔόࢹ͡Ίͨ 2015/05/08 Hirokazu Sugiuchi
ࢹπʔϧେ͖ʂ
ͦͦαʔόࢹͬͯɹɹ ͳʹ͢Δͷʁ
͋Γ͕ͪͳো • ͳΜ͔αΠτʹΞΫηεͰ͖ͳ͍ • ΞΫηεͰ͖Δ͚Ͳද͕͓͍ࣔͦ • 503͕ग़ͯΔ͚ͲͳΜͰ ͍͍ͩͨɺϝϞϦ৯͍ͭͿ͢ɺσΟεΫ͕͍ͬͺ͍ɺLAߴಅ
ͳΜͰࢹΛ͢Δͷ͔ • ͕ى͖Δલʹؾ͍ͮͯରԠΛଧ͍ͪͨ • ͕ى͖͙ͨ࣌͢ରԠ͍ͨ͠ • োൃੜ࣌ʹԿ͕ى͖ͯΔ͔ѲͰ͖Δ
࠷ۙΠϯϑϥνʔϜͰ ͋Γ͕ͪͳձ
ࢹͲ͏͢Δʁ
͞·͟·ͳࢹπʔϧ • Nagios • Cacti • Zabbix • AWS CloudWatch
ࢹͷઃఆͬͯΉ͔͍ͣ͠ • NagiosͷΑ͏ͳOSSઃఆ͕ෳࡶ • ษڧ͠ͳ͍ͱΠϯετʔϧͰ͖ͳ͍ઃఆͰ͖ͳ͍ • ΞϨࢹ͍ͨ͠Μ͚ͩͲͲ͏ͬͯՃ͢Δͷʁ • খنͷαʔϏεͰ͕ͬͭΓࢹγεςϜΛߏங Ͱ͖ͳ͍ɺ༨༟͕ͳ͍
ࢹγεςϜΛߏங͍ͨ͠ Θ͚͡Όͳ͔ͬͨ
αʔϏεʹҟৗ͕ͳ͍͔ Γ͍͚ͨͩͳΜʂ
ԿΛࢹ͢Ε͍͍Μ͚ͩͬʁ • CPU usage • LoadAverage • Disk usage •
Memory usage • URL?log?process?
ͱΓ͋͑ͣ࠷ݶͷɹɹɹɹ ࢹΛཔΉʂ
Mackerel https://mackerel.io
Demo https://mackerel.io/orgs/critical-alert
࠷ۙಋೖ͠·ͨ͠
Mackerelͬͯ͜Μͳͷ • ͯͳӡӦͷαʔόʔࢹͷSaaS • ΤʔδΣϯτΠϯετʔϧܕ • தԝαʔόʔϨε • ࢹͷͨΊʹϙʔτ։͚ͳ͍͍ͯ͘ •
ηοτΞοϓ؆୯
mackerel-agent • GoͰॻ͔Ε͍ͯΔΤʔδΣϯτ=ґଘ͢Δ ύοέʔδ͕গͳ͍ • ͍ͭ͜ΛΠϯετʔϧͯ͠ىಈ͓ͯ͘͠ • σϑΥϧτͰϚγϯεϖοΫͱ6छྨͷɹɹɹ ϝτϦΫεΛऩूͯ͘͠ΕΔ
Πϯετʔϧ(RHEL,CentOS) $ curl -fsSL https://mackerel.io/assets/files/scripts/setup-yum.sh | sh $ sudo yum
install -y mackerel-agent
ઃఆ͕؆୯ͳΒࣗͰઃఆ Ͱ͖Δ͔ͬͯࢥ͑Δ(େࣄ)
ΧελϜϝτϦοΫ
ΧελϜϝτϦοΫ • ϓϥάΠϯΛೖΕΔͱϛυϧΣΞͷϝτϦ ΫεऔಘͰ͖Δ • ͪΖΜࣗ࡞Մೳ • https://github.com/mackerelio/mackerel- agent-plugins
mackerel-agent.conf [plugin.metrics.vmstat] command = "ruby /path/to/vmstat-metrics.rb" ઃఆϑΝΠϧʹॻ͍͓ͯ͘ͱagent͕ ఆظ࣮ߦͯ͠ϝτϦΫεΛ͛ͯ͘ΕΔ
αʔϏεϝτϦοΫ • αʔόͱ݁ͼ͔ͭͳ͍ϝτϦοΫΛ ͦ͏ݺΜͰ͍Δ • ྫ͑Webαʔόͷεςʔλείʔυ ϨεϙϯελΠϜ • ELBRDSͷϝτϦΫεऔಘՄೳ •
fluentdΛͬͯߘͰ͖Δ
άϥϑͷຒΊࠐΈ • iframeͰqiitaʹຒΊࠐΉͱ͓खܰμογϡ Ϙʔυ͕࡞ΕΔ(ཁϩάΠϯ)
API • capistranoͱmackerel apiΛΈ߹Θͤͯ mackerelʹొ͞ΕͯΔϗετΛσϓϩΠɹ ରͱͯ͠ར༻ग़དྷΔ • http://help-ja.mackerel.io/entry/advanced/ capistrano-2.x
ͦͷଞ͍Ζ͍Ζ
௨पΓ • ௨ઌͨ͘͞Μ͋ͬͯඞཁͳͷͦΖͬ ͯΔ • ௨ઌʹΑͬͯ༥௨͕͖͔ͳ͘ඍົͳͱ͜ Ζ • ࠶௨ͷΑ͏ͳͷ͕ແ͍
URLࢹ͕ແ͍ • ࠓޙ࣮༧ఆͩͦ͏Ͱ͢ʂ • ϨεϙϯελΠϜΛՄࢹԽ • εςʔλείʔυɺϨεϙϯελΠϜͰɹɹ Ξϥʔτ • service
watcherpingdomͷΘΓʹͳΔ͔
mackerel-agent໋͕ • mackerel-agent͕མͪΔͱΞϥʔτ্͕Δ (Connectivity) • ϓϩηε୯ମͰམͪͨ࣌monit͔ͳΜ͔Ͱ ى͜͢ඞཁ͋Δ͔
ΞΧϯτ͕ͳ͍ͱάϥϑ͕… • ͔ͤͬ͘ͷάϥϑຒΊࠐΈΞΧϯτ͕ͳ͍ ͱදࣔ͞Εͳ͍ • Ξϥʔτൃੜ࣌ͷslackͷάϥϑ௨ΞΧ ϯτͳͯ͘େৎ • ࣾʹϝτϦΫεΛެ։ͨ͠ΓͰ͖ͳ͍ •
͜Εࠓޙղফ͢Δ༧ఆͱͷ͜ͱ
͓ΘΓʹ • ࠷ݶͷϦιʔεࢹͰ͖Δ • ͜ͷάϥϑ͕͔Ͳ͏͔அ͢Δͷਓؒ • ᮢΛઃఆ͢Δͷਓؒ • దͳͱ͜Ζʹ௨ઃఆ͢Δͷਓؒ •
ࢹγεςϜͷӡ༻Λ͠ͳ͍ɺ্هʹྗ
͓·͚ • ࣮ARM൛͋Δ • github͍͘ͱϏϧυࡁΈόΠφϦ͕ஔ͍ͯ͋Δ • ͦΕ͢ͳΘͪRaspberryPiͰಈ͘ͱ͍͏͜ͱʂ • ԹηϯαʔͰ෦ͷԹΛऔಘ͠Mackerel