【发布时间】:2017-04-14 12:33:51
【问题描述】:
我正在尝试使用 fluentd 和 elasticsearch 收集 docker 日志,这是我开始使用 fluentd 的日志。
2016-11-30 16:29:34 +0800 [info]: starting fluentd-0.12.19
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-mixin-config-placeholders' version '0.3.0'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-mixin-plaintextformatter' version '0.2.6'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-elasticsearch' version '1.7.0'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-mongo' version '0.7.11'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-rewrite-tag-filter' version '1.5.3'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-s3' version '0.6.4'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-scribe' version '0.10.14'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-secure-forward' version '0.4.3'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-td' version '0.10.28'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-td-monitoring' version '0.2.1'
2016-11-30 16:29:34 +0800 [info]: gem 'fluent-plugin-webhdfs' version '0.4.1'
2016-11-30 16:29:34 +0800 [info]: gem 'fluentd' version '0.12.19'
2016-11-30 16:29:34 +0800 [info]: adding match pattern="td.*.*" type="tdlog"
2016-11-30 16:29:34 +0800 [info]: adding match pattern="debug.**" type="stdout"
2016-11-30 16:29:34 +0800 [info]: adding match pattern="docker.**" type="stdout"
2016-11-30 16:29:34 +0800 [info]: adding match pattern="*.**" type="copy"
2016-11-30 16:29:35 +0800 [info]: adding source type="forward"
2016-11-30 16:29:35 +0800 [info]: adding source type="http"
2016-11-30 16:29:35 +0800 [info]: adding source type="debug_agent"
2016-11-30 16:29:35 +0800 [info]: using configuration file: <ROOT>
<match td.*.*>
type tdlog
apikey xxxxxx
auto_create_table
buffer_type file
buffer_path /var/log/td-agent/buffer/td
<secondary>
type file
path /var/log/td-agent/failed_records
buffer_path /var/log/td-agent/failed_records.*
</secondary>
</match>
<match debug.**>
type stdout
</match>
<match docker.**>
type stdout
</match>
<match *.**>
type copy
<store>
@type elasticsearch
host localhost
port 9200
include_tag_key true
tag_key log_name
logstash_format true
flush_interval 1s
</store>
</match>
<source>
type forward
</source>
<source>
type http
port 8888
</source>
<source>
type debug_agent
bind 127.0.0.1
port 24230
</source>
</ROOT>
2016-11-30 16:29:35 +0800 [info]: listening fluent socket on 0.0.0.0:24224
2016-11-30 16:29:35 +0800 [info]: listening dRuby uri="druby://127.0.0.1:24230" object="Engine"
2016-11-30 16:29:38 +0800 docker.40271db2b565: {"log":"1:M 30 Nov 08:29:38.065 # User requested shutdown...","container_id":"40271db2b565d52fa0ab54bde2b0fa4b61e4ca033fca2b7edcf54c1a93443c19","container_name":"/tender_banach","source":"stdout"}
我使用elasticsearch的默认配置,启动后,它一直这样记录。
[2016-11-30T16:49:32,154][WARN][oecraDiskThresholdMonitor][I_hB3Vd] [I_hB3VdfQ3q3hBeP5skTBQ][I_hB3Vd][/Users/it/Desktop/elasticsearch-5.0] 上超过了高磁盘水印 [90%] .1/data/nodes/0] free: 10gb[8.9%], shards 将被搬离这个节点
我的elasticsearch 版本是5.0.1,fluentd 版本和fluent-plugin-elasticsearch 显示在上面。我使用的是 Mac OS 10.11.6。网上能找到的方法都试过了,谁能帮忙?
【问题讨论】:
标签: logging elasticsearch docker fluentd