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.6k
Mackerelでサーバ監視はじめた話
社内勉強会用
Hirokazu Sugiuchi
June 01, 2015
Tweet
Share
More Decks by Hirokazu Sugiuchi
See All by Hirokazu Sugiuchi
FFLT_12.pdf
critical_alert
0
68
AWS認定 ソリューションアーキテクトアソシエイトを受けてきた話
critical_alert
1
350
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
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Gamification - CAS2011
davidbonilla
80
5k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How to Ace a Technical Interview
jacobian
276
23k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Navigating Team Friction
lara
183
14k
Teambox: Starting and Learning
jrom
133
8.8k
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