{"id":311,"date":"2014-07-31T10:00:35","date_gmt":"2014-07-31T01:00:35","guid":{"rendered":"http:\/\/www.skyarch.net\/blog\/?p=311"},"modified":"2021-11-02T17:30:10","modified_gmt":"2021-11-02T08:30:10","slug":"apache%e3%81%ae%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%83%ad%e3%82%b0%e3%82%92s3%e3%81%ab%e3%81%9f%e3%82%81%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.skyarch.net\/blog\/apache%e3%81%ae%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%83%ad%e3%82%b0%e3%82%92s3%e3%81%ab%e3%81%9f%e3%82%81%e3%82%8b\/","title":{"rendered":"Apache\u306e\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u3092S3\u306b\u305f\u3081\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01<\/p>\n<p>fluentd\u3092\u4f7f\u3063\u3066\u3001Apache\u306e\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u3092S3\u306e\u30d0\u30b1\u30c3\u30c8\u306b\u305f\u3081\u308b\u624b\u9806\u3067\u3059\u3002<br \/>\nfluentd\u306e\u8a2d\u5b9a\u304c\u96e3\u3057\u304f\u3066\u3001\u306a\u304b\u306a\u304b\u82e6\u52b4\u3057\u307e\u3057\u305f\u3002<br \/>\n\u6b21\u56de\u82e6\u52b4\u3057\u306a\u3044\u3088\u3046\u306b\u3001\u3053\u3053\u306b\u66f8\u304d\u7559\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>TreasureData\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\nvi \/etc\/yum.repos.d\/treasuredata.repo \u3067\u6b21\u3092\u8a18\u8ff0\u3057\u307e\u3059<br \/>\n[treasuredata]\nname=TreasureData<br \/>\nbaseurl=http:\/\/packages.treasure-data.com\/redhat\/$basearch<br \/>\nenabled=1<br \/>\ngpgcheck=0<\/p>\n<p>fluentd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\nyum install -y td-agent<br \/>\nfluentd\u306e\u5b9f\u884c\u30e6\u30fc\u30b6\u3067access_log\u3092\u8aad\u3081\u308b\u3088\u3046\u306b\u6a29\u9650\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\nchgrp td-agent \/var\/log\/httpd\/<br \/>\nchmod g+rx \/var\/log\/httpd\/<br \/>\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u203b\u8d64\u5b57\u306e\u90e8\u5206\u306f\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\nvi \/etc\/td-agent\/td-agent.conf<\/p>\n<p style=\"padding-left: 30px\">&lt;source&gt;<\/p>\n<p style=\"padding-left: 60px\">type tail<br \/>\nformat apache2<br \/>\npath \/var\/log\/httpd\/access_log<br \/>\npos_file \/var\/log\/td-agent\/httpd.access_log.pos<br \/>\ntag s3.apache.access<\/p>\n<p style=\"padding-left: 30px\">&lt;\/source&gt;<\/p>\n<p style=\"padding-left: 30px\">&lt;match s3.*.*&gt;<\/p>\n<p style=\"padding-left: 60px\">type copy<\/p>\n<p style=\"padding-left: 90px\">&lt;store&gt;<br \/>\ntype s3<\/p>\n<p style=\"padding-left: 90px\">aws_key_id <span style=\"color: #ff0000\">AWS-ACCESS-KEY<\/span><br \/>\naws_sec_key <span style=\"color: #ff0000\">AWS-SECRET-KEY<\/span><br \/>\ns3_bucket apache-accesslog<br \/>\ns3_endpoint s3-ap-southeast-1.amazonaws.com<br \/>\npath access_log_<br \/>\nbuffer_path \/var\/log\/td-agent\/s3<\/p>\n<p style=\"padding-left: 90px\">time_slice_format %Y%m%d_%H%M<br \/>\ntime_slice_wait 1m<br \/>\nutc<\/p>\n<p style=\"padding-left: 90px\">buffer_chunk_limit 256m<\/p>\n<p style=\"padding-left: 60px\">&lt;\/store&gt;<\/p>\n<p style=\"padding-left: 30px\">&lt;\/match&gt;<\/p>\n<p>\u8d77\u52d5\u3057\u307e\u3059\u3002<br \/>\n\/etc\/init.d\/td-agent start<br \/>\nApache\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u30ed\u30b0\u304cS3\u306e\u30d0\u30b1\u30c3\u30c8\u5185\u306b\u4f5c\u6210\u3055\u308c\u308c\u3070OK\u3067\u3059\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01 fluentd\u3092\u4f7f\u3063\u3066\u3001Apache\u306e\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u3092S3\u306e\u30d0\u30b1\u30c3\u30c8\u306b\u305f\u3081\u308b\u624b\u9806\u3067\u3059\u3002 fluentd\u306e\u8a2d\u5b9a\u304c\u96e3\u3057\u304f\u3066\u3001\u306a\u304b\u306a\u304b\u82e6\u52b4\u3057\u307e\u3057\u305f\u3002 \u6b21\u56de\u82e6\u52b4\u3057\u306a\u3044\u3088\u3046\u306b\u3001\u3053\u3053\u306b\u66f8\u304d\u7559\u3081\u3066\u304a\u304d\u307e\u3059\u3002 Treasur&#8230;<\/p>\n","protected":false},"author":1,"featured_media":234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"http:\/\/www.skyarch.net\/blog\/?p=311","footnotes":""},"categories":[90,35],"tags":[],"class_list":{"0":"post-311","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-apache","8":"category-web-linux","9":"ja"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/comments?post=311"}],"version-history":[{"count":24,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/311\/revisions"}],"predecessor-version":[{"id":472,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/311\/revisions\/472"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media\/234"}],"wp:attachment":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media?parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/categories?post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/tags?post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}