ã¤ãã¼æ ªå¼ä¼ç¤¾ã¯ã2023å¹´10æ1æ¥ã«LINEã¤ãã¼æ ªå¼ä¼ç¤¾ã«ãªãã¾ãããLINEã¤ãã¼æ ªå¼ä¼ç¤¾ã®æ°ããããã°ã¯ãã¡ãã§ããLINEã¤ãã¼ Tech Blog ããã«ã¡ã¯ãYahoo!ã·ã§ããã³ã°æ å½ã®åéã§ãã ä»åã¯ã¿ã¤ãã«ã®éããheadã³ãã³ãã¨tailã³ãã³ãã®ã½ã¼ã¹ã³ã¼ããèªãã§ããããã¨æãã¾ãã â ã¯ããã« çãããåãã®éããheadã³ãã³ãã¯ãã¡ã¤ã«ã®å é ããnè¡(ãã¤ã)ãåºåãã tailã³ãã³ãã¯ãã¡ã¤ã«ã®æ«å°¾ããnè¡(ãã¤ã)ãåºåããã³ãã³ãã§ãã ã»ãã«ããã¤ãã®å ¥åã«ä½¿ã£ããã[tail -f]ã§ãã°ãã¡ã¤ã«ã®åºåç£è¦ã«ä½¿ã£ããã¨ã UNIXã使ãä¸ã§ã¯æ¬ ãããªãã³ãã³ãã¨è¨ããã§ãããã headã¨tailã¯è¦ãç®ã®åä½ã¯ä¼¼ã¦ããããã§ãããã½ã¼ã¹ã³ã¼ãã®ä¸ã¯çµæ§éãã¾ãã ãã£ããè¦ã¦ããã¾ãããã ï¼headã®ã½ã¼ã¹ã³ã¼ãï¼ http://www.
ã¯ããã« td-agentã®in_tailãã©ã°ã¤ã³ã使ã㨠æå®ãããã¡ã¤ã«ãtail-fãã¦ãããã«èªã¿ããã§ãããã«ããã«ããã¦ãããããã§ãããsourceãã£ã¬ã¯ãã£ãã«æå®ããpos_fileã®æåã«ã¤ãã¦ç¢ºèªãã¦ã¿ã¾ãã in_tailãã©ã°ã¤ã³ã¨ã¯ tail ã¤ã³ããããã©ã°ã¤ã³ã¯ãFluentdãã¤ãã³ããã°ãããã¹ããã¡ã¤ã«ã®æ«å°¾ããèªã¿åããããã«ãã¾ãããã®èªã¿åãæ¹ã¯ tail -F ã³ãã³ãã«ããä¼¼ã¦ãã¾ãã å¼ç¨âhttp://documents.mazgi.com/fluentd/doc/plugin.html#tail å ¬å¼âhttp://docs.fluentd.org/ja/articles/in_tail è£è¶³ ãããªã«ãã¯ãã«ã«ã§ãæç¨ã§ããªãã«ã¢ã§ãããã¡ãã«ã¡ã¢ã¾ã¨ããã¡ã¢ã£ã¦ããã¾ãã âtd-agent(fluentd)ãæ¬çªãµâãã¹ã§å°ã
æ¬è¨äºã«ã¤ã㦠Fluentdã¯æ©è½ã¨ãã¦ã¯ã·ã³ãã«ã§ããã é«è² è·ç°å¢ã§å®å®çã«éç¨ããããã«ã¯ããç¨åº¦ã®ç¥èãæ±ãããã¾ãã ããã§ãæ¬è¨äºã§ã¯ãããªãã«ãã°æµéã®é«ãç°å¢ä¸ã§ç§ãèæ ®ãã観ç¹ãã¾ã¨ãã¾ããã æ¬è¨äºã§ã¯ãKubernetesã§Fluentdã®ä¿¡é ¼æ§ãæ ä¿ããããã®3ã¤ã®è¦³ç¹ã«å ãã ãé«è² è·æã®å®å®éç¨ãã«ç¦ç¹ãå½ã¦ã è² è·åæ£ é©åãªã¢ãã¿ãªã³ã° ãã©ãã«ã·ã¥ã¼ãã£ã³ã°ã¨ãã¥ã¼ãã³ã° ã®3ã¤ã®è¦³ç¹ã«ã¤ãã¦æ´çãã¦ãã¾ãã åæã¨ãªãã¢ã¼ããã¯ã㣠ã¢ã¼ããã¯ãã£ã¨ãã¦ã¯å®éã«ç§ãæ§ç¯ããå³ã®æ§æãåæã¨ãã¾ãã ã¢ã¼ããã¯ãã£ã®ç¹å¾´ 1ã¤ã®Kubernetesã¯ã©ã¹ã¿ã«ãFluentdãForwarderã¨Aggregatorã¨ãã2ã¤ã®ãã¼ã«ã§åå¨ãã¦ãã¾ãã Forwarder DaemonSetã§ãããã¤ããã åã³ã³ããã®åºåãã°ããã¤ããAggregato
ã¿ã¤ãã«éã Fluentd ã® Docker ã¤ã¡ã¼ã¸ãåãããéã®ã¡ã¢ã§ãã èæ¯ Fluentd ã使ã£ã¦åä½ç¢ºèªãè¡ãé㯠CentOS ãªã©ã® Linux ã« td-agent ãå ¥ãã¦ãã¾ããããã ãæ¯åç°å¢æ§ç¯ã®ãã³ã« td-agent ãã¤ã³ã¹ãã¼ã«ããã®ã...ã¨æããFluentd ã® Docker ã¤ã¡ã¼ã¸ãç¨æããã¦ããã®ã§åããã¦ã¿ã¾ããã fluent/fluentd-docker-image: Docker image for Fluentd ç°å¢æ å ±ã¯ä»¥ä¸ã®ã¨ããã§ã OS: OS X 10.11.6 (El Capitan) Docker: 1.11.2 Docker å®è¡ç°å¢: Boot2Docker æè¿ãDocker for Mac ããªãªã¼ã¹ãããããã§ãããããã§ã¯æãæã㦠Boot2Docker ä¸ã® Docker ã§åããã¦ã¿ã¾ãã Doc
Fluentdãåèµ·åããã¨ãããã¡ãã¡ã¤ã«ãçªç¶å ¨ã¦ãªããªã£ã¦å°ã£ãã®ã§ã©ããã¦ãããªã£ãã®ã調ã¹ã¦ã¿ãã Fluentdã®ãããã¡ãã¡ã¤ã« ãããã¡ãã¡ã¤ã«ã¨ããã®ã¯BufferedOutputãã©ã°ã¤ã³ã§buffer_type fileãæå®ãã¦buffer_pathã«ã§ãããã¡ã¤ã«ã®ãã¨ãããã«ãã©ã°ã¤ã³ã§ä½¿ããã¼ã¿ãä¿åããã¦ããã®ã§ãFluentdãæ¢ãã¦ã次åèµ·åæã«åéãè¡ãããã åé¡ ä¾ã¨ãã¦out_forwardã使ãã¨ä»¥ä¸ã®è¨å®ã®ããã«buffer/foo.bar.bazã«ãããã¡ãä¿åããããã«ãã¦ããã
fluentd / td-agent ã¨ã¯ fluentd ã¨ã¯ fluentdã¯ruby gemã«ãã£ã¦æä¾ããããã°è»¢é/åéã®ä»çµã¿ã§ããrsyslogdã§ã¯å®ç¾ã§ããªããããªå¤§éãã°ã®åé/åæãè¡ãç®çã§ä½¿ç¨ããã¨è¯ãã¨æãã¾ãã td-agent ã¨ã¯ td-agentã¨ã¯fluentdã®ã©ããã¼ããã°ã©ã ã§ããruby, gemçã®ããã°ã©ã ãèµ·åã¹ã¯ãªãããªã©ã®ä¾¿å©ãªãã¡ã¤ã«ãã¤ã³ã¹ãã¼ã«ã³ãã³ãã²ã¨ã¤ã§æä¾ãã¦ããã¾ããtd-agentã¯ç°å¢å¤æ°PATHã«ã¯åå¨ããªããã£ã¬ã¯ããªã«rubyãgemãã¤ã³ã¹ãã¼ã«ãã¦ãããã®ã§ãã·ã¹ãã å ¨ä½ã¸ã®å½±é¿ãä¸ããã«fluentdã使ããã¡ãªãããããã¾ãã fluentdã®ãã¡ãªãã(å¼±ç¹) fluentdã¯ä¸è½ã§ã¯ãªããæ¥åè¦ä»¶ã«ãã£ã¦ã¯ã¯ã©ã·ãã¯ãªrsyslogdã使ç¨ããæ¹ãè¯ãå ´é¢ãåå¨ãã¾ãã以ä¸ã«fluentdã®å¼±ç¹ã
ãã°åéãã¼ã«ã¨ãã¦ã¯FluentdãLogstashãFlumeçãæããããããã¡ã¤ã«ãã¡ã¼ã«ãsyslogãDBãã»ã³ãµãããã°ãã¼ã¿ãèªè¾¼ã¿ãå¿ è¦ãªãã°ããã£ã«ã¿ãã¦ãjsonãxmlã«æ´å½¢ãã¦ã¢ã¦ããããããæ©è½ãæã¤ã ã¡ãªãã ãã©ã°ã¤ã³ã300+å ¬éããã¦ãããæ§ã ãªå½¢å¼ã®ãã¼ã¿ãã¤ã³ããããã¢ã¦ããããã§ãã åä½ã§ãã°ã®ãã£ã«ã¿ããããã¡ãã«ã¼ãã£ã³ã°ãã§ãã 2000+ãè¶ ããä¼æ¥ã«å©ç¨ããã¦ãã æ¥æ¬èªã®æ å ±ãå¤ã ãã¡ãªãã åä½ã§åä½ããããfluentdãè½ã¡ãããããã¡ãã¦ãããã°ãæ¶ãã æ³å®å¤ã®ãã°ãå ¥åãããã¨å¤§éã®ã¹ã¿ãã¯ãã¬ã¼ã¹ãåããã å¼ç¨ï¼http://changineer.info/server/logging/fluentd-td-agent.html#fluentd-2 Logstash ã¡ãªãã ãã£ã«ã¿ãç°¡åã«ã«ã¹ã¿ãã¤ãºã§ãã F
æ¦è¦ dockerãæ¬çªéç¨ããéã«ãã°ã®æ±ãã«æ©ãã ã®ã§æ å ±ãã¾ã¨ãã¦ã¿ã¾ããã ç°å¢ docker v1.12.1 ã³ã³ããã®ãã°ã¯ä½å¦ã«æ¸¡ãã¹ãã 主ã«ä»¥ä¸ã®ï¼éãã«ãªãã¨æãã¾ãã ã³ã³ããå ã«ä¿å volumeå ã«æå®ãã¦ã«æ°¸ç¶ä¿å log driverã使ã£ã¦è»¢é a. ã³ã³ããå ã«ä¿å ä½ãè¨å®ããªãã¨ã³ã³ããã«ä¿æããã¾ãã ã¡ãªãã ä½ãè¨å®ããªãã¦ãã ãã¡ãªãã å½ç¶ã³ã³ãããç ´æ£ãããå ´åã¯ãã°ãã¡ã¤ã«ããªããªãã¾ãã b. volumeå ã«æå®ãã¦ã«æ°¸ç¶ä¿å volumeãç¨ãã¦ãã¹ãã«æ°¸ç¶çã«ä¿åãã¾ãã åç §ãåããªãããã«-v <host_path>:<container_path>ã¨ãããã--volumes-from <container_name>ã§ãã¼ã¿ç¨ã³ã³ããã«ä¿æãã¦ãã ããã ã¡ãªãã ã³ã³ãããç ´æ£ããã¨ãã¦ãvolumeã§ãããæå®ããã°
ç±³Linux Foundationã¯2016å¹´11æ8æ¥ï¼ç±³å½æéï¼ããã¼ã¿åéã®ãªã¼ãã³ã½ã¼ã¹ã½ããã¦ã¨ã¢ï¼OSSï¼ãFluentdãããCloud Native Computing Foundationï¼CNCFï¼ãã®ç®¡çããããã¸ã§ã¯ãã«ãªã£ãã¨çºè¡¨ãããFluentdã¯å¤æ©è²ä¹æ°ï¼åçï¼ãéçºãå§ããOSSã§ãç¾å¨ã¯ç±³Googleãç±³Microsoftã®ã¯ã©ã¦ãã®ä¸ã§ã使ããã¦ããã Linux Foundationåä¸ã®CNCFã¯ããDockerãã³ã³ãããéä¸ç®¡çããOSSãKubernetesãã®éçºã主å°ããå£ä½ãKubernetesã¯GoogleãéçºããOSSã ããGoogleã¯2015å¹´7æã«Kubernetesã®éçºãCNCFã«ç§»è¡ããã¨çºè¡¨ãã¦ãããCNCFã¯ç¾å¨ãKubernetesç¨ã®éç¨ç®¡çãã¼ã«ã§ãããOpenTracingãããPrometheusãã®é
æè¿æ¥å㧠Fluentd ã触ããã¨ãåºã¦ãã¦å ¥éãããã§ãããæåã®ãã¡ã¯ãã©ãã«ãèµ·ããæã«ä½ãèµ·ãã¦ããã®ããã©ã対å¦ãããè¯ãã®ãããã£ã±ãããããªãã£ãã®ã§ããFluentd ã£ã¦ãã°ã®åéã¨ãã«ä½¿ããããã¤ã§ããï¼ãç¨åº¦ã®ç¥èãããªãã£ãéå»ã®èªåã«åãã¦ãã¨ãããããããããã¯ç¥ã£ã¦ããï¼ãã¨è¨ãããå 容ãã¾ã¨ãã¦ã¿ã¾ããã ãã©ãã«ãèµ·ããæã«ã©ã®å¦çã§åé¡ãèµ·ãã¦ããã®ãç´ æ©ãã³ã¼ãã追ããã¨ãã§ãã¦ããã¼ã¿ã®æ¶å¤±ãæå°éã«æãã¤ã¤é©åã«å¯¾å¦ã§ããããã«ãªããã¨ãç®çã¨ãã¦ãã¾ãã ãªããç¾æç¹ã§ææ°çã® Fluentd v0.14.21 ã対象ã«ãã¦ãã¾ãã ã¢ã¸ã§ã³ã Getting Started Fluentd ã®ã¢ã¼ããã¯ã㣠Processes Supervisor process Worker process Threads Input thread En
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}