【问题标题】:aws fargate and firelens with fluentbit, ES output plugin TCP connection failed randomly带有fluentbit的aws fargate和firelens,ES输出插件TCP连接随机失败
【发布时间】:2023-03-12 15:38:01
【问题描述】:

我正在运行带有 Firelens 和自定义 Fluentbit 配置(附在下面)的 Fargate 类型的 AWS ECS 任务。

虽然我可以成功运行,但当我重新部署任务(通过增加任务数量等来更新 ECS 服务)时,经常有任务无法通过 TCP 到 Elasticsearch 并显示下面的 fluentbit 错误消息

[error] [io] TCP connection failed: 199.12.31.400:9200 (Connection timed out)

我什至不知道如何解决这个问题......任何人都可以分享我一些想法吗?猜测 AWS 切换网络时出现问题 w.e ...?

ECS 服务上的公共 IP 已启用。

我使用的 Elasticsearch IP 地址是与 ECS 服务在同一 VPC 中的私有 IP 地址。

Elasticsearch 部署在 EC2 中,而不是托管服务中。

[SERVICE]
    Parsers_File /fluent-bit/parsers/parsers.conf
    Flush 1
    Grace 30
    Log_Level debug

[FILTER]
    Name         parser
    Match        *
    Key_Name     log
    Parser       json
    Reserve_Data True

[FILTER]
    Name modify
    Match *
    Remove container_id
    Remove container_name
    Remove container_name
    Remove ecs_cluster
    Remove ecs_task_arn
    Remove source

[OUTPUT]
    Name   stdout
    Match  *

[OUTPUT]
    Name            es
    Match           *
    Host            199.12.31.400
    Port            9200
    Logstash_Format On
    Logstash_Prefix logstash
    Trace_Output    On
    Type            _doc

【问题讨论】:

  • 你在使用托管弹性搜索吗?
  • 不,我不是,在 ec2 中运行自己的 es
  • ec2 安全组允许访问端口 9200 上的 vpc cidr?
  • 是的,它已配置
  • 我怀疑firelens容器是否包含elasticsearch插件,即使firelens示例页面也没有elasticsearch示例...github.com/aws-samples/amazon-ecs-firelens-examples

标签: amazon-web-services aws-fargate fluent-bit


【解决方案1】:

最后,是 CIDR 过滤问题...感谢@kathikeayan 让我仔细检查。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-10
    • 2013-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多