DEBUG.WIKI
ZgoCloud:多地区部署,按需选节点;日本、美国、香港、德国
V.PS:让项目靠近用户,亚太、欧洲、北美 KVM VPS
晚安云;香港 CN2 ¥15/月

解决 Fluent Bit 报错 ES output connection timed out 故障

分析 Fluent Bit 向 ES 推送日志报 connection timed out 根因,详解 net.connect_timeout、网络丢包与集群负载调优方案。

问题现象

Fluent Bit 日志积压,运行日志中输出超时错误:

[warn] [output:es:es.0] error sending records to 10.96.10.20:9200 (connection timed out)
[warn] [engine] failed to flush chunk, retrying in 10 seconds

触发根因

  1. Elasticsearch 节点在高负载下无法在默认连接超时内完成握手。

诊断排查步骤

  1. 检查 ES 集群的健康度与负载:
curl -s http://10.96.10.20:9200/_cluster/health

解决步骤与操作命令

步骤一:在 Fluent Bit Output 中调优网络超时参数

[OUTPUT]
    Name                es
    Match               *
    Host                10.96.10.20
    Port                9200
    net.connect_timeout 30
    net.keepalive       on
    Retry_Limit         10

验证方法

重启 Fluent Bit:

systemctl restart fluent-bit

批次数据毫秒级完成 flush,日志顺畅同步至 ES。