【发布时间】:2018-03-15 12:28:35
【问题描述】:
我在我的 Spring Boot 应用程序中使用 enter link description here 的 Jest。
然后我用示例代码创建了客户端:
JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder("http://myhost:9200")
.multiThreaded(true)
JestClient client = factory.getObject();
一切都很好。我可以使用这个客户端来做我想要的所有查询。快乐到现在。
那么问题来了,当应用程序启动时,ElasticsearchJestHealthIndicator 类是自动初始化的。但问题是我不知道在哪里设置它需要的配置,所以它使用默认值 http://localhost:9200,这导致我遇到这个问题:
WARN [on(2)-127.0.0.1] s.b.a.h.ElasticsearchJestHealthIndicator : 健康检查失败 io.searchbox.client.config.exception.CouldNotConnectException:无法连接到 http://localhost:9200 在 io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:70) 在 io.searchbox.client.http.JestHttpClient.execute(JestHttpClient.java:60)
谁能告诉我如何正确配置或关闭它?
【问题讨论】:
标签: spring-boot elasticsearch elasticsearch-jest