You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

集成Micrometer到ElasticSearch应用时遇TimeoutException问题求助

Fixing Elasticsearch TimeoutException After Adding Prometheus Monitoring Dependencies

Hey there, let's break down why you're hitting this timeout issue and how to fix it!

What's Causing the Problem?

When you add the spring-boot-starter-actuator dependency, Spring Boot automatically enables the ElasticsearchHealthIndicator by default. This component runs a health check against your Elasticsearch cluster on application startup—if the cluster doesn't respond within the default (short) timeout window, you'll get that TimeoutException you're seeing.

Solutions to Try

1. Extend the Elasticsearch Health Check Timeout

If you want to keep the health check but give your cluster more time to respond, adjust the timeout in your application configuration:

For application.properties:

management.health.elasticsearch.timeout=10s

For application.yml:

management:
  health:
    elasticsearch:
      timeout: 10s

Tweak the value (e.g., 15s) based on how long your cluster typically takes to respond.

2. Disable Elasticsearch Health Check (If Unneeded)

If monitoring Elasticsearch's health isn't a requirement for your use case, you can turn off the indicator entirely:

For application.properties:

management.health.elasticsearch.enabled=false

For application.yml:

management:
  health:
    elasticsearch:
      enabled: false

3. Verify Cluster Reachability

Double-check that your Spring Boot app can actually connect to your Elasticsearch cluster:

  • Confirm the Elasticsearch cluster is up and running
  • Ensure no network firewalls or security groups are blocking traffic between your app and the cluster
  • Validate your Elasticsearch configuration in the app (hosts, ports, authentication details if used)

内容的提问来源于stack exchange,提问作者Damitha Dayananda

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 07:01:38