首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法访问/actuator终结点

无法访问/actuator终结点
EN

Stack Overflow用户
提问于 2019-12-02 22:30:13
回答 2查看 58关注 0票数 0

我有一个小项目,用Greenwich.SR4版本运行Spring Boot和Spring Cloud Streams。

到目前为止,我已经尝试包含以下依赖项。

代码语言:javascript
复制
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>

希望拥有一个基本上返回代码200的/check/health端点。

我已经相应地修改了配置,这样就不会有无用的健康配置了。

代码语言:javascript
复制
management.endpoints.web.base-path=/check
management.endpoint.health.enabled=true
management.health.solr.enabled=false
management.health.elasticsearch.enabled=false

但是,每当我尝试运行localhost:8080/check/health时,都会提示A404。可能会发生什么?

我还提到,我曾尝试包含我自己的@RestController,但同样的行为也发生了。

EN

回答 2

Stack Overflow用户

发布于 2019-12-02 23:06:49

运行状况检查的URL应为http://localhost:8080/check/health,而不是/check/status

票数 0
EN

Stack Overflow用户

发布于 2019-12-03 19:50:40

这取决于Spring-Boot版本。在2.0版本之后,路径名为manage,因此您的右侧url为:http://localhost:8080/check/health

您还可以使用(.yml版本)进行更改:

代码语言:javascript
复制
management:
  context-path: /manage
  security:
    enabled: false
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59141015

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档