[iconverse-admin-0] 2019-02-27 14:22:20.914 WARN 1 --- [nio-8080-exec-8] s.b.a.e.ElasticsearchRestHealthIndicator : Elasticsearch health check failed
[iconverse-admin-0]
[iconverse-admin-0] java.net.ConnectException: Connection refused
[iconverse-admin-0] at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:943)
[iconverse-admin-0] at org.elasticsearch.client.RestClient.performRequest(RestClient.java:227)
[iconverse-admin-0] at org.springframework.boot.actuate.elasticsearch.ElasticsearchRestHealthIndicator.doHealthCheck(ElasticsearchRestHealthIndicator.java:61)
[iconverse-admin-0] at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:84)
[iconverse-admin-0] at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:98)
[iconverse-admin-0] at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:50)
[iconverse-admin-0] at org.springframework.boot.actuate.health.HealthEndpointWebExtension.health(HealthEndpointWebExtension.java:54)
[iconverse-admin-0] at jdk.internal.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
[iconverse-admin-0] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[iconverse-admin-0] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[iconverse-admin-0] at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:246)
[iconverse-admin-0] at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:76)
[iconverse-admin-0] at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:61)
[iconverse-admin-0] at org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$ServletWebOperationAdapter.handle(AbstractWebMvcEndpointHandlerMapping.java:294)
[iconverse-admin-0] at org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(AbstractWebMvcEndpointHandlerMapping.java:355)
[iconverse-admin-0] at jdk.internal.reflect.GeneratedMethodAccessor357.invoke(Unknown Source)
[iconverse-admin-0] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[iconverse-admin-0] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[iconverse-admin-0] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
[iconverse-admin-0] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
[iconverse-admin-0] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
[iconverse-admin-0] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
[iconverse-admin-0] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
[iconverse-admin-0] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
[iconverse-admin-0] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
[iconverse-admin-0] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
[iconverse-admin-0] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
[iconverse-admin-0] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
[iconverse-admin-0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
[iconverse-admin-0] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
[iconverse-admin-0] at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:112)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
[iconverse-admin-0] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
[iconverse-admin-0] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at com.taiger.admin.security.jwt.JWTFilter.doFilter(JWTFilter.java:43)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:121)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
[iconverse-admin-0] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
[iconverse-admin-0] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
[iconverse-admin-0] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:130)
[iconverse-admin-0] at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66)
[iconverse-admin-0] at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:105)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117)
[iconverse-admin-0] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
[iconverse-admin-0] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at com.taiger.admin.web.filter.SimpleCORSFilter.doFilter(SimpleCORSFilter.java:53)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[iconverse-admin-0] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[iconverse-admin-0] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)
[iconverse-admin-0] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
[iconverse-admin-0] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
[iconverse-admin-0] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
[iconverse-admin-0] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
[iconverse-admin-0] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
[iconverse-admin-0] at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679)
[iconverse-admin-0] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
[iconverse-admin-0] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
[iconverse-admin-0] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
[iconverse-admin-0] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
[iconverse-admin-0] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
[iconverse-admin-0] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
[iconverse-admin-0] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
[iconverse-admin-0] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[iconverse-admin-0] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[iconverse-admin-0] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
[iconverse-admin-0] at java.base/java.lang.Thread.run(Thread.java:834)
[iconverse-admin-0] Caused by: java.net.ConnectException: Connection refused
[iconverse-admin-0] at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[iconverse-admin-0] at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779)
[iconverse-admin-0] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:171)
[iconverse-admin-0] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:145)
[iconverse-admin-0] at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
[iconverse-admin-0] at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
[iconverse-admin-0] at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
[iconverse-admin-0] ... 1 common frames omitted
Comment From: wilkinsona
This looks a lot like #16007. How have you configured the nodes to which the Elasticsearch client will connect?
Comment From: khteh
I configure my AWS ALB target group periodic healthcheck to /myapp/actuator/health and that cascades down to Elasticsearch which fails.
Comment From: wilkinsona
Thanks for the response. Unfortunately that doesn't answer the question that I tried to ask.
How is your application using Elasticsearch? How have you configured the client(s) that it uses to connect to the Elasticsearch nodes? From the stack trace, I can tell that there's a org.elasticsearch.client.RestClient
bean that is configured with a host and port that is not accepting connections. That tells me that something is misconfigured but I can't tell what from a stack trace alone.
Comment From: khteh
I use these maven dependencies:
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.6.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.6.0</version>
</dependency>
Comment From: khteh
My application has no issue at all accessing the Elasticsearch. I don't know why the /health endpoint fails. It's not programmatic but HTTP calls from the AWS ALB. I don't configure anything for the ES healthcheck endpoint.
Comment From: khteh
When I configure management.elasticsearch.enabled = false, everything works as usual. However, it's good to have actuator check the ES since it is a critical component of my application.
Comment From: wilkinsona
How have you configured it to access Elasticsearch? Have you configured it using the spring.data.elasticsearch.cluster-nodes
property or by defining your own client beans?
Comment From: khteh
I have this in my application.yml:
data:
elasticsearch:
cluster-name:
cluster-nodes: localhost:9300
Comment From: khteh
I fix that to svc-elasticsearch:9300
but to no avail. Inside my ES pod this is what I get:
$ k exec -it iconverse-elasticsearch-0 -- bash
root@iconverse-elasticsearch-0:/# curl svc-elasticsearch:9300
This is not an HTTP portroot@iconverse-elasticsearch-0:/#
root@iconverse-elasticsearch-0:/#
Comment From: wilkinsona
It looks like the RestClient
bean in your application is not picking up the configuration in application.yml. If curl is receiving This is not an HTTP port
then it is managing to connect but svc-elasticsearch:9300
is using Elasticsearch's TCP transport. The RestClient
being used by the health indicator is having its connection attempt refused so it cannot be using the same hostname and port.
Is the YAML that you shared truncated? It should have a spring:
key:
spring:
data:
elasticsearch:
cluster-name:
cluster-nodes: svc-elasticsearch:9300
That configuration should result in a RestClient
bean that will connect to svc-elasticsearch:9300
unless you have defined your own RestClient
bean in which case the auto-configured RestClient
will back off. The condition evaluation report, available from the Actuator or logged at startup when you start with --debug
, will show you what's happening there.
If there's no user-configured bean involved and you're relying solely on the auto-configuration, we'll need to do something more to determine why the auto-configured RestClient
is, apparently, not using the correct host and/or port to connect to Elasticsearch. One way to do that would be for you to use the debugger and verify the settings that the RestClient
is using. If you would like us to try and do this diagnosis for you, we'll need a complete and minimal application that reproduces the behaviour you have described.
Comment From: khteh
Which port should this health endpoint use? 9200 or 9300?
Comment From: khteh
Yes, my YAML is correct. it is child element of spring
Comment From: wilkinsona
The HealthIndicator
uses a RestClient
to check Elasticsearch’s health. It should use the HTTP port which is 9200 by default.
If you would like us to continue to spend time trying to help you, please take the time to provide the information that I asked for above:
If there's no user-configured bean involved and you're relying solely on the auto-configuration, we'll need to do something more to determine why the auto-configured RestClient is, apparently, not using the correct host and/or port to connect to Elasticsearch. One way to do that would be for you to use the debugger and verify the settings that the RestClient is using. If you would like us to try and do this diagnosis for you, we'll need a complete and minimal application that reproduces the behaviour you have described.
Comment From: khteh
Just grep through the source code. Yes we created a @Service:
@Service
public class ESService {
@Value("${iconverse.elasticsearch.host}")
private String elasticsearchHost;
@Value("${iconverse.elasticsearch.port}")
private int elasticsearchPort;
@PostConstruct
public void init() throws UnknownHostException, NodeValidationException {
client = new RestHighLevelClient(
RestClient.builder(new HttpHost(elasticsearchHost, elasticsearchPort, HttpHost.DEFAULT_SCHEME_NAME)));
}
}
Comment From: wilkinsona
Thanks. The client created there is not being exposed as a bean so it will not be used by the health indicator. Instead, the health indicator will be using the auto-configured RestClient. This, I believe, is why the health indicator can not connect but your own application code can connect.
You may want to define your own RestClient
bean configured using your iconverse.elasticsearch.host
and iconverse.elasticsearch.port
properties and inject it into your service. This will cause the auto-configured bean to back off.
Alternatively, you may want to remove the creation of your own RestClient
and inject the auto-configured one instead. In this case you'd need to update the spring.data.elasticsearch.cluster-nodes
property to use the host and port that your manually created client is currently using.
I’m now pretty much certain that this is a configuration problem so I am going to close this issue. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Hopefully the above will provide the help you need to get things working. If not, please follow up on Gitter or Stack Overflow.
Comment From: khteh
How to inject the auto-configured restclient?
I have this @Configuration bean:
@Configuration
public class ElasticSearchConfiguration {
@Value("${iconverse.elasticsearch.host}")
private String elasticsearchHost;
@Value("${iconverse.elasticsearch.port}")
private int elasticsearchPort;
@Bean
public RestHighLevelClient restHighLevelClient() {
return new RestHighLevelClient(RestClient.builder(new HttpHost(elasticsearchHost, elasticsearchPort, HttpHost.DEFAULT_SCHEME_NAME)));
}
}
and @Autowired it in my @Service:
@Autowired
private RestHighLevelClient client;
but to no avail. The exception persists.
Comment From: wilkinsona
You have exposed a RestHighLevelClient
as a bean. The health indicator needs a RestClient
so that's what needs to be exposed as a bean. Boot's auto-configuration achieves this by exposing the RestClientBuilder
as a bean and then using that to create the RestClient
and RestHighLevelClient
beans.
Unfortunately, I don't have any more time to spend on this so I won't be able to respond again to this issue. If you need further guidance, please respect our guidelines for contributing and follow up on Stack Overflow or Gitter.
Comment From: wakedeer
@khteh Healthcheck is enabled by default. Elasticsearch check is auto-configured. But this verification is performed via Elasticsearch Rest Client API and you must override property spring.elasticsearch.rest.uris
spring.elasticsearch.rest.uris=your-host:9200