ã¤ãã³ããã¼ã¸: Norikra meetup #2 : ATND
åèªèº«ã¯Norikra使ã£ããã¨ãªãã®ã§ãããå¨å²ã«ã¯ä½¿ã£ã¦ãã人ããã¦è©å¤ãè¯ãã®ã§ãä»ã®äººã®ã¦ã¼ã¹ã±ã¼ã¹ãèãã¦ã¿ãããããããã°èªåã¨ãã®æ¥åã«ãããè¾¼ã¿ãããã¨æãåå ãã¦ãã¾ãããæå¾ éããã¦ã¼ã¹ã±ã¼ã¹ãè²ã èãã¦é¢ç½ãã£ãã§ãã
ä»åèããNorikraã®ã¦ã¼ã¹ã±ã¼ã¹ã«ã¯ã大ä½ä»¥ä¸ã®ãããªå ±éç¹ãããããã«æãã¾ããã
- ã¹ãã¼ã¿ã¹ã³ã¼ããã¨ã®ä»¶æ°ãéè¨ããããã«ä½¿ã£ã¦ããã¨ãããå¤ã
- Norikraã§ã®éè¨çµæã¯ãFluentdãä»ãã¦ãä»ã®ãã¼ã«ï¼MackerelããZabbixããï¼ã«æ¸¡ã
- Norikraãè½ã¡ããè½ã¡ãã§è«¦ããã¨ããå²ãåãã§ä½¿ãï¼åé·åã¯cold standbyç¨åº¦ï¼
- åããã¼ã¿ããã¼ã¿ãã¼ã¹ã«ãæµãè¾¼ã¿ãNorikraã¯ããã¾ã§éå ±å¤ãã¢ã©ã¼ãç¨ã«ä½¿ã
- ã¡ã¢ãªã大éã«ç©ãã ãã·ã³ãç¨æããã°ãªãã¨ããªã
- Gunosyã®äºä¾ã®ããã«ãåæ£åã®ã·ã¹ãã æ§æãåãã
å人çã«ã¯@fujiwaraããã®ãNorikraã§SPAMæ¤åºãã話ãç¹ã«é¢ç½ãã£ãã§ããWebã¢ããªã±ã¼ã·ã§ã³å ¨è¬ã§ãããããã¼ãºã¯ãããããªã®ã§ãfluent-plugin-spam-reactorå ¬éãã¦ããããå¬ãããªãâ¦â¦ã
@tagomoris ããã®æ¨æ¶
- åå è
ã¸ã®ã¢ã³ã±ã¼ãã®éè¨çµæ
- Norikraãç¥ã£ã¦ãã¾ããï¼ â 107 /119
- 使ã£ããã¨ãããã¾ããï¼ â 34 / 119
ã¡ã«ã«ãªã§ã®Norikraã®æ´»ç¨ãMackerelãæ·»ã㦠(@kazeburo)
ã¡ã«ã«ãª1500ä¸DLãæ¥æé·ãæ¯ããéç¨
- ã¡ã«ã«ãªã§éç¨ç³»ã¨ã³ã¸ãã¢ã¨ãã¦åãã¦ãã
- PDCAãããã«æ©ããã¹ã ã¼ãºã«åãããéè¦
- Zabbixãè²ã ã§ãããè¾ã
DevOps
- éçºè ã¯ç´æ¥SSHæ¥ç¶ã§ããªãããã«ãªã£ã¦ãã
- éçºè ã¯ãéå»ã®ãã¼ã¿ãè¦ããå ´åã¯treasure data, bigquery, kibanaãè¦ã
- graphã¨alertãå ±æãDevãç£è¦æ¡ä»¶ãæå®ããã
Norikra+Mackerel
- Mackerel: æ§ã
ãªæç³»åãã¼ã¿ãå¯è¦åã»ç£è¦ã§ãã
- Mackerelã®ã¡ã¤ã³ã¯Agentãå ¥ãã¦Host Metricsãåãï¼ãã¡ã¯ä½¿ã£ã¦ãªãï¼
- clientããservice metricsãéããã¨ãã§ãã
- Norikra+Mackerelã§1ã¶æããã使ã£ãææ³ã¨ãã¦ããããå¤è¨å®ã楽
- ã¢ã©ã¼ããSlackã«éç¥ï¼ã°ã©ãã表示ã§ããï¼
- access_logã¨error_logãããµã³ããªã³ã°ããã«å
¨ä»¶å¯¾è±¡
- ç´°ããã¨ã©ã¼ãåããªããªãã®ãé¿ãããã
- Mackerel: æ§ã
ãªæç³»åãã¼ã¿ãå¯è¦åã»ç£è¦ã§ãã
Norikraã®éç¨
è¨å®ã¨ã¯ã¨ãª
- fluentdã®è¨å®ã§ãNorikraã®groupãæå®
- HTTPã¹ãã¼ã¿ã¹ã³ã¼ãï¼2xxã¨ãï¼ãã¨ã®ä»¶æ°ãéè¨ãã¦ã°ã©ãå
- Mackerelã®è¯ãæã¯ãç©ã¿ä¸ãã°ã©ãã®ãªããããç¹å®ã®ç¨®é¡ã®ã°ã©ãã ã表示ã§ããï¼ä»¶æ°ãå°ãªã5xxã ãã°ã©ã表示ããªã©ï¼
- ç¹å®UAããã®ã¢ã¯ã»ã¹ãcountããç¹å®ã®UAããã®ã¢ã¯ã»ã¹ããªãå ´åã«ã¢ã©ã¼ãçºå ±ãã¦ãã
- 90,95,98,99ãã¼ã»ã³ã¿ã¤ã«ã®å¹³åå¤ãã°ã©ãå
- flatten_hashã«éãã¦ããã§ãªãã¨ãmackerelãåãåããªã
- å¹³åå¤ã¯ãæ©ãã¬ã¹ãã³ã¹ã«å¼ãããããããã®ãããä¸å¤®å¤ããã¼ã»ã³ã¿ã¤ã«ã§ç£è¦ããã»ããæå³ããã
Q&A
- [Q] Kibanaã¨æ¯ã¹ã¦è¯ãæ/æªãã¨ãã
- [A] Kibanaãã°ã©ããå¤äººæ°ã§è¦ãã¨éãããMackerelã¯éç´å¾ã®ãã¼ã¿ãªã®ã§ãã°ã©ãã軽ããã¨ã©ã¼ãã°ã®è©³ç´°ã¯Kibanaã§è¦ãã
- [Q] Norikraã®ç°å¢ããªãã·ã§ã³
- ã¡ã¢ãª64GBã®ãã·ã³
- [Q] ã¯ã¨ãªã®ã¿ã¤ã ã¦ã£ã³ãã¦ã¯ã©ããããï¼
- [A] åºæ¬1åããã¼ã¿ã¨ãã¦ããå°ãé·ãè¦ããã®ããã£ã¦ããã°ã¤ã³ã®ã¨ã©ã¼åæ°ãããã¯ããå°ãé·ãã¦5åã¨ãã
- [Q] Norikraã®åé·åã¯ï¼
- [A] ãã£ã¦ãªã
- [Q] Kibanaã¨æ¯ã¹ã¦è¯ãæ/æªãã¨ãã
ãã°è§£æã«Norikraãå°å ¥ãã (@harukasan)
èªå·±ç´¹ä»
- pixivã®ã¤ã³ãã©ã¨ã³ã¸ãã¢ï¼ç»åã®é ä¿¡ãåçå¤æãªã©ï¼
- Norikraããªã¢ã«ã¿ã¤ã ãã°è§£æã«ä½¿ã
- ç´1å¹´åã«Qiitaã®è¨äºãæ¸ããã0.1ãåºã¦ãããæ¸ãããæ°ããæ¹ãèªãã§æ¬²ãã
Log ecosystem with Fluentd
- Fluentdã§éç´âlog storageâvisualization/analytics(GrowthForecast, HRForecast, Spreadsheet, Tableau)
- Pixivã§ã®æ§æã¯ãGoogle BigQueryã®ãããçµæãHRForecastã«æ¸ãè¾¼ã¿ãJenkinsã§ãããå®è¡
- ãã°ã®è»¢éã¯Fluentdã®ãããã§ç¶ºéºã«ãªã£ã
- ã§ãããã¼ã¿ãã¼ã¹ã¯1åã«éç´ã§ãããè¤æ°ä½¿ãåããå¿ è¦ãããã®ãç¾ç¶
å¦çè²ã
- ãããå¦ç
- ã¢ãããã¯è§£æ
- Kibanaãæµè¡ã£ã¦ãã¿ããªããå§ãã
- Offline Analysis
- æ¥æ¬ã«ã¯Excel使ããå¤ã
- ãããå¦çã¯æã éããã
- 5åæ¯ã®å¾åãç¥ãããã¨ãã1æ¥ã®å¾åãç¥ãããã¨ãããããã«æéãæããã®ã§é »ç¹ã«ã¯ã¨ãªãæããããªã
Norikra
- ã¹ãã¼ãã¬ã¹ãSQL-likeãªã¯ã¨ãªãæ¸ããã®ãè¯ã
- status codeãã¨ã®ã«ã¦ã³ã
- ãã°ãã«ã¦ã³ããã¦100ä»¶è¶ ãããåºåãã¨ã
- NorikraããBigQueryã¨ãã«æ¸¡ãã¨ãããã©ããããï¼ â ããä¸åº¦Fluentdã«æ¸¡ã â Fluentdã«æ¯ãåããä»»ãã
- Query Groupãããã¼ã¿ãæµãå ãã¨ã«ä½ããgfã¨ãIdobataã¨ã
Norikraã®éç¨
- Norikraã®ã¨ãããSPOF
- Norikraã®ãã·ã³ã¯8GB以ä¸ã®ã¡ã¢ãªãå¿ è¦ã¨ãããã¡ã¢ãªã大éã«è¼ããã»ããè¯ã
- CPUã¯ãã»ã©ãããªã
- Supervisordã§ãã¼ã¢ã³å
Norikraå°å ¥å
- Fluentdã®ãä¼¼ãååã®ããããããã©ã°ã¤ã³2ã¤ï¼fluent-plugin-numeric-monitor, fluent-plugin-numeric-counterï¼ã使ã£ã¦ãã
- ã³ã³ãã£ã°ã«é å¼µã£ã¦æ£è¦è¡¨ç¾ãæ¸ããã¨ãããã¨ããã£ã¦ããããfluentdã®åèµ·åãå¿ è¦ã ã£ãããè¨å®ãã¡ã¤ã«ãé ã£ãããé¢å
- Norikraã§ããã¨æ¥½
Norikraã®ç£è¦
- engine statisticsãMuninã§åºãã¦ãã
- Norikraã¯å®å®ãã¦ããã®ã§ãç£è¦ã«ã¯ãã¾ãæãåã£ã¦ããªã
Q&A
- [Q] ã¯ã¨ãªæ°ã¯ï¼
- [A] 5ã6åããã£ã«ã¿ãã¦ç§é1000åãããã®ã¤ãã³ãã«é©ç¨ï¼@kazeburoãããããèªåã®ã¨ããã¯11åããã¨ã³ã¡ã³ãï¼
- [Q] ã¿ã¤ã ã¦ã£ã³ãã¦ã¯ï¼
- [A] 大ããããã¨ã¡ã¢ãªãé£ãã®ã§ããã¹ã¦1åã«ãã¦ãã
- [Q] ã¯ã¨ãªæ°ã¯ï¼
Norikraã§Webãµã¼ãã¹ãå®ã (@fujiwara)
èªå·±ç´¹ä»
- KAYAC
- ã³ãã¥ããã£ç³»ã®ãµã¼ãã¹ã«Norikraãå ¥ãã¦ãã
Norikraã®ä½¿ãæ¹
- ã¬ã¹ãã³ã¹ã³ã¼ãå¥ã®ä»¶æ°ãã°ã©ãå
- 10msec以ä¸ã100msec以ä¸ããã¨ã®ä»¶æ°ãã°ã©ãå
- worker logsã®éè¨
- å ã ã¯fluentdã®ãã©ã°ã¤ã³ã§å ¨ãåãã°ã©ããæ¸ãã¦ãããè£å´ã ããåãæ¿ãã¦ãè¦ãç®ã¯å ¨ãå¤ãã£ã¦ããªã
- ãã¼ã¯æã§10,000 msg/sec
- ãã°éè¨ã®ããã«ãã°ãRedshiftã«å ¥ãã¦ãããã¨ã¯å¥ã«NorikraâZabbixã§ã°ã©ãæç»
- r3.xlarge (4core 30GB mem)ã使ãã75%ãããã®ã¡ã¢ãªãNorikraã«å²ãå½ã¦ã¦ãã
èæ¯
- ã³ãã¥ããã£ç³»ã®Webãµã¼ãã¹ã ã¨ã¹ããã¼ãæ¥ã
- æåã¯ã¹ããã¢ããªonlyã ã£ãã®ã§ãã¾ãæ¥ãªãã£ã
- Webãã¼ã¸ã§ã³ããªãªã¼ã¹ãããã¹ããã¼ãæ¥ãããã«ãªã£ã
éè¨æ¹æ³
- ç¹å®ã®URLã«å¯¾ãã¦POSTããã件æ°ãhostãã¨ã«ã«ã¦ã³ã
- twitterçµç±ã§ãã°ã¤ã³ããã件æ°ãhostãã¨ã«ã«ã¦ã³ã
- ãã¼ã¹ãè½ã¨ãã¦ãã°ã¤ã³è©¦è¡ãã奴ãããã®ã§ã1åãã¨ã10åæ¯ã1æéæ¯ãã§å¥ã®ãããå¤ãããã¦ãã
fluent-plugin-spam-reactor
- å é¨ã§ä½¿ã£ã¦ããã ããªã®ã§æªå ¬é
- åç´ã«Norikraã«å ¥ãããã¨ããã¨è©°ã¾ããã¨ããããaggregatorã§è©°ã¾ãã¨ã
- è©°ã¾ã£ã¦ãããã«ã³ã¨æµãã¦ããæã«èª¤æ¤ç¥ããªãããã«ãã¦ãã
- ãã°ã®æåã®æå»ã¨æå¾ã®æå»ãå·®ãã¨ã£ã¦ããã®æéå ã®1åãããã®ä»¶æ°ãåºããã¨ã§ã誤æ¤ç¥ãé²ã
- spam-reactorã¯ãä½åº¦ãã²ã£ããã£ãhostã¯ãbanããæéãexponentialã«é·ããã¦ãã
- 1æébanãã¦ã1åè¨æ¸¬ãã¦åæ¤ç¥ãã¦banãã¨ãã£ã¦ããã¨ãåæ¤ç¥ä¸ã®1åéã¯æ»æã§ãã¦ãã¾ã
- hostã®æ å ±ã¯memcachedã«è¨é²
Gunosyã®Norikraãç¨ããã¢ããããã¯ã¼ã¯ã®ãªã¢ã«ã¿ã¤ã éè¨ (@shunsukeaihara)
èªå·±ç´¹ä»
- Gunosyããã¥ã¼ã¹ã ããããªãã¦ã¢ãäºæ¥ããã£ã¦ãã
- åºåé ä¿¡é¢é£ã®éçºããã¼ã¸ã£
ã¦ã¼ã¹ã±ã¼ã¹
- CTRãæ¶åé¡ãCPAã®åãªã¢ã«ã¿ã¤ã ãã£ã¼ãããã¯
- åãªã¢ã«ã¿ã¤ã ã®å¯è¦åã»åæã®ãã¼ãºï¼Kibanaã¨ãï¼
ç°å¢
- ã¢ããããã¯ã¼ã¯ç¨ã¢ããµã¼ããgolangã§ãªãã¬ã¼ã¹
- c4.large 1å°ãããã1,000 req/sec
- Norikraã«ã¯ãã°ã®ä¸é¨ãæãã¦ãã
- Redshiftã®éç¨ã¯å²ã¨è¾ãã®ã§ãå®æããããããã«ããã
- ãã°éå¤ãã¦Kibana4ã«ç´æ¥çªã£è¾¼ãã¨æ»ã¬âNorikraã§ãã°ããã
å¤æ®µNorikra
- 2ã3å°ã®APIãµã¼ãã«å¯¾ãã¦ã1å°ã®fluentd+Norikraãµã¼ã
- ã§ãããµã¼ãã1å°è¨ç½®ã§è¯ãï¼ â ã¢ããã¯ã§ã¯ãã«ã¸ã¥ã¢ã«ã«æ¥ã«ãµã¼ããå¢ããããããæ¥æ¿ã«ãã©ãã£ãã¯ãè·³ãä¸ãã
- æ¡å¼µæ§ãæ®ãã¦ããããã£ã
- æçµæ®µã®Norikraã§ãµãã£ãå¤ã1åãã¨ã«Kibana4ã¸æå ¥
- éã¨ã³ã¸ãã¢ã§ãæä½éå¿ è¦ãªæ å ±ãããªã«ãã¦ã³ã§ãã
- OpsWorksã§Norikraã®ãµã¼ãæ§ç¯ã§ãããè¨å®ã¯ãã¹ã¦custom jsonã«ãããã ã
Norikraèªä½ã®ç£è¦
- Datadogã§ç£è¦
- Papertrailã§ãFluentdã¨Norikraã®ãã°ãç£è¦
- Datadogã¯iframeãåãè¾¼ããã®ã§ãKibanaã®ç»é¢ãåãè¾¼ãã¦ä¾¿å©
éå ±å¤ã¯Norikraã§éè¨ãæ£ç¢ºãªå¤ã¯Redshiftã§ãããã§éè¨
- Opsworksã§ãä¸äººã§ãã¢ããµã¼ãã®ç£è¦ã»éç¨ã¯ã§ãã¦ã
Norikra Recent updates & Ask me anything (@tagomoris)
suspended queries
- ä¸æçã«æ¢ãããã¨ãã«ä½¿ãæ©è½
- åèµ·åãããæ¶ãã¦ãã¾ãã¯ã¨ãªãªã®ã§æ³¨æ
NULLABLE fields
- ä¸é¨ã®ãã·ã³ã®ã¿ã«ã©ã ãå¢ãããï¼ãã¼ã¸ã§ã³æ··å¨ï¼ãã¨ãã£ãå ´åã«ä½¿ãã
- ãã®ã«ã©ã ãNULLã§ããéè¨å¯¾è±¡ã«ãããã¨ããããã®æå®ï¼ããã©ã«ãã ã¨ã¯ã¨ãªã«å ¥ã£ã¦ããã«ã©ã ããªãã¨ããã®ãã¼ã¿ã¯ç¡è¦ãããï¼
Listener
- memory poolã«ããããã®ããclientãfetchãã¦ä½¿ã
- fluent-plugin-norikraã¯ãããèªåã§è¡ãã®ã§ãæèãã¦ãªã人ãå¤ããã
- èªåã§è¡ããã¦ããããããã§ãfetchããã¶ãã ãæ§è½ã«å¹ãã¦ãã
- STDOUT() â Norikraã®ãã°ã«åºã¦ãããã¯ã¨ãªã試ãããã¨ãã«ä¾¿å©
- fluentdã«æ¸¡ãlistenerã®ä¾
- èªç¤¾ã®ã·ã¹ãã ã«æ¸¡ããããããªå ´åããlistenerãæ¸ãã°è¯ã
- memory poolã«ããããã®ããclientãfetchãã¦ä½¿ã
Dynamic plugin reloading
- 1.3ããSIGHUPãåãåãã¨ãgemã§ã¤ã³ã¹ãã¼ã«ãããã©ã°ã¤ã³ããªãã¼ããã¦ããã
Q&A
- [Q] ã¯ã¨ãªå¯¾è±¡ã®æååã« " ã ' ãå
¥ã£ã¦ããã¨LIKEæ¤ç´¢ã«å¤±æãã
- [A] Esperã®æ¤ç´¢ã¯ãJavaã®æååã¨ãã¦è§£éãããããããï¼ãIssueã«ç»é²ãã¦æ¬²ãã
- [Q] Dynamic plugin reloadingã¯Fluentdã«å
¥ããªãï¼
- [A] Fluentdã®è¨å®ãã¡ã¤ã«ãå®å ¨ã«ãã¼ãããã®ã¯é£ããããmatchç¯ã®å¢æ¸ãªã©ããããããç¯å²ãéå®ããã°ã§ãããã
- [Q] ã¯ã¨ãªå¯¾è±¡ã®æååã« " ã ' ãå
¥ã£ã¦ããã¨LIKEæ¤ç´¢ã«å¤±æãã