インストール
# fluent-gem install fluent-plugin-s3
設定
こんな設定をしてみます。
inputは色々あると思いますが、outputを以下のようにします。
<store> type s3 aws_key_id xxxxxxxxxx aws_sec_key xxxxxxxxxx s3_bucket xxxxx.xxxxxx s3_region ap-northeast-1 path logs/ buffer_path /opt/fluent/s3 time_slice_format %Y%m%d%H time_slice_wait 10m format json flush_interval 10s buffer_path /var/log/td-agent/s3 buffer_chunk_limit 8m buffer_queue_limit 1280 retry_limit 10 retry_wait 5s flush_at_shutdown true </store>
これでFluentdの再起動をすると、、、、以下のエラーになりました。
エラー対処
[warn]: temporarily failed to flush the buffer. next_retry=2015-08-07 18:56:06 +0900 error_class="ArgumentError" error="could not find a temporary directory" plugin_id="object:xxxxxxxxxx”
could not find a temporary directory ???
調べたところ、/tmpにスティッキービットが足りないことがわかりました。
現在 # ls -la / drwxrwxrwx. 26 root root 4096 2015-08-07 11:26 tmp # chmod o+t /tmp を実施したところ、無事解決!スティッキービットだったとは。 変更後 最後にtがついてますよね。 # ls -la / drwxrwxrwt. 26 root root 4096 2015-08-07 20:27 tmp
/tmpだったとは。結構はまりました。