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

版本: 6.8-6.8

简而言之,当 Elasticsearch 无法定位指定的主机时,就会发生此错误。这可能是由于配置设置不正确、网络问题或主机宕机造成的。要解决此问题,您可以检查主机的可用性和网络连接。确保在 Elasticsearch 配置中正确指定了主机名。如果主机是集群的一部分,请验证其在集群中的状态和连接性。此外,还要检查防火墙设置,确保它们没有阻止连接。

日志上下文 #

日志 “could not find host {}” 的类名是 IndexAuditTrail.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

.put(theClientSetting).build();
Settings.EMPTY;
remoteTransportClientPlugins();
null) {};
for (Tuple<Supplier<TransportAddress>, String> pair : hostPortPairs) {
    try {
        transportClient.addTransportAddress(new TransportAddress(InetAddress.getByName(pair.v1()), pair.v2()));
    } catch (UnknownHostException e) {
        throw new ElasticsearchException("could not find host {}", e, pair.v1());
    }
}
logger.info("forwarding audit events to remote cluster [{}] using hosts [{}]",
    clientSettings.get("cluster.name", ""), hostPortPairs.toString());