首页 > 解决方案 > fluentd 无法连接到 elasticsearch SSL_connect 返回=1 errno=0 state=error: 错误的版本号 (OpenSSL::SSL::SSLError)

问题描述

我正在尝试在 Ubuntu 18.04(aws lightail)上安装 fluentd,以便将 nginx、uwsgi 日志发送到 elasticsearch(弹性云)。但是,我在下面不断收到同样的错误。

    2019-10-18 14:55:35 +0900 [info]: starting fluentd-1.7.3 pid=29978 ruby="2.5.1"
    2019-10-18 14:55:35 +0900 [info]: spawn command to main:  cmdline=["/usr/bin/ruby2.5", "-Eascii-8bit:ascii-8bit", "/usr/local/bin/fluentd", "-c", "fluent.conf", "--under-supervisor"]
    2019-10-18 14:55:36 +0900 [info]: gem 'fluent-plugin-elasticsearch' version '3.5.5'
    2019-10-18 14:55:36 +0900 [info]: gem 'fluentd' version '1.7.3'
    2019-10-18 14:55:36 +0900 [info]: adding match pattern="**" type="elasticsearch"
    2019-10-18 14:55:38 +0900 [warn]: #0 Could not communicate to Elasticsearch, resetting connection and trying again. SSL_connect returned=1 errno=0 state=error: wrong version number (OpenSSL::SSL::SSLError)

Fluentd 配置文件:

    cat fluent.conf 
    <source>
      @type tail
      path /home/kycho/fluentd/log/uwsgi.log
      pos_file /home/kycho/fluentd/log/fluentd/uwsgi.log.pos
      tag uwsgi.log
      format nginx
    </source>

    <match **>
      @type elasticsearch
      logstash_format true
      host 4e03bxxxxxxxxxxxxxxxxxxxx.ap-northeast-1.aws.found.io
      port: 9243
      username: elastic
      password: xxxxxxxxxxxxxxxxxxxx
      scheme https
      ssl_version TLSv1_2
      index_name nginx-fluentd
      type_name  nginx-fluentd
    </match>

流利版:

        fluentd 1.7.3
        openssl version
        OpenSSL 1.1.1  11 Sep 2018

当我更改 ssl_version TLSv1_3 时,出现以下错误。所以,我尝试了所有选项(SSLv23、TLSv1、TLSv1_1、TLSv1_2),结果都是一样的。

    fluentd -c fluent.conf 
    2019-10-18 14:47:23 +0900 [info]: parsing config file is succeeded path="fluent.conf"
    2019-10-18 14:47:23 +0900 [error]: config error file="fluent.conf" error_class=Fluent::ConfigError error="valid options are SSLv23,TLSv1,TLSv1_1,TLSv1_2 but got TLSv1_3

我已经尝试过使用 td-agent,但遇到了同样的错误。openssl 1.1.1 是否与 tlsv1.2 不兼容...?

标签: amazon-web-servicesopensslubuntu-18.04fluentd

解决方案


推荐阅读