<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>1.4.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-docs</artifactId>
</dependency>
...
</dependencies>
这是我的应用程序。属性:
#info for Spring Boot Actuator
info.app.name=Spring Sample Application
info.app.description=Application to demonstrate Spring REST HATEOAS and Actuator
info.app.version=1.0.0
当我发出此http请求时:
http://localhost:8080/actuator
它回报我:
{"links":[{"rel":"self","href":"http://localhost:8080/actuator"},{"rel":"loggers","href":"http://localhost:8080/loggers"},{"rel":"env","href":"http://localhost:8080/env"},{"rel":"info","href":"http://localhost:8080/info"},{"rel":"heapdump","href":"http://localhost:8080/heapdump"},{"rel":"mappings","href":"http://localhost:8080/mappings"},{"rel":"metrics","href":"http://localhost:8080/metrics"},{"rel":"configprops","href":"http://localhost:8080/configprops"},{"rel":"autoconfig","href":"http://localhost:8080/autoconfig"},{"rel":"beans","href":"http://localhost:8080/beans"},{"rel":"auditevents","href":"http://localhost:8080/auditevents"},{"rel":"trace","href":"http://localhost:8080/trace"},{"rel":"health","href":"http://localhost:8080/health"},{"rel":"dump","href":"http://localhost:8080/dump"},{"rel":"docs","href":"http://localhost:8080/docs"}]}
{"status":"UP"}
{"app":{"description":"Application to demonstrate Spring REST HATEOAS and Actuator","name":"Spring Sample Application","version":"1.0.0"}}
当您尝试其他endpoint时,是否尝试查看日志。上面写着
Full authentication is required to access actuator endpoints. Consider adding Spring Security or set 'management.security.enabled' to false.
我想这是不言自明的。至少配置基本身份验证或将上述属性设置为false
。
您看到的白字错误页面也显示
There was an unexpected error (type=Unauthorized, status=401).
{“Status”:“Down”} 我需要做什么才能显示自定义健康状况指示器?
Spring Boot执行器的两个版本(1.2.5和1.3.0)在HealthMvcEndpoint,isUnrestricted()方法(&&and)中的实现存在差异。我明白这是为了保留这些限制 http://docs.spring.io/spring-boot/docs/current-snapshot/reference/htmlsingle/#production-ready-health
控制台输出: 我试图访问http://localhost:8080/acturet/health的执行器健康endpoint,但没有成功。
我有一个使用spring Boot1.4.2和CXF JAXR的项目设置。我想把Spring引导执行器添加到项目中。这是我添加到项目中的配置。 在此之后创建一个WAR文件,然后将其部署在外部tomcat服务器中。但是当我访问健康URL localhost:8080/management/health时,它给出的是404 HTTP代码。服务器正常启动,我可以看到包含以下详细信息的日志: 运行状况配置
我第一次使用Spring Boot应用程序时,执行器是不安全的,所以很容易通过/acture/shutdownendpoint远程关闭。最近,我已经使用Spring安全保护了我的执行器,它已经起作用了。现在我需要提供http基本凭据来访问endpoint,但现在对/acture/shutdownendpoint的curl调用失败,出现禁止错误。我一定是配置不正确的地方。 我的卷曲命令: 我的配置: