将 Fluentd 作为日志聚合器进行故障排除:连接问题

问题描述 投票:0回答:1

我在将 API 日志从一台 Fluentd 服务器发送到另一台服务器,然后发送到 Elasticsearch 时遇到问题。什么时候 !尝试将日志直接从一台 Fluentd 服务器发送到 Elasticsearch,效果很好。现在,我怀疑连接可能有问题。但是,两个 Fluentd 服务器都设置为跨所有接口侦听 UDP 和 TCP 上的日志。我该如何解决这个问题?

Fluentd 服务器 1 配置

<source>
  @type tail
  @id input_log
  <parse>
    @type json
  </parse>
  path /home/ubuntu/OT-attendance/access.log
  tag api.log
  read_from_head true
</source>

<match api.log>
  @type forward
  @id output_system_forward
  <server>
    host 18.212.132.77
    port 24225
  </server>
</match>

Fluentd Server 2 配置

<match api.log>
  @type elasticsearch
  host localhost
  port 9200
  index_name fluentd.${tag} 
</match>
elasticsearch logging kibana fluentd efk
1个回答
0
投票

这里有一些建议可以解决您的问题。

  1. 如果可能,删除其中一个 fluidd,并将日志直接发送到 Elasticsearch。额外的环将导致更多的延迟和问题。

  2. Directly sending data from Fluentd server to Elasticsearch working fine
    。每当有多个箍时,您应该一一测试。在您的数据流中,架构如下所示。

    Fluentd => Fluentd => Elasticsearch

    为了调试,您可以从输出中删除 Elasticsearch 添加 stdout 并在终端中检查结果。如果看不到任何结果,则说明 Fluentd 之间存在问题。这样,您就可以解决您的问题。

© www.soinside.com 2019 - 2024. All rights reserved.