4

我有一个简单的 Fluentd-Elasticsearch-Kibana 设置,它的行为非常奇怪。Fluentd 似乎在 3 小时后停止向弹性搜索发送信息。

我在一个简单的 docker-compose 文件中运行所有内容

version: '2'
services:

fluentd:
  build: ./fluentd
  volumes:
    - ./fluentd/conf:/fluentd/etc
  links:
    - "elasticsearch"
  ports:
    - "24225:24225"
    - "24225:24225/udp"

elasticsearch:
  image: elasticsearch
  expose:
    - 9200
  ports:
    - "9200:9200"

kibana:
  image: kibana
  links:
    - "elasticsearch"
  ports:
    - "5601:5601"

Fluentd 是按照这个 dockerfile 构建的

# fluentd/Dockerfile
FROM fluent/fluentd:v0.12-debian
RUN ["gem", "install", "fluent-plugin-elasticsearch", "--no-rdoc", "--no-ri", "--version", "1.9.2"]

它有以下conf文件:

<source>
  @type forward
  port 24225
  bind 0.0.0.0
</source>
<match *.**>
  @type copy
  <store>
    @type elasticsearch
    host elasticsearch
    port 9200
    logstash_format true
    logstash_prefix fluentd
    logstash_dateformat %Y%m%d
    include_tag_key true
    type_name access_log
    tag_key @log_name
    flush_interval 1s
  </store>
  <store>
    @type stdout
  </store>
</match>

所有这些都在云中运行,当然,在同一台机器上。从其他机器/实例,我发送我的日志,Fluentd 确实收到了这些日志,没有任何问题。问题是每 3 小时后,Fluentd 突然停止将这些日志转发到我的 Elasticsearch。没有错误信息,什么都没有。如果我确实重新启动了 Fluentd 容器,那么接下来的 3 小时内一切正常。

我寻找这种行为,但找不到任何解释或与这种情况接近的人。有一个人遇到了类似这个问题,但最后,它与 Elasticsearch 有关,而不是 Fluentd ......

4

0 回答 0