{"id":799,"date":"2015-01-06T19:30:53","date_gmt":"2015-01-06T10:30:53","guid":{"rendered":"http:\/\/blog.tanitanin.net\/?p=799"},"modified":"2015-01-06T20:42:34","modified_gmt":"2015-01-06T11:42:34","slug":"centos-7-%e3%81%ab-fluentd-%e3%82%92%e5%85%a5%e3%82%8c%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/blog.tanitanin.net\/?p=799","title":{"rendered":"CentOS 7 \u306b Fluentd \u3092\u5165\u308c\u3066\u307f\u305f"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff0c\u305f\u306b\u305f\u306b\u3067\u3059\uff0e<\/p>\n<p>MessagePack\u306b\u3064\u3044\u3066\u30b0\u30b0\u3063\u3066\u3044\u308b\u3068\uff0c<a href=\"http:\/\/www.fluentd.org\/\">Fluentd<\/a> \u3068\u3044\u3046\u3084\u3064\u304c\u30ca\u30a6\u306a\u30e4\u30f3\u30b0\u306b\u30d0\u30ab\u30a6\u30b1\u3089\u3057\u3044\u306e\u3067\uff0c\u5165\u308c\u3066\u307f\u307e\u3057\u305f\uff0e<br \/>\n<a href=\"http:\/\/www.fluentd.org\/\">Fluentd<\/a>\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u307f\u308b\u3068\uff0c\u597d\u304d\u306a\u3068\u3053\u308d\u304b\u3089\u30ed\u30b0\u3092\u53ce\u96c6\u3057\u3066\uff0c\u597d\u304d\u306a\u3068\u3053\u308d\u306b\u51fa\u529b\u3067\u304d\u308b\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3089\u3057\u3044\u3067\u3059\uff0e<br \/>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u305f\u304f\u3055\u3093\u52d5\u304b\u3057\u3066\u3044\u3066\uff0c\u76f8\u4e92\u306e\u95a2\u4fc2\u3092\u5206\u6790\u3057\u305f\u3044\uff0c\u307f\u305f\u3044\u306a\u7528\u9014\u306b\u306f\u3059\u3054\u304f\u4fbf\u5229\u305d\u3046\u3067\u3059\uff0e<\/p>\n<p>\u81ea\u5206\u307f\u305f\u3044\u306a\uff0c\u30ed\u30b0\u306f\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u3057\u3068\u3044\u3066\u653e\u7f6e\u3067\u3044\u3044\u3084\uff0c\u3068\u3044\u3046\u4eba\u9593\u306b\u306f\u3042\u307e\u308a\u3054\u5229\u76ca\u304c\u306a\u3044\u3063\u307d\u3044\u6c17\u304c\u3057\u307e\u3059\u304c\uff0c\u6d41\u884c\u306b\u4e57\u3063\u3066\u5165\u308c\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>TreasureData\u306e\u30da\u30fc\u30b8\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7528\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u7f6e\u3044\u3066\u3042\u308b\u306e\u3067\uff0c\u5229\u7528\u3057\u307e\u3059\uff0e<\/p>\n<pre><code class=\"sh\"># sudo curl -L http:\/\/toolbelt.treasuredata.com\/sh\/install-redhat-td-agent2.sh | sh\n<\/code><\/pre>\n<p>\u7c21\u5358(\u30fb\u2200\u30fb)<\/p>\n<h2>\u8d77\u52d5<\/h2>\n<p>systemd\u3092\u4f7f\u3063\u3066\u8d77\u52d5\u3057\u307e\u3059\uff0e<\/p>\n<pre><code class=\"sh\"># sudo systemctl start td-agent\n<\/code><\/pre>\n<p>enable\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u3066\u3057\u307e\u3044\u307e\u3057\u305f\uff0e\uff0e\uff0e(\u00b4\u30fb\u03c9\u30fb`)<\/p>\n<pre><code class=\"sh\"># sudo systemctl enable td-agent\ntd-agent.service is not a native service, redirecting to \/sbin\/chkconfig.\nExecuting \/sbin\/chkconfig td-agent on\nThe unit files have no [Install] section. They are not meant to be enabled\nusing systemctl.\nPossible reasons for having this kind of units are:\n1) A unit may be statically enabled by being symlinked from another unit's\n   .wants\/ or .requires\/ directory.\n2) A unit's purpose may be to act as a helper for some other unit which has\n   a requirement dependency on it.\n3) A unit may be started when needed via activation (socket, path, timer,\n   D-Bus, udev, scripted systemctl call, ...).\n<\/code><\/pre>\n<p>enable\u306e\u8a2d\u5b9a\u304c\u66f8\u3044\u3066\u306a\u3044\u304b\u3089chkconfig\u3092\u4ee3\u308f\u308a\u306b\u4f7f\u3063\u305f\u3063\u3066\u3053\u3068\u307f\u305f\u3044\uff0e\uff0e\uff0e<\/p>\n<h2>\u8a66\u3057\u3066\u307f\u308b<\/h2>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f \/etc\/td-agent\/td-agent.conf \u306b\u3042\u308b\u3088\u3046\u3067\u3059\uff0e<br \/>\n\u307e\u305f\uff0c\u521d\u671f\u8a2d\u5b9a\u3060\u3068\uff0cHTTP(8888\u30dd\u30fc\u30c8)\u304b\u3089\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30ed\u30b0(\/var\/log\/td-agent\/td-agent.log)\u306b\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u306a\u306e\u3067\uff0c\u5b9f\u969b\u306b\u30ed\u30b0\u304c\u51fa\u529b\u3055\u308c\u308b\u304b\u8a66\u3057\u3066\u307f\u307e\u3059\uff0e<\/p>\n<pre><code class=\"sh\"># curl -X POST -d 'json={\"json\":\"message\"}' http:\/\/localhost:8888\/debug.test\n# tail \/var\/log\/td-agent\/td-agent.log\n2015-01-06 19:02:54 +0900 debug.test: {\"json\":\"message\"}\n<\/code><\/pre>\n<p>\u3061\u3083\u3093\u3068\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u3051\u53d6\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff0c\u305f\u306b\u305f\u306b\u3067\u3059\uff0e MessagePack\u306b\u3064\u3044\u3066\u30b0\u30b0\u3063\u3066\u3044\u308b\u3068\uff0cFluentd \u3068\u3044\u3046\u3084\u3064\u304c\u30ca\u30a6\u306a\u30e4\u30f3\u30b0\u306b\u30d0\u30ab\u30a6\u30b1\u3089\u3057\u3044\u306e\u3067\uff0c\u5165\u308c\u3066\u307f\u307e\u3057\u305f\uff0e Fluentd\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u307f\u308b\u3068\uff0c\u597d\u304d\u306a\u3068\u3053\u308d\u304b\u3089\u30ed\u30b0\u3092\u53ce\u96c6\u3057\u3066 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-799","post","type-post","status-publish","format-standard","hentry","category-1"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5lSjy-cT","jetpack-related-posts":[{"id":697,"url":"https:\/\/blog.tanitanin.net\/?p=697","url_meta":{"origin":799,"position":0},"title":"ArchLinux\u3067IP\u3092\u9759\u7684\u306b\u56fa\u5b9a\u3059\u308b","author":"tanitanin","date":"2014\u5e7410\u67083\u65e5","format":false,"excerpt":"CentOS 7 \u3084 Ubuntu 14.04 \u306a\u3069\u306b\u6f0f\u308c\u305a\uff0cArch Linux \u3067\u3082\u30ec\u30ac\u30b7\u30fc\u306a\u30cd\u2026","rel":"","context":"\u672a\u5206\u985e","block_context":{"text":"\u672a\u5206\u985e","link":"https:\/\/blog.tanitanin.net\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":809,"url":"https:\/\/blog.tanitanin.net\/?p=809","url_meta":{"origin":799,"position":1},"title":"CentOS 7 \u306b MongoDB \u3092\u5165\u308c\u308b","author":"tanitanin","date":"2015\u5e741\u67086\u65e5","format":false,"excerpt":"\u3053\u3093\u306b\u3061\u306f\uff0c\u305f\u306b\u305f\u306b\u3067\u3059\uff0e \u30ca\u30a6\u3067\u30e4\u30f3\u30b0\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff1f\u3067\u3042\u308b MongoDB \u3092 CentOS 7\u2026","rel":"","context":"\u672a\u5206\u985e","block_context":{"text":"\u672a\u5206\u985e","link":"https:\/\/blog.tanitanin.net\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":599,"url":"https:\/\/blog.tanitanin.net\/?p=599","url_meta":{"origin":799,"position":2},"title":"VMWare\u306bArch Linux\u3092\u5165\u308c\u3066\u304b\u3089GUI\u304c\u3067\u304d\u308b\u307e\u3067","author":"tanitanin","date":"2014\u5e748\u670816\u65e5","format":false,"excerpt":"[\u524d\u56de]{http:\/\/blog.tanitanin.net\/?p=557}\u304b\u3089\u306e\u7d9a\u304d\u3067\u3059\uff0e \u30a4\u30f3\u30b9\u2026","rel":"","context":"\u672a\u5206\u985e","block_context":{"text":"\u672a\u5206\u985e","link":"https:\/\/blog.tanitanin.net\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":360,"url":"https:\/\/blog.tanitanin.net\/?p=360","url_meta":{"origin":799,"position":3},"title":"nginx\u306e\u8a2d\u5b9a","author":"tanitanin","date":"2013\u5e743\u67081\u65e5","format":false,"excerpt":"\u3055\u304f\u3089VPS\u3067apache\u304b\u3089nginx\u3078\u79fb\u884c\u3057\u3088\u3046\u304b\u3068\u601d\u3063\u3066\u5165\u308c\u305f\u6642\u306e\u8a2d\u5b9a\u3092\u5fd8\u308c\u306a\u3044\u305f\u3081\u306e\u30e1\u30e2\uff0e \u2026","rel":"","context":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","block_context":{"text":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","link":"https:\/\/blog.tanitanin.net\/?cat=64"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":557,"url":"https:\/\/blog.tanitanin.net\/?p=557","url_meta":{"origin":799,"position":4},"title":"VMWare\u306bArch Linux\u3092\u5165\u308c\u3066\u307f\u305f","author":"tanitanin","date":"2014\u5e748\u670816\u65e5","format":false,"excerpt":"VMWare\u306bArch Linux\u3092\u5165\u308c\u3066\u307f\u307e\u3057\u305f\uff0e \u30d0\u30fc\u30b8\u30e7\u30f3\u306f2014.08.01\u3067\u3057\u305f\uff0e \u53c2\u8003\u2026","rel":"","context":"\u672a\u5206\u985e","block_context":{"text":"\u672a\u5206\u985e","link":"https:\/\/blog.tanitanin.net\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":550,"url":"https:\/\/blog.tanitanin.net\/?p=550","url_meta":{"origin":799,"position":5},"title":"git-flow\u3067\u307c\u3063\u3061\u958b\u767a\u306f\u3058\u3081\u307e\u3059","author":"tanitanin","date":"2014\u5e748\u67087\u65e5","format":false,"excerpt":"git-flow\u3068\u3044\u3046Git\u306e\u30b5\u30d6\u30e2\u30b8\u30e5\u30fc\u30eb\uff1f\u3092\u4f7f\u3046\u3068\u958b\u767a\u304c\u6357\u308b\u3068\u3044\u3046\u30a6\u30ef\u30b5\u3092\u805e\u304d\uff0c \u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u2026","rel":"","context":"\u672a\u5206\u985e","block_context":{"text":"\u672a\u5206\u985e","link":"https:\/\/blog.tanitanin.net\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=\/wp\/v2\/posts\/799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=799"}],"version-history":[{"count":10,"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=\/wp\/v2\/posts\/799\/revisions"}],"predecessor-version":[{"id":815,"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=\/wp\/v2\/posts\/799\/revisions\/815"}],"wp:attachment":[{"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tanitanin.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}