elasticsearch - 带有 Searchguard 的 EFK
问题描述
我已经安装了一个 EFK 堆栈来记录 nginx 访问日志。
在使用全新安装时,我能够毫无问题地将数据从 Fluentd 发送到 elasticsearch。但是,我安装了 searchguard 来实现对 elasticsearch 和 kibana 的身份验证。现在我可以使用 searchguards 演示用户凭据登录 Kibana 和 elasticsearch。
现在我的问题是fluentd无法连接到elasticsearch。从 td-agent 日志我收到以下消息:
2018-07-19 15:20:34 +0600 [warn]: #0 failed to flush the buffer. retry_time=5 next_retry_seconds=2018-07-19 15:20:34 +0600 chunk="57156af05dd7bbc43d0b1323fddb2cd0" error_class=Fluent::Plugin::ElasticsearchOutput::ConnectionFailure error="Can not reach Elasticsearch cluster ({:host=>\"<elasticsearch-ip>\", :port=>9200, :scheme=>\"http\", :user=>\"logstash\", :password=>\"obfuscated\"})!"
这是我的 Fluentd 配置
<source>
@type forward
</source>
<match user_count.**>
@type copy
<store>
@type elasticsearch
host https://<elasticsearch-ip>
port 9200
ssl_verify false
scheme https
user "logstash"
password "<logstash-password>"
index_name "custom_user_count"
include_tag_key true
tag_key "custom_user_count"
logstash_format true
logstash_prefix "custom_user_count"
type_name "custom_user_count"
utc_index false
<buffer>
flush_interval 2s
</buffer>
</store>
</match>
sg_roles.yml:
sg_logstash:
cluster:
- CLUSTER_MONITOR
- CLUSTER_COMPOSITE_OPS
- indices:admin/template/get
- indices:admin/template/put
indices:
'custom*':
'*':
- CRUD
- CREATE_INDEX
'logstash-*':
'*':
- CRUD
- CREATE_INDEX
'*beat*':
'*':
- CRUD
- CREATE_INDEX
谁可以帮我这个事?
解决方案
似乎 td-agent 使用 TLSv1 作为默认添加ssl_version TLSv1_2
到配置中,现在可以正常工作
推荐阅读
- javascript - 将JSON数据从Node中的URL存储到变量中?
- php - 在单独的线程中从 zval* 读取值 - PHP 扩展 c++
- python - PyQt5 QTableview 列调整大小
- python - Keras 中的图像序列处理 ConvLSTM 与 LSTM 架构
- go - Go 供应商构建工具
- android - Google App Signing - 仍然可以上传使用旧 Keystore 签名的 Apk
- java - 找不到存储数据的正确方法
- java - ProcessBuilder 产生严重的声纳漏洞
- c++ - How do I regenerate the packages directory for a Visual Studio C++ project?
- sql - SQL将重复记录合并到一行