2016-02-20 70 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 

它將工作