2016-02-20 73 views
4

我能够访问端点像http://localhost:8081/health/status/env/metrics/shutdown/actuator/loginfo端点。无法访问春季启动器“/执行器”端点

获得以下例外。

{"timestamp":1455929182552,"status":404,"error":"Not Found","message":"No message available","path":"/actuator"} 

如何获得http://localhost:8081/actuator端点?

+1

为[弹簧引导起动器(https://docs.spring.io/spring-boot/docs/current/reference/html/production- ready-enabling.html#生产就绪启用)在您的依赖关系? – kryger

+0

是的,我有我的依赖。 – grkhyd

+0

解决了吗?我也面临同样的问题。使用的春季启动版本1.3.2 – Sam

回答

2

确保已启用这些“敏感”端点。 This doc描述了如何启用所有敏感端点或个别端点。这听起来像你有一些敏感端点(如关机),但不是其他人(如执行器)。

为了使所有敏感终点:

endpoints.sensitive=true 

为了使执行机构和独立日志文:

endpoints.actuator.enabled=true 
endpoints.logfile.enabled=true 
+0

我已经在我的属性文件中包含了它们endpoints.beans.id = springbeans endpoints.beans.sensitive = true endpoints.shutdown.enabled = true endpoints.enabled = true 终结点​​。 info.enabled =真 endpoints.metrics.id =度量 endpoints.metrics.sensitive =真 endpoints.metrics.enabled =真 endpoints.actuator.enabled =真 endpoints.logfile.enabled =真 management.port = 8081 management.security.enabled = true management.security.role = SUPERUSER security.user.name = admin security.user.password = secret123 security.require_ssl = false security.basic.enabled = true' – grkhyd

+0

这是我正在尝试使用的示例[link](https://github.com/bkielczewski/example-弹簧启动执行器) – grkhyd

2

器端点移动在春季启动2.0.0,所以你需要检查/application/health

摇篮:

compile('org.springframework.boot:spring-boot-starter-actuator') 
springBootVersion = '2.0.0.M3'* 

编辑的build.gradle文件并更改引导版本1.5.4.RELEASE。运行应用程序。

curl -i localhost:8080/health 

HTTP/1.1 200 
X-Application-Context: application 
Content-Type: application/vnd.spring-boot.actuator.v1+json;charset=UTF-8 
Transfer-Encoding: chunked 
Date: Wed, 14 Jun 2017 20:45:51 GMT 

{"status":"UP"} 
+0

这是我的问题无论如何:) – yuranos87

+0

Spring Boot 2.0.0.M4 http:// localhost:8080/application –

+0

是的,我可以到/应用程序端点,但那是唯一的。不能去/希斯等。 – djangofan

3

我得到了很好地说明了消息

2017-11-09 23:27:14.572 INFO 30483 --- [nio-8080-exec-2] s.b.a.e.m.MvcEndpointSecurityInterceptor : Full authentication is required to access actuator endpoints. Consider adding Spring Security or set 'management.security.enabled' to false. 

所以我把财产的应用程序了。性能

management.security.enabled=false 

它将工作