fluentd - 由于聚合器任务失效,日志未推送到 ES
问题描述
我们在 Fargate 上部署 Fluentd Log Aggregator,在网络负载均衡器后面运行 4 个任务(具有自动缩放功能)。有几个进程将日志消息转发到日志聚合器。其中一项服务是在 EC2 上运行的 td-agent,将日志消息转发到日志聚合器。日志聚合器的输出配置包括 S3 和 ES。
我们注意到来自这个特定 td-agent 进程的日志在 ES 中缺失,但在 S3 中可用。在进一步分析之后,我们发现来自 td-agent 转发器的日志消息正在由一个特定的聚合器任务处理,并且该任务对于每个日志消息推送都有一堆以下日志消息。
Created new chunk chunk_id="5c6a9a106f19ccf7a3989defc303605c" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=nil, tag=nil, variables={:indexprefix=>"agg-tdagent"}, seq=0> | 2021-07-09 04:58:57 +0000 [debug]: #0 Created new chunk chunk_id="5c6a9a106f19ccf7a3989defc303605c" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=nil, tag=nil, variables={:indexprefix=>"agg-tdagent"}, seq=0>
2021-07-09 07:00:35 +0000 [warn]: #0 buffer flush took longer time than slow_flush_log_threshold: elapsed_time=20.126440424006432 slow_flush_log_threshold=20.0 plugin_id="object:b18"
我们终止了这个任务,聚合器服务自动启动了另一个任务。日志消息自动开始流经新的聚合器任务并最终流向 ES。
我有以下问题:
- 为什么日志转发器进程选择特定的日志聚合器任务。
- 如果有一个聚合器任务死了,日志不会转发到服务中的其他任务吗?
- 上面的消息是什么意思?为什么这个任务变得陈旧?
- 如果死任务能够处理消息并发送到 S3,为什么不发送到 ES?
日志聚合器的输出配置 -
<match splitlog.** jsonparsedMsg.** kubeMsgs.** >
@type copy
<store>
@type s3
s3_bucket "#{ENV['S3_LOGBUCKET']}"
s3_region "#{ENV['AWS_REGION']}"
path logs/${service_name}/%{time_slice}
time_slice_format %Y.%m.%d-%H%M
s3_object_key_format "%{path}/%{index}.%{file_extension}"
<buffer service_name,time>
@type "memory"
flush_thread_count 4
flush_mode interval
flush_interval 30s
flush_at_shutdown true
overflow_action throw_exception
retry_forever true
retry_type periodic
retry_wait 30s
compress gzip
timekey 1800
timekey_wait 10m
chunk_limit_size 64MB
total_limit_size 7288MB
</buffer>
<format>
@type json
</format>
</store>
<store>
@type elasticsearch
host "#{ENV['ES_HOSTNAME']}"
port 9243
user "#{ENV['ES_USERNAME']}"
password "#{ENV['ES_PASSWORD']}"
scheme https
with_transporter_log true
@log_level debug
ssl_verify false
ssl_version TLSv1_2
index_name ${indexprefix}
reconnect_on_error true
reload_connections false
reload_on_failure true
suppress_type_name true
request_timeout 30s
prefer_oj_serializer true
type_name _doc
<buffer indexprefix>
@type "file"
path "#{ENV['BufferPath']}"
flush_thread_count 10
flush_mode interval
flush_interval 30s
flush_at_shutdown true
overflow_action throw_exception
compress gzip
retry_forever true
retry_type periodic
retry_wait 30s
chunk_limit_size 64MB
total_limit_size 64GB
</buffer>
</store>
</match>
对此的任何帮助表示赞赏。
解决方案
推荐阅读
- java - 今天遇到一个完全陌生的字符,看起来像一个字母但不是一个字母
- javascript - Kineses 视频流 GETMEDIA API 问题
- python - python中的回溯//效率+内存布局
- swiftui - NavigationLink 子项中的“表单”选择器的 NavigationView 问题
- javascript - Laravel 8动态下拉菜单无法使用javascript
- php - 如何在 Laravel 中使用自定义列名和表名定义多对多关系
- td-engine - 为什么使用 python 连接器时,interp 函数在 TDengine 数据库中返回不同的值?
- java - 带有 GeckoDriver 的 WebDriver - 等待 45 秒等待 Firefox 启动超时
- highcharts - 从 highchart 图例符号中删除删除线
- google-sheets - 当从第一个实例中过滤其他数据时,Google 表格查询功能不会返回从第二行计算的备用行结果