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
Become a Pro
speakerdeck
PRO
25
5k
Building Your Own Lightsaber
phodgson
103
6.1k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Typedesign – Prime Four
hannesfritz
40
2.4k
Automating Front-end Workflow
addyosmani
1366
200k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
4 Signs Your Business is Dying
shpigford
180
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
880
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Ruby is Unlike a Banana
tanoku
97
11k
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