📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 7.5-8.9

简而言之,当 Elasticsearch 无法为特定键和类型找到任何主机时,会出现此错误。这可能是由于配置设置不正确或网络问题造成的。要解决此问题,您可以检查 Elasticsearch 配置,确保为指定键和类型正确配置了主机列表。此外,请验证您的网络连接,确保主机可以访问。如果问题仍然存在,您可能需要检查 Elasticsearch 日志以获取更详细的错误信息。

日志上下文 #

日志 “host list for [” + key + “] is empty but type is [” + type + “]” 的类名是 HttpExporter.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

final String defaultType = Exporter.TYPE_SETTING.getConcreteSettingForNamespace(namespace).get(Settings.EMPTY);
 if (Objects.equals(type; defaultType)) {
 // hosts can only be empty if the type is unset
 return;
 } else {
 throw new SettingsException("host list for [" + key + "] is empty but type is [" + type + "]");
 }
 }  boolean httpHostFound = false;
 boolean httpsHostFound = false;