在测试中遇到的一些问题
elasticsearch日志中出现警告
[WARN ][http.netty ] [Banshee] Caught exception while handling client http traffic, closing connection [id: 0x61615783, /127.0.0.1:37923 => /127.0.0.1:9200]
org.jboss.netty.handler.codec.frame.TooLongFrameException: HTTP content length exceeded 104857600 bytes
同时fluentd日志出现警告
2016-03-10 16:02:29 +0800 [warn]: temporarily failed to flush the buffer. next_retry=2016-03-10 16:00:58 +0800 error_class="Fluent::ElasticsearchOutput::ConnectionFailure" error="Could not push logs to Elasticsearch after 2 retries. Connection reset by peer (Errno::ECONNRESET)" plugin_id="object:3fe5fd03d3ec"
根据提示显示http传输内容过多
然后(这个然后是好长时间,脑纸不好使)想到fluentd中我用的是file做的缓存 关键是配置的太大了256m
然后我修改/etc/td-agent/td-agent.conf把buffer_type 设置为memory buffer_chunk_limit设置为 8m buffer_queue_limit 设为 8 flush_interval设为20s
<match nginx.*>
type elasticsearch
host 127.0.0.1
port 9200
buffer_type memory
buffer_path /var/log/fluent/myapp.*.buffer
buffer_chunk_limit 8m
buffer_queue_limit 8
logstash_format true
flush_interval 20s
retry_limit 17
include_tag_key true
tag_key mapred
</match>
然后就可以了 后期可以根据实际情况调做优化
如果单纯的是在fluentd日志中出现访问被拒应该是文件夹权限问题比如设置的elasticsearch数据文件夹。还有就是端口拒绝访问 这样的话就把host改为127.0.0.1 然后关闭防火墙