Upgrade to Pro — share decks privately, control downloads, hide ads and more …

クックパッドのログをいい感じにしているアーキテクチャ / Logging architectu...

クックパッドのログをいい感じにしているアーキテクチャ / Logging architecture at Cookpad

Hokuto Hoshi

July 26, 2017
Tweet

More Decks by Hokuto Hoshi

Other Decks in Technology

Transcript

  1. ੕ ๺ే (΄͠ ΄͘ͱ) / @kani_b • ΫοΫύουגࣜձࣾ
 ΠϯϑϥετϥΫνϟʔ෦௕ •

    SRE • AWS ͱηΩϡϦςΟ͕ϝΠϯྖҬ • ࣾ಺֎ͷ৘ใηΩϡϦςΟશൠ΋୲౰
  2. ऩू͍ͯ͠Δϩά • PV ϩά • ϖʔδӾཡ͝ͱʹه࿥͞ΕΔ • Ӿཡ਺ɺݕࡧಈ޲ͷ෼ੳͳͲ • ޿ࠂܥϩά

    • ΠϯϓϨογϣϯɺΫϦοΫɺ
 ίϯόʔδϣϯ • ഑৴੍ޚ΍ޮՌଌఆʹ • ΞΫςΟϏςΟϩά • Ϣʔβߦಈ (ը໘ભҠͳͲ) • ෼ੳɺࢪࡦݕূɺ
 ϞόΠϧΞϓϦͷಈ࡞ϩά • ؂ࠪϩά • Ϣʔβσʔλͷ࡞੒ɾߋ৽ɾ
 ࡟আɺϩάΠϯϩάͳͲ • αϙʔτɺηΩϡϦςΟ؂ࠪ
  3. ऩू͍ͯ͠Δϩά • KPI ༻ϩά • “ग़དྷࣄ” Λه࿥͢Δϩά • UU, DU

    ͳͲ΋ࣗಈܭࢉɺ
 KPI ؅ཧ༻ • γεςϜϩά • OSɺϛυϧ΢ΣΞͷϩά • γεςϜ؅ཧ༻ • etc…
  4. ݱࡏͷن໛ • Fluentd ʹྲྀΕ͍ͯΔϩά (֓ࢉ) • σʔλ૯ྔ: 400~600GB / ೔

    • Ϩίʔυ਺: 8ԯϨίʔυҎ্ / ೔ • ඵؒ8,000 ~ 25,000 Ϩίʔυ͘Β͍ ※ࡢ೥ͷൃද͔࣌ΒϨίʔυͷ࡟ݮΛ͍ͯ͠·͢
  5. ,JOFTJT 4USFBNT 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI
 4FSWFS 3FETIJGU $MVTUFS

    "UIFOB &MBTUJDTFBSDI ߏ੒ "QQ4FSWFST "QQ4FSWFST "QQ4FSWFST -PH
 "HHSFHBUPS
  6. -PH
 "HHSFHBUPS ,JOFTJT 4USFBNT "QQ4FSWFST 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI


    4FSWFS 3FETIJGU $MVTUFS "QQ4FSWFST "QQ4FSWFST "UIFOB &MBTUJDTFBSDI ߏ੒
  7. ,JOFTJT 4USFBNT 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI
 4FSWFS 3FETIJGU $MVTUFS

    "UIFOB &MBTUJDTFBSDI ߏ੒ "QQ4FSWFST "QQ4FSWFST "QQ4FSWFST -PH
 "HHSFHBUPS
  8. Redshift • ࣾ಺ͷσʔλ෼ੳͷத৺ (DWH) • ϩά͚ͩͰͳࣾ͘಺ͷશ DB ͷσʔλΛ
 औΓࠐΜͰ͓Γ౷߹෼ੳ͕Մೳ •

    શࣾһ͕ར༻͢Δ (Tableau ΍ Redash) • S3 ͷϩάσʔλΛόονδϣϒͰऔΓࠐΈ • ϩʔυִؒ͸௕Ί
  9. ,JOFTJT 4USFBNT 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI
 4FSWFS 3FETIJGU $MVTUFS

    "UIFOB &MBTUJDTFBSDI ߏ੒ "QQ4FSWFST "QQ4FSWFST "QQ4FSWFST -PH
 "HHSFHBUPS
  10. Lambda + DynamoDB • ετϦʔϜूܭʹར༻ (ओʹ޿ࠂ) • Redshift ΁ͷΠϯϙʔτִؒΛ௒͑Δ༻్ •

    Kinesis Streams Ͱड͚ Lambda Ͱू໿ɺ DynamoDB ʹॻ͘ • ྲྀྔ͕େ͖͍ͨΊू໿ϊʔυΛ࢖Θͳ͍ • ϩάͦͷ΋ͷ͸ S3 ʹ΋ॏෳૹ৴ • ௕ظతͳ෼ੳ͸ Redshift Ͱߦ͏
  11. ,JOFTJT 4USFBNT 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI
 4FSWFS 3FETIJGU $MVTUFS

    "UIFOB &MBTUJDTFBSDI ߏ੒ "QQ4FSWFST "QQ4FSWFST "QQ4FSWFST -PH
 "HHSFHBUPS
  12. ,JOFTJT 4USFBNT 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI
 4FSWFS 3FETIJGU $MVTUFS

    "UIFOB &MBTUJDTFBSDI ߏ੒ "QQ4FSWFST "QQ4FSWFST "QQ4FSWFST -PH
 "HHSFHBUPS
  13. -PH
 "HHSFHBUPS ,JOFTJT 4USFBNT "QQ4FSWFST 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI


    4FSWFS 3FETIJGU $MVTUFS "QQ4FSWFST "QQ4FSWFST "UIFOB &MBTUJDTFBSDI ߏ੒
  14. ,JOFTJT 4USFBNT 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI
 4FSWFS 3FETIJGU $MVTUFS

    "UIFOB &MBTUJDTFBSDI ߏ੒ "QQ4FSWFST "QQ4FSWFST "QQ4FSWFST -PH
 "HHSFHBUPS
  15. ,JOFTJT 4USFBNT 4 -BNCEB GVODUJPO %ZOBNP%# #BUDI
 4FSWFS 3FETIJGU $MVTUFS

    "UIFOB &MBTUJDTFBSDI ߏ੒ "QQ4FSWFST "QQ4FSWFST "QQ4FSWFST -PH
 "HHSFHBUPS Ͱ͖Δ͚ͩ୹͍஗ԆͰ ΞϓϦ͔Βͷར༻ϝΠϯ ͋Δఔ౓ͷ஗Ԇ͸ڐ༰Ͱ͖Δ ΞϓϦ͔Β΋ਓؒ΋ར༻ αʔϏεӡ༻্ ΫϦςΟΧϧͰͳ͍ϩάʹར༻
  16. ΞϓϦέʔγϣϯͷಈ࡞ϩά • td-agent Ͱऩू • CloudWatch Logs ʹૹ৴ • fluent-plugin-cloudwatch-logs

    • Docker Խ͞Ε͍ͯΔΞϓϦ͸ඪ४૷උ • Τϥʔϩά͸ Sentry ʹૹ৴
  17. γεςϜϩά • ݱࡏ͸2ͭΛฒߦՔಈ • rsyslog • ;ͭ͏ͷϩάαʔό • td-agent Ͱऩूͯ͠

    Kinesis Streams -> Lambda Ͱ Graylog ΁ • 2.3 ͔Β Elasticsearch Service ͕࢖͑ΔΑ͏ʹ