【问题标题】:Fluentbit creates TCP connectionsFluentbit 创建 TCP 连接
【发布时间】:2021-07-05 11:23:07
【问题描述】:

Fluentbit 自己创建 TCP 连接?

这些是做什么用的?

fluent.conf 文件:

[SERVICE]
    Flush       5
    Daemon      Off
    Log_Level   debug
    
[INPUT]
    Name    tail
    Tag     format.logging
    path    C:\Logs\*main.log
    DB      C:\Logs\main_logs.db

[OUTPUT]
    Name    stdout
    Match   *

【问题讨论】:

    标签: windows fluent-bit


    【解决方案1】:

    这似乎归结为一个实现细节,它在 Linux 上使用 unix 套接字进行事件循环,但在 Windows 上它选择使用 localhost-connections。

    来自https://github.com/fluent/fluent-bit/blob/37aa680d32384c1179f02ee08a5bef4cd278513e/lib/monkey/mk_core/deps/libevent/include/event2/util.h#L380的评论

    /** Create two new sockets that are connected to each other.
        On Unix, this simply calls socketpair().  On Windows, it uses the
        loopback network interface on 127.0.0.1, and only
        AF_INET,SOCK_STREAM are supported.
        (This may fail on some Windows hosts where firewall software has cleverly
        decided to keep 127.0.0.1 from talking to itself.)
        Parameters and return values are as for socketpair()
    */
    

    实际实现在这里:https://github.com/fluent/fluent-bit/blob/37aa680d32384c1179f02ee08a5bef4cd278513e/lib/monkey/mk_core/deps/libevent/evutil.c#L207

    查看 netstat 输出时匹配模式:

    netstat -anop tcp | findstr <fluentbit pid>
      TCP    127.0.0.1:54645        127.0.0.1:54646        ESTABLISHED     12012  \
      TCP    127.0.0.1:54646        127.0.0.1:54645        ESTABLISHED     12012  ´` Pair
    
      TCP    127.0.0.1:54647        127.0.0.1:54648        ESTABLISHED     12012  \
      TCP    127.0.0.1:54648        127.0.0.1:54647        ESTABLISHED     12012  ´` Pair
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-11
      • 2010-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-20
      相关资源
      最近更新 更多