首页 > 解决方案 > 连接到elasticsearch集群时docker ELK stack的Search-guard插件出现问题

问题描述

几分钟前,我search guard branch 从这里克隆,我想尽一切办法README

docker-compose up -d所有服务正常运行后,elasticsearch_1每隔几秒记录一个错误:

弹性搜索_1 | [2018-09-14T08:59:49,614][ERROR][cfsaBackendRegistry] 尚未初始化(您可能需要运行 sgadmin)

之后我运行docker-compose exec -T elasticsearch bin/init_sg.sh,输出:

Search Guard Admin v6
Will connect to localhost:9300 ... done
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/usr/share/elasticsearch/plugins/search-guard-6/netty-common-4.1.16.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Elasticsearch Version: 6.3.2
Search Guard Version: 6.3.2-23.0
Connected as CN=kirk,OU=client,O=client,L=Test,C=DE
Contacting elasticsearch cluster 'elasticsearch' and wait for YELLOW clusterstate ...
    ERR: Timed out while waiting for a green or yellow cluster state.
    * Try running sgadmin.sh with -icl (but no -cl) and -nhnv (If that works you need to check your clustername as well as hostnames in your TLS certificates)
    * Make also sure that your keystore or PEM certificate is a client certificate (not a node certificate) and configured properly in elasticsearch.yml
    * If this is not working, try running sgadmin.sh with --diagnose and see diagnose trace log file)
    * Add --accept-red-cluster to allow sgadmin to operate on a red cluster.

我猜想 sgadmin 无法连接到 elasticsearch 集群,但我确实按照自述文件所说的那样做。

任何建议如何解决这个问题?感谢您的回答。

标签: elasticsearchelastic-stackelasticsearch-plugin

解决方案


我已经解决了这个问题。你的产品,工作得很好。我的索引 win Kibana 有错误,它使elasticsearch cluster红色状态 - 从不黄色。

如果你想在不等待黄色状态的情况下连接你sgadmin的使用 line:在脚本中:elasticsearch cluster--accept-red-clusterinit_sg.sh

#!/bin/sh
plugins/search-guard-6/tools/sgadmin.sh \
    -cd config/sg/ \
    -ts config/sg/truststore.jks \
    -ks config/sg/kirk-keystore.jks \
    -nhnv \
    -icl \
    --accept-red-cluster

然后一切正常,Kibana 会告诉你为什么你有 RED 状态——在我的例子中是 kibana 索引问题。


推荐阅读