{"id":1891,"date":"2015-06-21T01:32:29","date_gmt":"2015-06-20T16:32:29","guid":{"rendered":"http:\/\/tech.akat.info\/?p=1891"},"modified":"2015-07-06T23:53:40","modified_gmt":"2015-07-06T14:53:40","slug":"fluentd-elasticsearch-kibana","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=1891","title":{"rendered":"Fluentd + Elasticsearch + Kibana"},"content":{"rendered":"<h1>Fluentd 1,2\u306e\u9055\u3044<\/h1>\n<p>2015\u5e746\u6708\u73fe\u5728\u306f1\u30682\u306e\u4e8c\u3064\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u4e26\u884c\u3057\u3066\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u3044\u308b<\/p>\n<h2>td-agent 1<\/h2>\n<p>\u30fb\u73fe\u5728\u306fold stable<br \/>\n\u30fb\u540c\u68b1\u3057\u3066\u3044\u308bRuby 1.9.3\u304c2015\u5e742\u6708\u306b\u30b5\u30dd\u30fc\u30c8\u304c\u7d42\u4e86\u3057\u3066\u3044\u308b<\/p>\n<h2>td-agent 2<\/h2>\n<p>\u30fb\u73fe\u5728\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u3044\u308bstable\u7248<br \/>\n\u30fb\u30b3\u30a2\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u308b\u3053\u3068\u3082\u3042\u308a<br \/>\n\u30fb\u30b5\u30dd\u30fc\u30c8\u74b0\u5883\u304c1\u3088\u308a\u3082\u591a\u3044(Debian\u3084Mac\u3082)<br \/>\n\u30fbFluentd UI\u3082\u5229\u7528\u53ef\u80fd<\/p>\n<h1>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb -fluentd-<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n### \u4e8b\u524d\u6e96\u5099 ###\r\n&#x5B;root@ip-172-32-0-221 src]# vi \/etc\/security\/limits.conf\r\n===\r\n# \u4ee5\u4e0b\u3092\u8ffd\u52a0\r\nroot soft nofile 65536\r\nroot hard nofile 65536\r\n* soft nofile 65536\r\n* hard nofile 65536\r\n===\r\n&#x5B;root@ip-172-32-0-221 src]# reboot\r\n...\r\n&#x5B;root@ip-172-32-0-221 src]# ulimit -n\r\n65536\r\n\r\n### \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb ###\r\n&#x5B;root@ip-172-32-0-221 src]# curl -L http:\/\/toolbelt.treasuredata.com\/sh\/install-redhat-td-agent2.sh | sh\r\n...\r\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb:\r\n  td-agent.x86_64 0:2.2.0-0\r\n\r\n\u5b8c\u4e86\u3057\u307e\u3057\u305f!\r\n\r\n&#x5B;root@ip-172-32-0-221 src]# chkconfig --list td-agent\r\ntd-agent        0:off   1:off   2:off   3:off   4:off   5:off   6:off\r\n&#x5B;root@ip-172-32-0-221 src]# chkconfig td-agent on\r\n&#x5B;root@ip-172-32-0-221 src]# chkconfig --list td-agent\r\ntd-agent        0:off   1:off   2:on    3:on    4:on    5:on    6:off\r\n\r\n### \u53d6\u308a\u8fbc\u3080\u30d5\u30a1\u30a4\u30eb\u306b\u3088\u3063\u3066\u306f\u8d77\u52d5\u30e6\u30fc\u30b6\u3092td-agent\u304b\u3089root\u306b\u5909\u66f4\u3059\u308b ###\r\n&#x5B;root@ip-172-32-0-221 src]# vi \/etc\/init.d\/td-agent\r\n...\r\n#DAEMON_ARGS=${DAEMON_ARGS---user td-agent}\r\n#TD_AGENT_ARGS=&quot;${TD_AGENT_ARGS-\/usr\/sbin\/td-agent --group td-agent --log \/var\/log\/td-agent\/td-agent.log --use-v1-config}&quot;\r\nDAEMON_ARGS=${DAEMON_ARGS---user root}\r\nTD_AGENT_ARGS=&quot;${TD_AGENT_ARGS-\/usr\/sbin\/td-agent --group root --log \/var\/log\/td-agent\/td-agent.log --use-v1-config}&quot;\r\n...\r\n\r\n### \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb ###\r\n&#x5B;root@ip-172-32-0-221 src]# \/opt\/td-agent\/embedded\/bin\/fluent-gem install fluent-plugin-elasticsearch\r\n...\r\nDone installing documentation for elasticsearch, elasticsearch-api, elasticsearch-transport, excon, faraday, fluent-plugin-elasticsearch, multipart-post after 4 seconds\r\n7 gems installed\r\n<\/pre>\n<p>\u5f8c\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308btd-agent-UI\u3092\u5229\u7528\u3057\u3066\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd<br \/>\n<a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001823.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001823-300x133.png\" alt=\"2015-06-21_001823\" width=\"300\" height=\"133\" class=\"alignnone size-medium wp-image-1892\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001823-300x133.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001823-1024x454.png 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001823-660x293.png 660w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001823.png 1222w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h1>td-agent-UI<\/h1>\n<pre class=\"brush: plain; title: \u8d77\u52d5; notranslate\" title=\"\u8d77\u52d5\">\r\n&#x5B;root@ip-172-32-0-221 src]# \/opt\/td-agent\/usr\/sbin\/td-agent-ui start\r\nPuma 2.11.0 starting...\r\n* Min threads: 0, max threads: 16\r\n* Environment: production\r\n* Listening on tcp:\/\/0.0.0.0:9292\r\n...\r\n\r\n### \u30d5\u30a9\u30a2\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u8d77\u52d5\u3059\u308b\u305f\u3081\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u3059\u308b ###\r\n# supervisor\u306f&lt;a href=&quot;http:\/\/tech.akat.info\/?p=1931&quot;&gt;\u30a4\u30f3\u30b9\u30c8\uff0d\u30eb\u6e08&lt;\/a&gt;\u3068\u3059\u308b\r\n&#x5B;root@ip-172-32-0-221 src]# vi \/etc\/supervisor\/conf.d\/td-agent-ui.conf\r\n&#x5B;program:td-agent-ui]\r\nuser=root\r\ncommand=td-agent-ui start\r\nstdout_logfile=\/var\/log\/supervisor\/%(program_name)s.log\r\nstderr_logfile=\/var\/log\/supervisor\/%(program_name)s_error.log\r\nnumprocs = 1\r\nstdout_logfile_maxbytes = 10MB\r\nstderr_logfile_maxbytes = 10MB\r\nstdout_logfile_backups = 5\r\nstderr_logfile_backups = 5\r\nautostart = true\r\nautorestart = true\r\n; http:\/\/webos-goodies.jp\/archives\/deploying_tornado_with_supervisord.html\r\n; \u3053\u3053\u306b\u6307\u5b9a\u3057\u305f\u79d2\u6570\u3088\u308a\u65e9\u304f\u7d42\u4e86\u3057\u305f\u3089\u3001\u7d42\u4e86\u30b3\u30fc\u30c9\u306b\u304b\u304b\u308f\u3089\u305a\u8d77\u52d5\u5931\u6557\u3068\u307f\u306a\u3059(default:1)\r\nstartsecs = 3\r\n; \u8d77\u52d5\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306b\u30ea\u30c8\u30e9\u30a4\u3059\u308b\u56de\u6570(default:3)\r\nstartretries = 3\r\npriority = 10\r\n\r\n&#x5B;root@ip-172-32-0-221 src]# \/usr\/local\/bin\/supervisorctl start td-agent-ui\r\ntd-agent-ui: started\r\n\r\n&#x5B;root@ip-172-32-0-221 src]# \/usr\/local\/bin\/supervisorctl status\r\ntd-agent-ui                      RUNNING   pid 28644, uptime 0:00:05\r\n<\/pre>\n<h1>fluentd\u8a2d\u5b9a<\/h1>\n<p>9292\u30dd\u30fc\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b<br \/>\n\u30fb\u30a2\u30ab\u30a6\u30f3\u30c8\u540d : admin<br \/>\n\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9 : changeme<br \/>\n\u3067\u30ed\u30b0\u30a4\u30f3\u53ef\u80fd<br \/>\n<a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162400.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162400-300x142.png\" alt=\"2015-06-20_162400\" width=\"300\" height=\"142\" class=\"alignnone size-medium wp-image-1895\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162400-300x142.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162400-660x313.png 660w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162400.png 816w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u521d\u671f\u8a2d\u5b9a(pid\u30d5\u30a1\u30a4\u30eb\u3084\u30ed\u30b0\u306e\u5834\u6240\u3092\u8a2d\u5b9a)<br \/>\n<a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162554.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162554-300x122.png\" alt=\"2015-06-20_162554\" width=\"300\" height=\"122\" class=\"alignnone size-medium wp-image-1894\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162554-300x122.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162554-1024x418.png 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162554-660x269.png 660w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-20_162554.png 1091w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u30bd\u30fc\u30b9\u3068\u51fa\u529b\u5148\u3092\u8a2d\u5b9a\u3059\u308b<br \/>\n<a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001001.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001001-300x128.png\" alt=\"2015-06-21_001001\" width=\"300\" height=\"128\" class=\"alignnone size-medium wp-image-1893\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001001-300x128.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001001-1024x436.png 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001001-660x281.png 660w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/06\/2015-06-21_001001.png 1340w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>@todo<br \/>\nhttp:\/\/docs.fluentd.org\/recipe\/nginx\/elasticsearch<br \/>\n\u3053\u306e\u901a\u308a\u306b\u3057\u305f\u3089\u3046\u307e\u304f\u3044\u3063\u305f<br \/>\nhttp:\/\/toshihirock.blogspot.jp\/2015\/04\/fluentd-v2elasticsearchkibana3ec2.html<br \/>\nhttp:\/\/hivecolor.com\/id\/37<br \/>\nhttp:\/\/inokara.hateblo.jp\/entry\/2013\/11\/30\/104023<br \/>\n\u2191\u3053\u308c\u3082\u78ba\u8a8d\u3059\u308b<\/p>\n<h1>kibana\u8a2d\u5b9a<\/h1>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u306f<a href=\"http:\/\/tech.akat.info\/?p=1803\">\u5272\u611b<\/a><\/p>\n<p>@todo<\/p>\n<h1>\u53c2\u8003URL<\/h1>\n<p>Treasure Agent(td-agent)\u306e1\u30682\u306e\u4eca\u5f8c<br \/>\nhttp:\/\/qiita.com\/repeatedly\/items\/c8107bc8ba5ba01133f8<br \/>\ntd-agent2\u3092Amazon Linux\u3067\u5b9f\u884c\u3059\u308b<br \/>\nhttp:\/\/dev.classmethod.jp\/cloud\/td-agent2-amazon-linux\/<br \/>\nCheck! \u306f\u3058\u3081\u3066\u306e fluentd \u3092 Amazon Linux \u3067\u52d5\u304b\u3057\u3066\u307f\u308b (\u30ed\u30b0\u3092 PHP \u304b\u3089\u9001\u308b)<br \/>\nhttp:\/\/qiita.com\/dz_\/items\/960319ffffa0d7355f8c<br \/>\ntd-agent2\u3092Amazon Linux\u3067\u5b9f\u884c\u3059\u308b<br \/>\nhttp:\/\/dev.classmethod.jp\/cloud\/td-agent2-amazon-linux\/<\/p>\n<h1>@todo\u3000\u30e1\u30e2<\/h1>\n<p>\u57fa\u790e\u306e\u7fd2\u5f97<\/p>\n<p>\u6b7b\u6d3b\u76e3\u8996<br \/>\nfluent-prugin-ping-message<\/p>\n<p>\u30ea\u30bd\u30fc\u30b9\u76e3\u8996<br \/>\nmonitor_agent<\/p>\n<p>\u30d0\u30c3\u30d5\u30a1\u3092\u30d5\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u304b\u3089\u7d42\u4e86\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3079\u3057<\/p>\n<p>\u305f\u3060Output\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u547c\u3073\u51fa\u3059\u3068<br \/>\nBuffer\u3084Queue\u306b\u5165\u308b\u3053\u3068\u306f\u306a\u3044<\/p>\n<p>\u2605\u4e2d\u8eab\u3092\u95b2\u89a7\u3057\u305f\u3044\u5834\u5408\u306f<br \/>\n\u3000fluent-tail \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3059\u308b\u3079\u3057<\/p>\n<p>\u2605elasticsearch \u306eindex\u3092\u6d3b\u304b\u305b\u308b\u3088\u3046\u306b<\/p>\n<p>fluent-cat\u3067\u30ed\u30b0\u306e\u6d41\u308c\u3092\u8a66\u3059<\/p>\n<p>tail\u306e\u5834\u5408\u306f\u3059\u3079\u3066\u6587\u5b57\u5217\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u308b<br \/>\nelasticsearch\u306f\u52d5\u7684\u306b\u578b\u3092\u5224\u65ad\u3059\u308b\u305f\u3081\u3001<br \/>\ncode\u306finteglar\u306a\u3069\u6c7a\u3081\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b<br \/>\n(fluent-plugin-typecast)\u3092\u5229\u7528\u3059\u308b\u3079\u3057<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fluentd 1,2\u306e\u9055\u3044 2015\u5e746\u6708\u73fe\u5728\u306f1\u30682\u306e\u4e8c\u3064\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u4e26\u884c\u3057\u3066\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u3044\u308b td-agent 1 \u30fb\u73fe\u5728\u306fold stable \u30fb\u540c\u68b1\u3057\u3066\u3044\u308bRuby 1.9.3\u304c2015\u5e742\u6708\u306b\u30b5\u30dd\u30fc\u30c8\u304c\u7d42 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[70,29,38],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1891"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1891"}],"version-history":[{"count":12,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1891\/revisions"}],"predecessor-version":[{"id":1983,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1891\/revisions\/1983"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}