ã¿ããªå¤§å¥½ãfluentdã¯ããã¸ã便å©ã§ããããã°ã®åéï¼éç´ã ããããããã¨ããã¨ãã«ã¡ãã£ã¨ãªã¼ãã¼ã¹ããã¯æ°å³ã®ã¨ãããããã¾ããç¹ã« in_tail ã¯ãã°ã®èªã¿è¾¼ã¿ã¨åæã« parse ãããä»çµã¿ã«ãªã£ã¦ãããã¾ããã°ãæ¸ãããå ´æãªãparseã®ã«ã¼ã«ãããã£ã¦ãã§ãããã¨ããã¨ããã¯åççãªãã®ã§ãããã®ã§ãããloadavgãé«ããµã¼ãã§ãããããã¨ãããã®ã¯æ£ç´ã«ãã£ã¦ãªããªãå³ããã§ãã
ããããããã§ä»¥åã« scribeline ã¨ããã¨ã¼ã¸ã§ã³ããã¼ã«ãä½ã£ãã®ã§ããã fluentd 以éå¾ã使ãç¶ãã¦ããã®ã§ããããã°ããã£ããéç´ããã¨ããã® fluentd ãCPU使ç¨ççã«ãã£ã±ããã£ã±ãã«ãªã£ã¦å³ãããã®ãããã¾ããããscribe(Thrift)ãããªãã¦MessagePackã«ããã°åããããã°ããããã¨ãããã¨ãæéçºè ãè¨ã£ã¦ãããããªæ°ãããã®ã§ãfluentd ãã¤ãã£ããªãããã³ã«ã§éã£ã¦ããããã
ã¨ãããã¨ã§ãä½ãã¾ããã
tagomoris/fluent-agent-lite · GitHub
perl 5.8 ãããã°åã(ãã¨ã®ã¢ã¸ã¥ã¼ã«ã¯ã¤ã³ã¹ãã¼ã«æã«èªåã§å ¥ãã)ã®ã§ãããã¦ãã®ç°å¢ã§ç°¡åã«å°å ¥ã§ããã¨æãã¾ãã
æ©è½
æå®ããããã°ãã¡ã¤ã«ããè¡åä½ã§èªã¿è¾¼ã¿ãåè¡ã®ãã°ã¡ãã»ã¼ã¸ãç¹å®ã®ãã£ã¼ã«ã*1ã«è©°ããæå®ããã fluentd ã«å¯¾ãã¦éãã¾ãããã°è¡æ«å°¾ã®æ¹è¡ã¯åãé¤ããã¦ãã¾ãããã°ã¡ãã»ã¼ã¸ã«ã¯æå®ããã¿ã°ãä»ä¸ããã¾ã*2ã
è¤æ°ã®ãã°ãã¡ã¤ã«ãæå®ããå ´åããã®æ°ã ãããã»ã¹ãèµ·åããã®ã§ã注æãã ããã
éãå
ãµã¼ã㯠primary 㨠secondary ãããããæå®ã§ãããããprimaryããã¦ã³ãã¦ããã¨ãã«ã¯secondaryã«èªåçã«ãã§ã¤ã«ãªã¼ããã¾ããã¾ã30åæ¯ã«åæ¥ç¶ãè¡ããããé害å¾ã«primaryã復æ§ããã°ããã®ãã¡(30ååå¾ã§)primaryã«ãã¤ã¯ããã¯ãã¾ãã
ã¾ã primary 㨠secondary ã¯ãããããªã¹ããæ¸ãããã¡ã¤ã«ãæå®ã§ããããã«ãªã£ã¦ãã¾ãããªã¹ããæå®ãããå ´åããã®ä¸ããã©ã³ãã ã«ã²ã¨ã¤ãé¸ãã§æ¥ç¶ãã¾ããããã«ããç°¡åãªè² è·åæ£ãè¡ãã¾ãã
ãã®ä»ãç¹ã«è² è·ã®é«ããµã¼ãã§èµ°ãããå ´åã«ç¹åããæé©åè¨å®ç¨ã®é ç®ãããã¤ãããã¾ãã
å°å ¥æ¹æ³
tar.gz ããã¦ã³ãã¼ããããgithub repositoryãcloneã bin/install.sh ãå®è¡ããã¨ã»ããã¢ãããèµ°ãã¾ããããã§å®äºã®ã¯ãã
ã¾ã SPEC/fluent-agent-lite.spec ãç¨æãã¦ããã®ã§ãrpmããã±ã¼ã¸ã®ä½æãã§ããã¯ãã§ããããã©ã«ãã®éä¿¡å ãµã¼ããªã©ãã»ããããç¶æ ã®è¨å®ãã¡ã¤ã«ã¨ã»ããã«ãã¦ä½ãã®ãããã§ãããã
ã»ããã¢ãããå®äºããã init script ã使ãã¾ãã
/etc/init.d/fluent-agent-lite [start|stop|restart|reload|status]
å®ç¸¾
ã¾ã æå ã§å®æ¦æå ¥ãã¦ã¾ããããscribeline ã¨ããæ©è½çã«é ·ä¼¼ãããã¼ã«ã®çµé¨ãããã®ã§ãã¾ã大ä¸å¤«ãããªãããªã¼ã¨æãã¾ããæãµã¼ãã¹ã§è©¦é¨çã«åãããçµæã1æ¥å(2åã®logrotateãå«ã)ã®éã3å°ã®ãµã¼ãããç´1åè¡ã®ãã°ã転éãã¦åé¡ãªãåä½ãã¾ããã
ã¾ã¨ã
ä½è¨ãªãã¨ãããçãã°ããã®ã¾ã¾fluentdã«æµããããã¨ããè¦æ±ãã©ã®ãããããã®ãã¯ãããã¾ãããããã®ãããªç®çã«ç¹åãã¦ä½ã£ã¦ããã®ã§ãããã人ã«ã¯å¤§å¤æç¨ãªãã¼ã«ãããªãããªã¨æãã¾ãããã¾ãåéãã¦ä¿åã ããã¨ããå ´åã¯ä½¿ããã§ãããã
ãã®å¾ã«ããããããããªã£ãå ´åã¯èªåãã£ã¦ããããã« out_exec_filter 㧠parse ãããã¨ã«ãªãããããã¾ããã
使ãããã ã¨æããããããã©ãããå©ç¨ãã ããã