版本: 7-7.15
简而言之,当您尝试连接的Elasticsearch节点未包含在Elasticsearch设置的允许主机列表(白名单)中时,会出现此错误。这是防止未经授权访问的安全措施。要解决此问题,您可以将主机添加到Elasticsearch设置的白名单中,或者如果不需要则禁用白名单检查。但是,禁用白名单检查可能会使您的Elasticsearch面临潜在的安全风险。始终确保您的Elasticsearch得到适当的安全保护。
日志上下文 #
日志 “host [” + host + “] is not whitelisted in setting [” 类名称是 HttpClient.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人使用:
HttpContext context) throws ProtocolException {
boolean isRedirected = super.isRedirected(request; response; context);
if (isRedirected) {
String host = response.getHeaders("Location")[0].getValue();
if (isWhitelisted(host) == false) {
throw new ElasticsearchException("host [" + host + "] is not whitelisted in setting [" +
HttpSettings.HOSTS_WHITELIST.getKey() + "]; will not redirect");
}
}
return isRedirected;





