【问题标题】:data loss while sending from fluentd to aws kinesis firehose从 fluentd 发送到 aws kinesis firehose 时数据丢失
【发布时间】:2021-09-27 22:00:42
【问题描述】:

我们正在使用 fluentd 将日志发送到 aws kinesis firehose。我们可以看到很少有记录不时发送到 aws kinesis firehose。 这是我们在fluentd中的设置。

    <system>
          log_level info
      </system>
      <source>
          @type tail
          path "/var/log/app/tracy.log*"
          pos_file "/var/tmp/tracy.log.pos"
          pos_file_compaction_interval 72h
          @log_level "error"
          tag "tracylog"
          <parse>
                @type "json"
                time_key False
          </parse>
      </source>
      <source>
         @type monitor_agent
         bind 127.0.0.1
         port 24220
      </source>
      <match tracylog>
          @type "kinesis_firehose"
          region "${awsRegion}"
          delivery_stream_name "${delivery_stream_name}"
          <instance_profile_credentials>
          </instance_profile_credentials>
          <buffer>
              # Frequency of ingestion
              flush_interval 30s
              flush_thread_count 4
              chunk_limit_size 1m
          </buffer>
      </match>

【问题讨论】:

  • 你检查过那些缺失记录的创建时间吗?我也面临类似的问题,如果我有并发数据点,则只有其中 1 个被传送到目的地。这也是你的情况吗?
  • 嗨丽娜,我已经通过更新我的配置文件解决了这个问题。我的情况有两个根本原因 1 。刷新间隔非常高,块大小很小,因此队列中有很多块要刷新 2。与流利的进程相比,我的应用程序启动时间非常快,所以每当缩放事件触发时,很少有初始记录丢失。

标签: fluentd amazon-kinesis-firehose td-agent


【解决方案1】:

配置中的一些更改解决了我的问题:

  <system>
      log_level info
  </system>
  <source>
      @type tail
      path "/var/log/app/tracy.log*"
      pos_file "/var/tmp/tracy.log.pos"
      pos_file_compaction_interval 72h
      read_from_head true
      follow_inodes true
      @log_level "error"
      tag "tracylog"
      <parse>
            @type "json"
            time_key False
      </parse>
  </source>
  <source>
     @type monitor_agent
     bind 127.0.0.1
     port 24220
  </source>
  <match tracylog>
      @type "kinesis_firehose"
      region "${awsRegion}"
      delivery_stream_name "${delivery_stream_name}"

      <instance_profile_credentials>
      </instance_profile_credentials>
      <buffer>
        flush_interval 2
        flush_thread_interval 0.1
        flush_thread_burst_interval 0.01
        flush_thread_count 8
      </buffer>

【讨论】:

    猜你喜欢
    • 2016-11-13
    • 2017-08-25
    • 2016-11-05
    • 2020-10-02
    • 2020-10-01
    • 2019-09-29
    • 2017-05-24
    • 1970-01-01
    • 2022-06-11
    相关资源
    最近更新 更多