【问题标题】:Spring Actuator Status Down Due to Solr Dependency由于 Solr 依赖,Spring 执行器状态关闭
【发布时间】:2016-10-31 18:08:53
【问题描述】:

当我想检查具有 Spring Boot Actuator 的应用程序的运行状况指标时,我可以看到该结果:

{
  "status": "UP",
  "diskSpace": {
    "status": "UP",
    "total": 299055067136,
    "free": 246445404160,
    "threshold": 10485760
  }
}

我还可以看到/metrics 结果。我想从另一个 Spring 应用程序中获取此类信息。这适用于/metrics

restTemplate.getForObject(metricsPath, HashMap.class);

当我为了健康而尝试时:

restTemplate.getForObject(healthPath, String.class);

我收到一般的503 错误。我已经调试了系统并意识到 Spring 由于我的 Solr 依赖项而引发错误。它尝试向127.0.0.1发出ping请求

我的问题:

1) 当我不使用restTemplate 时它是如何工作的?

2) 我怎样才能指出SolrHealthIndicatorSolr 路径是什么?

PS:我可以验证问题与 Solr 有关,因为当我添加时:

management:
  health:
    solr:
      enabled:  false

我可以看到StatusUPrestTemplate

【问题讨论】:

    标签: java spring spring-boot spring-boot-actuator


    【解决方案1】:

    这是 spring 将 Solr 4 移动到 Solr 5 时的错误。 查看更新here

    【讨论】:

      猜你喜欢
      • 2020-02-24
      • 1970-01-01
      • 2017-06-07
      • 1970-01-01
      • 2021-08-04
      • 1970-01-01
      • 1970-01-01
      • 2021-12-28
      • 2022-08-20
      相关资源
      最近更新 更多