Mackerel for DevOps

Mackerel for DevOps

AWSコンサルティングパートナーのためのISV活用セミナー

Fc8163b687f0db1b9d41a57e5b607025?s=128

Hiromichi Sugiyama

September 12, 2017
Tweet

Transcript

  1. "84ίϯαϧςΟϯάύʔτφʔͷͨΊͷ*47׆༻ηϛφʔ .BDLFSFMGPS%FW0QT 4FQ )JSPNJDIJ4VHJZBNB

  2. Hiromichi Sugiyama / ਿࢁ ޿௨ גࣜձࣾ͸ͯͳ αʔϏεɾγεςϜ։ൃຊ෦ .BDLFSFMνʔϜ ϓϩσϡʔαʔ .BDLFSFM1SPEVDU.BOBHFS

    ܦྺ  େن໛؀ڥͰͷΠϯϑϥΤϯδχΞ  ΦʔϓϯιʔεͷϞχλϦϯάπʔϧ  4BB4γεςϜ  *5*-ϕʔεͷαʔϏεϚωδϝϯτ  ͸ͯͳͰ.BDLFSFMࣄۀ΁ܞΘΔ TVHJZBNB!IBUFOBOFKQ
  3. AWS DevOps Competency • ೔ຊاۀͰॳೝఆʂʂ

  4. ॻ੶ग़൛͞Ε·ͨ͠ʂ • Mackerel αʔό؂ࢹ[࣮ફ]ೖ໳ • SaaSͰ࣮ݱ͢Δ౷߹Πϯϑϥ؅ཧ • શࠃͷॻళAmazonͰઈࢍൃചத

  5. ΞδΣϯμ • ࣌୅ͷைྲྀͱސ٬ͷ՝୊ײ • Mackerelͷ֓ཁಛ௃ػೳʢ5બʣ • Mackerel for DevOpsʢ͸ͯͳͰͷ࣮ફྫʣ •

    Infrastructure as Codeʢ͸ͯͳͰͷ࣮ફྫʣ • Product Roadmapύʔτφʔ༷޲͚ϓϥϯ • MackerelͷϏδϣϯ
  6. 1 ࣌୅ͷைྲྀͱސ٬ͷ՝୊ײ

  7. • ϋΠϒϦουΫϥ΢υɾϚϧνΫϥ΢υʢϓϥΠϕʔτΫϥ ΢υؚΉʣͦΕͧΕ΁؅ཧγεςϜ͕෼ࢄ • ˠԣஅతʗ౷߹తʹ؅ཧͰ͖Δ࢓૊Έ΁ͷظ଴ ΦϯϓϨ→Ϋϥ΢υԽͷྲྀΕ ΦϯϓϨϛε Ϋϥ΢υϓϩόΠμʔ Ϋϥ΢υϓϥοτϑΥʔϚʔ

  8. ·͢·͢ಈతͰศརʹͳΔΠϯϑϥ؀ڥ • %ZOBNJD*OGSBTUSVDUVSF1MBUGPSN͸ٸ଎ʹศརʹ • ˠෳࡶੑͱ͏·͘޲͖߹͏࢓૊Έ΁ͷظ଴

  9. • ϏδωεͰউͪ࢒ΔͨΊͷඞਢ৚݅΁ • ैདྷܕͷ։ൃ΍ӡ༻ख๏ͷݶք • ৽ͨͳߟ͑ํ΍࢓૊ΈΛ༻͍Δඞཁ͕͋Δ͕Կ͔ ΒखΛ͚ͭͯΑ͍͔Θ͔Βͳ͍ • ˠϓϥΫςΟεΛؚΊͨ࢓૊Έ΁ͷظ଴ ྑ͍αʔϏεΛ଎͘ސ٬΁ಧ͚Δඞཁੑ

  10. • ਐԽͷ଎͍Ϋϥ΢υϓϥοτϑΥʔϜ΁௥ै ͨ͠؅ཧγεςϜͷਐԽ͕೉͍͠ • ؅ཧγεςϜࣗମͷ௠෗Խ • ؅ཧγεςϜࣗମ͕؅ཧ͢Δ৘ใͷ௠෗Խ • ˠ ΑΓಈతͰॊೈͳ؅ཧߏ଄΁ͷظ଴

    ௠෗Խͱͷઓ͍
  11. 2 Mackerelͷ֓ཁ

  12. Mackerelͱ͸ʁ • l4BB4ܕzαʔόʔ؂ࢹɾΠϯϑϥ؅ཧαʔϏε • ΤϯδχΞ͕ཉ͔ͬͨ͠zϫΫϫΫz͢ΔΑ ͏ͳػೳΛఏڙ͠ɺѹ౗తͳzޮ཰ԽzΛ࣮ݱ • ͸ͯͳͷओྗαʔϏεΛ͑͞͞ଓ͚͖ͯͨ ʢ࠷ߴͷυοάϑʔσΟϯάʣ

  13. DevOpsͷίΞͱͯ͠ • ୯ͳΔ؂ࢹαʔϏεͰ͸ͳ͍ • %FW0QTϥΠϑαΠΫϧͷίΞͱͯ͠ޮ཰Խ %FW 0QT

  14. ΞʔΩςΫνϟʔ • ΤʔδΣϯτ͔Β ϝτϦοΫΛ౤ߘ )5514 3&45"1*

  15. ௚ײతͳϢʔβʔମݧ

  16. ؆୯ʹ௚͙͸͡ΊΒΕΔ • ΨΠυʹै͏͚ͩ • ͨͬͨ਺෼ʢϫϯϥΠφʔʣ mackerel-agent written in Golang

  17. ࠷খͷϧʔϧ͕࠷ߴͷརศੑΛ • ΤʔδΣϯτΛ্ཱͪ͛Δ͚ͩͰ • ࣗಈతʹ؂ࢹ͕࢝·Γ • ಉ͡ϩʔϧͷϗετ͸ಉ͡άϥϑ΁

  18. ৗʹਐԽ͠ଓ͚ΔαʔϏε ຖि৽ػೳͷϦϦʔεΛܧଓத ௠෗ԽͤͣৗʹਐԽ ि࿈ଓ

  19. બ͹ΕΔཧ༝ • ಋೖʗ6*͕؆୯Ͱ෼͔Γ΍͍͢ • ։ൃεϐʔυʢຖिϦϦʔεʣ • ϚϧνΫϥ΢υͰ࢖͑Δ • ೔ຊޠαϙʔτ͕ॆ࣮ •

    ૊Έ߹Θͤͯ%FW0QTͷத֩ͱͯ͠׆༻Ͱ͖Δ
  20. 3 ಛ௃ػೳʢ5બʣ

  21. 1.ଟ࠼ͳΞϥʔτ௨஌ • νϟοτ΁ͷάϥϑ෇͖௨஌ 4MBDL )JQ$IBU  5ZQF5BML :BNNFS -*/& Slack

    Yammer LINE API Call SMS • 4.4΍ి࿩ՍిͰ௨஌ʢ5XJMJPʣ
  22. 2.URL֎ܗ؂ࢹ • ར༻ऀࢹ఺ͷ)551)5514؂ࢹ • ϨεϙϯελΠϜɺεςʔλείʔυɺϨεϙϯεจࣈྻ • 44-ূ໌ॻͷ༗ޮظݶ • ΧελϜϔομϝιου Web

    API URL Web Service URL ΧελϜϔομʗϝιου
  23. 3. AWS Integration • "84$MPVE8BUDI"1*͔Β༷ʑͳϝτϦοΫ΍ΠϕϯτΛऔಘ͠ՄࢹԽ • ୆ͷϗετͱͯ͠؅ཧ • &$ "-#

    $-# 3%4 &MBTUJ$BDIF 3FE4IJGU -BNCEB ʜ ֦େத API Amazon CloudWatch Amazon RDS Amazon ELB
  24. 4.େن໛؀ڥͱͷ਌࿨ੑ • ೚ҙͷݖݶͰϢʔβʔΛΦʔΨχθʔγϣϯʢ؅ཧൣғʣ΁Ϛοϐϯά • ̎ஈ֊ೝূɺ*1ΞυϨε੍ݶɺೝূํ੍ࣜݶ ͳͲ • খن໛ʙେن໛؀ڥ·Ͱద༻͠΍͍͢ߏ଄ User A

    User B User C User D Service A Service B Role 1 Role 2 Role 3 Host 1 Host 2 Host 3 Host 4 Read Write Read Only Owner IP Address Authentication A.A.A.A Service A Service B Role 1 Role 2 Role 3 Host 1 Host 2 Host 3 Host 4 Read Write Read Only Owner IP Address Authentication A.A.A.A Service A Service B Role 1 Role 2 Role 3 Host 1 Host 2 Host 3 Host 4 Read Write Read Only Owner IP Address Authentication A.A.A.A ΦʔΨχθʔγϣϯ 9 ΦʔΨχθʔγϣϯ : ΦʔΨχθʔγϣϯ ;
  25. 5. άϥϑΞϊςʔγϣϯ • αʔϏεશମ΍ϩʔϧʹؔΘΔ༷ʑͳࣄ৅Λొ ࿥͠ɺ࣌ܥྻσʔλʔͱͷ૬ؔΛ೺Ѳ͠΍͘͢ • %FQMPZɺΩϟϯϖʔϯ • "1* $-*

    (6*͔Βૢ࡞
  26. 4 Mackerel for DevOps ʢ͸ͯͳͰͷ࣮ફྫʣ

  27. None
  28. None
  29. ଞʹ΋ଟ਺ͷαʔϏε͋Γ

  30. 16೥ͷ ྺ࢙

  31. marqs-60 CMX-50 ࣗ࡞αʔόʔ࣌୅ʢͦͷੲɿ਺೥લʣ

  32. ϋΠϒϦου؀ڥʢݱࡏʣ ΦϯϓϨ σʔληϯλʔ ύϒϦοΫ Ϋϥ΢υ ਺ઍ୆ͷେن໛؀ڥͰαʔϏεશମΛӡӦ

  33. େن໛ͳαʔϏε؀ڥ

  34. ΠϯϑϥΤϯδχΞ͸ ਺໊

  35. αʔϏεՁ஋Λਝ଎͔ͭܧଓత ʹߴΊ͍ͯͨ͘ͷޮ཰Խ͕ඞཁ

  36. ଘࡏ͢Δଟ਺ͷαʔϏε&ϗετ ਺ेͷαʔϏε ਺ઍͷϗετ

  37. ๲େͳ૊Έ߹Θͤ΁ͷରॲ

  38. αʔϏεɾϩʔϧɾϗετ Ұ؏ͨ͠؅ཧ֓೦Λ࠾༻ Service Role Host

  39. Service Role Host ͸ͯͳ Bookmark app proxy DB DB1 DB2

    app3 app2 app1 proxy1 proxy2 ద༻ྫɿ͸ͯͳBookmark
  40. Θ͔Γқ͞ͱརศੑΛ ਺ेͷαʔϏε ਺ඦͷϩʔϧ ਺ઍͷϗετ

  41. ։ൃ΍ӡ༻ͱͷؔΘΓ͸ʁ

  42. DevOps Lifecycle • ։ൃͱӡ༻͕ӬଓతͳαΠΫ ϧΛ੒͢ • ଟछଟ༷ͳޮ཰Խπʔϧ΍ αʔϏε͕ଘࡏ • దࡐదॴ

    • ޷Έ Mystery of DevOps Devops Lifecycle http://www.edureka.co/blog/mystery-of-devops/
  43. DevOps Tools • దࡐదॴɺ༏Εͨπʔϧ͕ଟ਺ 'FFECBDL %FWFMPQ 5FTU %FQMPZ .POJUPS

  44. logo (2) ݸผʹ͸ศརͰ͋Δ͕ɻɻɻ • ಈతͳΠϯϑϥ؀ڥΛͦΕͧΕఆٛͯ͠ѻ ͏ͷ͔ʁ Infrastructure Test Server Configuration

    Deploy ʁ
  45. ಈతͳߏ੒ϨδετϦͷඞཁੑ • ϗετ৘ใ͸Mackerel΁ू໿ • πʔϧؒΛૄ݁߹ʢศརͳAPIʣ logo (2) Infrastructure Test Server

    Configuration Deploy
  46. logo (2) ͸ͯͳͰͷ׆༻ • MackerelΛ࣠ͱͨ͠ಈత؅ཧΛ࣮ݱ droot Monitoring & Dynamic Configuration

    Registry Server Configuration Deploy Infrastructure Test SSH-Operation Infrastructure DNS Registry tinydns
  47. ߏ੒ϨδετϦ͸ඇৗʹ؆୯ ϗετ ᶃ ϗετىಈ࣌ʹ ඞͣαʔϏεͱϩʔϧΛηοτ͠ MackerelΤʔδΣϯτΛىಈ͢Δ ᶄ Mackerelʹϗετ৘ใ͕ొ࿥͞ΕΔ ᶅ APIͰಈతʹϗετ৘ใΛऔΓग़͠

    ͯ࠶ར༻ ᶃ ᶄ ᶅ ʁ
  48. ߋʹॊೈͰมԽΛ௥ै͢ΔϨδετϦػೳ • ಈతͰॊೈɺ࠶ར༻͠΍͍͢σʔλετΞ • σʔλߏ଄͸೚ҙʹఆٛ • API,CLI,GUI,PluginͳͲΛར༻

  49. ϝλσʔλػೳ • ೚ҙͷKey-Value஋ΛJSONσʔλͱͯ͠ Mackerel΁ొ࿥ • ༷ʑͳ༻్Ͱ࠶ར༻Մೳ API,CLI,Plugin... CREATE READ UPDATE

    DELETE { "type": 12345, "region": "jp", "env": "staging", "instance_type": "c4.xlarge" } { "type": 12345, "region": "jp", "env": "staging", "instance_type": "c4.xlarge" } Host / Administrator
  50. ϝλσʔλػೳ • ఆظతͳϓϥάΠϯ࣮ߦͰͷొ࿥ ΍APIΛαϙʔτ • ϗετ͝ͱʹ೚ҙͷ໊લۭؒΛఆٛ͠ɺJSONσʔλͱ ͯ͠ొ࿥ʢ໊લۭؒ਺΍σʔλαΠζʹ੍໿͋Γʣ

  51. Ϣʔεέʔε • ಈతͳߋ৽Ͱৗʹ࠷৽ͷঢ়ଶΛ೺Ѳͯ͠࠶ར༻ • ϗετ؀ڥͷछผʢ%FWFMPQNFOU 5FTUJOH 4UBHJOH 1SPEVDUJPOʣΛఆٛͯ͠ɺ 1SPEVDUJPO؀ڥͷΈΛநग़ͯ͠ΦϖϨʔγϣϯ •

    Πϯετʔϧύοέʔδʢύοέʔδ໊ɿόʔδϣϯ൪߸ʣͰɺ੬ऑੑ͕ൃ֮ͨ͠΋ͷ͕ ಋೖ͞Ε͍ͯΔϗετͷΈΛநग़ͯ͠ߏ੒؅ཧπʔϧͰҰׅߋ৽ • Ӭଓతͳ5$1ίωΫγϣϯͷϦετΛάϥϑσʔλͱͯ͠࠶ར༻ ˠ ίʔυ؅ཧ͕*OGSBTUSVDUVSFBT$PEFͷଅਐʹߩݙ
  52. ʢ༧ఆʣ੬ऑੑεΩϟφ࿈ܞ • 044ͷ੬ऑੑεΩϟφʢ7VMTʣΛϝλσʔλϓϥάΠ ϯͱ࣮ͯ͠ߦՄೳ • ৗʹ࠷৽ͷ੬ऑੑ৘ใΛ΋ͱʹఆظతʹ؅ཧΠϯϑϥͷ ੬ऑੑ൑ఆΛ͢Δ͜ͱ͕Մೳ • ϓϥάΠϯͱͯ͠ఏڙ༧ఆ 7VMT76-OFSBCJMJUZ

    4DBOOFS IUUQTHJUIVCDPNGVUVSFBSDIJUFDUWVMTCMPCNBTUFS3&"%.&KBNE
  53. 5 Infrastructure as Code ʢ͸ͯͳͰͷ࣮ફྫʣ

  54. Infrastructure as Code • ΠϯϑϥΛίʔυͰએݴతʹهड़͢Δ͜ͱʹΑΓɺ ͍··Ͱιϑτ΢ΣΞ։ൃͰ༗ޮੑཱ͕ূ͞Ε͖ͯͨ ϕετϓϥΫςΟεΛΠϯϑϥ΁΋ద༻͢Δ Infrastructure as Code

    Managing Servers in the Cloud By Kief Morris Publisher: O'Reilly Media Final Release Date: June 2016
  55. Infrastructure as CodeͷԸܙ • ಈతͳΠϯϑϥ΁ͷରॲ • ਝ଎ʹɺԿ౓Ͱ΋ɺ࣮֬ʹಉ͡มߋ͕ՄೳʢετϨε͕ͳ͍ʣ • ো֐͔Βͷ෮چ଎౓ •

    ίʔυϨϏϡʔ • ୯७࡞ۀ͔Β཭ΕɺՁ஋͋Δ͜ͱʹ͕͚࣌ؒ͞ΔΑ͏ʹͳΔ
  56. ϞμϯͳΠϯϑϥπʔϧͷཁૉ 7$4 5FTU 0SDIFT USBUJPO 5%% $* $%

  57. ͸ͯͳͰͷҰྫ

  58. Dev Ops Service A Service B Service C ͸ͯͳͷ։ൃͱӡ༻ͷମ੍ •

    Ops͸Ұͭͷ૊৫͕ͩɺαʔϏε͝ͱʹ୲౰ΛΞαΠϯ͍ͯ͠Δ
  59. Dev Ops Service A Service B Service C ։ൃͱӡ༻ͷମ੍ •

    Ops͸Ұͭͷ૊৫͕ͩɺαʔϏε͝ͱʹ୲౰ΛΞαΠϯ͍ͯ͠Δ Webアプリケーション エンジニア
  60. Dev Ops Service A Service B Service C ։ൃͱӡ༻ͷମ੍ •

    Ops͸Ұͭͷ૊৫͕ͩɺαʔϏε͝ͱʹ୲౰ΛΞαΠϯ͍ͯ͠Δ Webアプリケーション エンジニア Webオペレーション エンジニア
  61. ίʔυ؅ཧ͢Δར఺ʢҰྫʣ • ίʔυϨϕϧͰՄࢹԽ͞Ε͍ͯΔͷͰɺ؆୯ʹӽڥͰ͖Δ ΞϓϦέʔγϣϯ ϛυϧ΢ΣΞ OS ϓϥοτϑΥʔϜ Dev Ops DBʹਫ਼௨͍ͯ͠ΔOpsΤϯδχΞ͕SQL

    ͷϨϏϡʔΛͨ͠Γ DevΤϯδχΞ͕ϛυϧ΢ΣΞΛࢼͨ͢ ΊͷChefϨγϐΛॻ͍ͨΓ ϛυϧ΢ΣΞͷΦϓγϣϯߏ੒Λཧղ ͠ͳ͕ΒίʔυΛॻ͍ͨΓ ↓ϙΠϯτ
  62. ։ൃͱӡ༻ͷ੹೚ൣғ • άϨΠκʔϯΛ࡞Β͓ͣޓ͍ଚॏ͠ͳ͕Βॿ͚߹͍͑ͯΔ ΞϓϦέʔγϣϯ ϛυϧ΢ΣΞ OS ϓϥοτϑΥʔϜ Dev Ops

  63. Performance Working Group (͓·͚) • αʔϏε΁ίϛοτͯ͠Δશϝϯόʔ͕ఆظʢεϓϦϯτຖʣʹੑೳ෼ੳΛ࣮ࢪ ʢMackerelΛ׆༻ʣ • த௕ظͷϦϦʔεӨڹͳͲ෼ੳ͠ɺ։ൃ΍ΠϯϑϥͷΩϟύγςΟܭը΁ଈ࣌൓ө ΞϓϦέʔγϣϯ

    ϛυϧ΢ΣΞ OS ϓϥοτϑΥʔϜ Dev Ops
  64. • ઌਐతͳΞʔΩςΫνϟ΁ͷ਌࿨ੑ޲্ ίϯςφ΍ϑΝϯΫγϣϯΛ༻͍ͨαʔόϨεΞʔΩς ΫνϟͳͲ • ෼ྨʗू໿ αϙʔτ֓೦ͷ֦ॆ Service Role Host

    Host Container Container Container Function Function Role Role Host Host Role Host Host Container Function
  65. 6 Product Roadmap

  66. Πϕϯτػೳͷ֦ॆ • ։ൃ΍ӡ༻ʹ͓͚Δ༷ʑͳࣄ৅ΛτϥοΩϯά • ΞϥʔτɺMackerelͷૢ࡞ɺDeployɺϗετ ૿ݮ ͳͲ • ΠϕϯτۦಈͰ֤छػೳ͕࿈ಈ •

    ௨஌ɺΞϊςʔγϣϯɺΞΫγϣϯ
  67. ϝλσʔλϓϥάΠϯ • ೚ҙͷKey−ValueΛJSONσʔλͱͯ͠Mackerel΁ετΞ • ৗʹ࠷৽ͷ৘ใΛݕࡧͯ͠࠶ར༻͢Δ͜ͱ͕Մೳ • ϓϥάΠϯूΛOSSఏڙ • Πϯετʔϧύοέʔδ •

    ੬ऑੑεΩϟφʢVulsʣ Vuls: VULnerability Scanner https://github.com/future-architect/vuls/blob/master/README.ja.md
  68. ϝτϦοΫσʔλ • σʔλཻ౓޲্ • อ࣋ظ֦ؒு

  69. ҟৗݕ஌ • ͍ͭ΋ͱҧ͏σʔλύλʔϯΛࣝผ • ػցֶशͷΞϧΰϦζϜΛ׆༻ Anatomy of an anomaly detection

    model https://techblog.expedia.com/2016/07/28/applying-data-science-to-monitoring/
  70. ίϯϙʔωϯτؒͷؔ܎Λදݱ LB DB Proxy Proxy Proxy App App App App

    App • ෳࡶͳߏ੒΋෼͔Γ΍͘͢؅ཧՄೳ • ߏ੒೺Ѳͷ༰қԽ • Өڹൣғ΍ݪҼͷಛఆ
  71. 7 ύʔτφʔ༷޲͚ϓϥϯ

  72. MSP/Ϋϥ΢υࣄۀऀ޲͚ػೳ • APIͰMackerelͷΦʔΨχθʔγϣϯ࡞੒ͳͲ ސ٬" ސ٬# ސ٬$ ސ٬% ސ٬& ސ٬' 03("

    03(# 03($ 03(% 03(& 03('
  73. Standardϓϥϯͷ࠶ൢϞσϧ

  74. 8 MackerelͷϏδϣϯ

  75. ࣌୅͸Ϋϥ΢υԽͷྲྀΕ • ։ൃπʔϧ͸Ϋϥ΢υ΁ • TWOHJU ˠ (JU)VC (JU)VC&OUFSQSJTF • +FOLJOTˠ

    5SBWJT$* $JSDMF$* • ࣮ߦ؀ڥ΋Ϋϥ΢υ΁ • ΦϯϓϨ ˠ "84 ($1 "[VSF #MVFNJY
  76. Mackerel΁ͷྲྀΕ • ӡ༻πʔϧ΋Ϋϥ΢υ΁ • ;BCCJY /BHJPT 4FOTV 1SPNFUIFVT ˠ .BDLFSFM

     • ܧଓతͳػೳ֦ॆɺݎ࿚ͳϓϥοτϑΥʔϜӡӦ͸ɺ ͓೚ͤ௖͖ɺΑΓຊ࣭తͳϏδωε΁஫ྗ͍͚ͨͩ ·͢
  77. Infrastructure as Code • ϗετઃఆ͕ίʔυԽ͞Εͨʢ$IFGQVQQFUʣ • .BDLFSFMͷઃఆ΋ίʔυͰ؅ཧ • ؂ࢹϧʔϧμογϡϘʔυͷίʔυԽ •

    ॱ࣍ɺ"1*ԽΛਪਐ
  78. Mackerelͷະདྷ • "MMJO0OFαʔϏεͰ͸ͳ͍ • ༷ʑͳπʔϧαʔϏεͱͷ࿈ܞ • 4MBDL (JU)VC 5XJMJP •

    γεςϜ؅ཧͷίΞπʔϧͱͯ͠ͷ.BDLFSFM
  79. MackerelͷϏδϣϯ ΤϯδχΞΛϫΫϫΫͤ͞Δ ʮ௚ײతαʔόʔ؂ࢹαʔϏεʯ

  80. None
  81. mackerel.io