我已经安装了一个 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
谁可以帮我这个事?