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
360
Hue で始める おうちハック入門
critical_alert
1
2.1k
Blue/Green deploymentへの道のり
critical_alert
1
120
入門Let's Encrypt
critical_alert
2
2.3k
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Building Applications with DynamoDB
mza
91
6.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Agile that works and the tools we love
rasmusluckow
328
21k
The Cost Of JavaScript in 2023
addyosmani
45
7k
The Language of Interfaces
destraynor
154
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Bash Introduction
62gerente
608
210k
Code Review Best Practice
trishagee
65
17k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
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