每次spring boot启动时ElasticSearch健康检查失败 [英] ElasticSearch health check failed every time when spring boot start up

查看:49
本文介绍了每次spring boot启动时ElasticSearch健康检查失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Java 传输客户端库在 Spring boot 1.5.8.RELEASE 上使用 Elastic Search 5.5.0.

I am working with Elastic Search 5.5.0 on Spring boot 1.5.8.RELEASE using the Java Transport Client library.

Elastic Search 使用 docker 部署在容器中.它运作良好.来自我的 Java 应用程序的查询也运行良好.

The Elastic Search was deployed with docker in a container. It works well. The queries from my java application works well too.

问题是几乎每次从我的本地机器启动 Spring boot 时,Elasticsearch Health 检查都失败了,如以下异常所说.我没有在我的应用程序中明确调用任何健康检查.

The problem is that the Elasticsearch Health check failed almost every time when Spring boot started from my local machine as the following exception says. I didn't call any health check explicitly in my application.

如何取消每次启动时的健康检查或者有什么方法可以通过健康检查?

How can I remove the health check every time on start up or are there any way of passing the health check?

谢谢.

20180201 09:04:12.499 [restartedMain] INFO c.k.a.Application - Log info On 
20180201 09:04:12.499 [restartedMain] WARN c.k.a.Application - Log warn On 
20180201 09:04:12.499 [restartedMain] ERROR c.k.a.Application - Log error On 
20180201 09:04:15.628 [RMI TCP Connection(9)-10.10.20.187] WARN o.s.b.a.h.ElasticsearchHealthIndicator - Health check failed 
org.elasticsearch.ElasticsearchTimeoutException: java.util.concurrent.TimeoutException: Timeout waiting for task.
    at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:71)
    at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:58)
    at org.springframework.boot.actuate.health.ElasticsearchHealthIndicator.doHealthCheck(ElasticsearchHealthIndicator.java:52)
    at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:43)
    at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:68)
    at org.springframework.boot.actuate.endpoint.HealthEndpoint.invoke(HealthEndpoint.java:85)
    at org.springframework.boot.actuate.endpoint.HealthEndpoint.invoke(HealthEndpoint.java:35)
    at org.springframework.boot.actuate.endpoint.jmx.DataEndpointMBean.getData(DataEndpointMBean.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
    at sun.reflect.GeneratedMethodAccessor178.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
    at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1252)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1246)
    at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1085)
    at org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90)
    at javax.management.modelmbean.RequiredModelMBean.getAttribute(RequiredModelMBean.java:1562)
    at org.springframework.jmx.export.SpringModelMBean.getAttribute(SpringModelMBean.java:109)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:647)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1445)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
    at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:639)
    at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
    at sun.rmi.transport.Transport$1.run(Transport.java:200)
    at sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.TimeoutException: Timeout waiting for task.
    at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:232)
    at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:67)
    at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:69)
    ... 47 common frames omitted

推荐答案

您可以通过在 application.xml 文件中添加以下行来禁用 Elasticsearch 运行状况检查

You can disable the Elasticsearch health check by adding the following line to your application.xml file

management.health.elasticsearch.enabled: false

这篇关于每次spring boot启动时ElasticSearch健康检查失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆