Elasticsearch health check failed

org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator Elasticsearch health check failed
org.elasticsearch.ElasticsearchTimeoutException: java.util.concurrent.TimeoutException: Timeout waiting for task.


[2020-07-09T10:07:14,880][WARN ][o.e.t.TcpTransport ] [5R8mlw9] exception caught on transport layer [Netty4TcpChannel{localAddress=/172.16.13.81:9300, remoteAddress=/172.16.13.93:52765}], closing connection
java.io.IOException: 杩滅▼涓绘満寮鸿揩鍏抽棴浜嗕竴涓幇鏈夌殑杩炴帴銆?


IDEA 中安装 Maven Helper 插件以解决 Elasticsearch 相关包的版本冲突。

这里发现有一个 HdrHistogram 包的版本和 Elasticsearch 依赖中的版本不一致。

在有冲突的依赖里面添加如下 <exclusions> 标签内容。

<exclusions>
    <exclusion>
        <artifactId>HdrHistogram</artifactId>
        <groupId>org.hdrhistogram</groupId>
    </exclusion>
</exclusions>
  

2020/07/16 追记

还是偶尔会有这个错误日志。 参考 这篇文章 调整了 Elasticsearch 的响应过期时间。

management:
  health:
    elasticsearch:
      response-timeout: 500