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
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
How GitHub (no longer) Works
holman
311
140k
Fireside Chat
paigeccino
34
3.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
4 Signs Your Business is Dying
shpigford
181
21k
Automating Front-end Workflow
addyosmani
1366
200k
Unsuck your backbone
ammeep
669
57k
Building an army of robots
kneath
302
44k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Statistics for Hackers
jakevdp
796
220k
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