amazon-web-services - 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 不兼容...?
解决方案
推荐阅读
- c# - 玩家在 collider2D 之外死亡
- python-3.x - 类型错误:^ 不支持的操作数类型:'float' 和 'int'
- algorithm - 通过查找表旋转 90 度?
- sql - 用另一个表中的列值替换列的空值
- python - 有没有办法在中央数据库中编译/保存来自多个用户使用的 excel 应用程序的数据?
- python - ValueError:长度不匹配:预期轴有 0 个元素,新值有 1 个元素
- c# - 如何使用现有 SQL Server 数据库(Azure Data Studio)将 ASP.NET Web 应用程序部署到 Azure
- android - 任务“:app:mergeDebugResources”的Android Studio 执行失败。并且无法建立一些目录
- sorting - 如何在句号后对字符进行排序
- python-3.x - 使用 datetime 执行 timedelta 函数,打印 24 小时内的总秒数