【问题标题】:Could not push logs to Elasticsearch cluster - ELK Stack无法将日志推送到 Elasticsearch 集群 - ELK 堆栈内存溢出
【发布时间】:2022-06-28 20:54:14
【问题描述】:

我正在尝试使用 FluentD 部署 ELK Stack,现在面临从 FluentD 容器到 Elastic 的连接问题。请在下面找到详细信息

问题:

logs to Elasticsearch cluster ({:host=>\"localhost\", :port=>9200, :scheme=>\"https\", :user=>\"elastic\", :password=>\"obfuscated\"}): Connection refused - connect(2) for 127.0.0.1:9200 (Errno::ECONNREFUSED)"
  2022-06-28 12:21:24 +0000 [warn]: #0 suppressed same stacktrace

Docker 文件:

RUN gem install fluent-plugin-elasticsearch
RUN gem install fluent-plugin-rewrite-tag-filter
RUN gem install fluent-plugin-multi-format-parser

fluent.conf

  @type http
  port 9880
  bind 0.0.0.0
  body_size_limit 32m
  keepalive_timeout 10s
</source>


<match **>
        @type elasticsearch
        @log_level info
        include_tag_key true
        host localhost
        port 9200
        user elastic
        password WMvbcuMfTlSg_PDVInyZ
        ssl_verify false
        ssl_version TLSv1_2
        # ca_file /fluentd/etc/http_ca.crt
        # client_cert /fluentd/etc/http_ca.crt
        logstash_format true
        scheme https
        verify_es_version_at_startup false
        # default_elasticsearch_version 7
        request_timeout 59s
        # request_timeout 2147483648
        reload_connections false
        reconnect_on_error true
        reload_on_failure true
        with_transporter_log true
        <buffer>
         flush_interval 10s
        </buffer>
  </match>

构建图像:

 docker build -t fluentd-app 

运行容器:

docker run --name fluentd1 --net elastic -p 9880:9880 -d -v E:\fluentd_image\fluentd\conf:/fluentd/etc  fluentd-app

【问题讨论】:

    标签: docker elasticsearch fluentd


    【解决方案1】:

    ERRCONNREFUSED ,表示以下之一:

    1. ES 服务器已关闭。
    2. 由于防火墙问题,无法访问 ES 服务器。
    3. 您使用的是 https,因此必须配置您的 SSL 证书并将它们放在相关文件夹中。
    4. 您已绑定到 0.0.0.0,但 elasticsearch 广播不同。

    请检查相同的内容,看看它是否解决了问题。如果它解决了您的问题,请记住将此答案标记为正确。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-29
      • 2020-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多