Spring 无法访问弹簧启动执行器“/“执行器”;端点
我可以访问端点,如Spring 无法访问弹簧启动执行器“/“执行器”;端点,spring,spring-boot,spring-boot-actuator,Spring,Spring Boot,Spring Boot Actuator,我可以访问端点,如http://localhost:8081/health、/status、/env、/metrics、/shutdown但不是/exactor或/loginfo端点 低于异常 {"timestamp":1455929182552,"status":404,"error":"Not Found","message":"No message available","path":"/actuator"} 如何访问端点?确保启用了那些“敏感”端点。描述如何启用所有敏感端点或单个端点。
http://localhost:8081/health
、/status
、/env
、/metrics
、/shutdown
但不是/exactor
或/loginfo
端点
低于异常
{"timestamp":1455929182552,"status":404,"error":"Not Found","message":"No message available","path":"/actuator"}
如何访问端点?确保启用了那些“敏感”端点。描述如何启用所有敏感端点或单个端点。听起来您启用了某些敏感端点(如关机),但没有启用其他端点(如执行器) 要启用所有敏感端点,请执行以下操作:
endpoints.sensitive=true
单独启用致动器和日志文件:
endpoints.actuator.enabled=true
endpoints.logfile.enabled=true
我也有同样的问题
我的sprint启动启动器执行器已损坏
- 等等
希望它能有所帮助根据
有关/执行器端点,请参见Spring Boot 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"}
我得到了一个很有描述性的信息
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.
所以我把属性放在application属性中
management.security.enabled=false
server.servlet.contextPath=/<app-name>
server.port=8080
management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.metrics.export.prometheus.enabled=true
management.security.enabled=false
management.health.mongo.enabled=false
management.health.redis.enabled=false
management.health.rabbit.enabled=false
management.endpoint.health.show-details=always
#/metrics endpoint configuration
endpoints.metrics.id=metrics
endpoints.metrics.sensitive=false
endpoints.metrics.enabled=true
#/health endpoint configuration (Comment when you are using customized health check)
endpoints.health.id=health
endpoints.health.sensitive=false
endpoints.health.enabled=true
info.app.name=@project.name@
info.app.description=@project.description@
info.app.version=@project.version@
info.app.encoding=@project.build.sourceEncoding@
info.app.java.version=@java.version@
management.endpoints.web.exposure.include=*
#management.endpoints.enabled-by-default=false
#management.endpoints.web.base-path=/
它会起作用的
更新:
management.security.enabled
现在在spring boot 2中不推荐使用,谢谢
@Abdelghani Roussi从spring boot 2.0.1版开始,使用以下属性可以工作
management.endpoints.web.exposure.include=<comma separated endpoints you wish to expose>
management.endpoints.web.exposure.include=
如果您不关心安全性,您可以使用*
通配符在web上公开所有执行器端点
此外,端点似乎已从以前的版本移动。例如,如果您希望使用bean,您现在将拥有/exactor/beans
端点
请务必查看此类端点的启动日志
有关端点的更多信息,请参见spring boot
1.5.6
促动器
为其他端点提供基于超媒体的“发现页”。要求Spring HATEOAS位于类路径上
请参阅:自springboot 2.0.5发布之日起。
健康检查端点为http://hostname:portnumber/applicationroot/actuator/health
还要检查是否添加了依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
org.springframework.boot
弹簧靴起动器执行器
如果您键入http://localhost:8080/actuator/
您将获得默认情况下已公开的端点列表(3个端点),因此为了公开所有端点,您必须在应用程序中添加哪些内容。属性/yml
文件:
management.endpoints.web.exposure.include=*
检查
为此更改application.properties fle将允许您使用
(或/健康/环境)
从Spring Boot开始的运行状况检查端点2.1.5.释放
检查是否添加了依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
org.springframework.boot
弹簧靴起动器执行器
检查是否已添加应用程序。属性
management.endpoints.web.exposure.include=*看起来您已将执行器的端点映射到基本路径/
。检查配置中是否有以下行:
management.endpoints.web.base-path=/
因此,如果省略这一行,那么您将访问执行器
路径下的所有端点,例如:
http://localhost:8081/actuator/health
执行机构本身将可在此处接近:
http://localhost:8081/actuator
根据@Vinod的回答,我添加application.yml内容。
对于spring boot 2.1.0,请在application.yml文件中添加以下属性值
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: always
beans:
enabled: true
从运行应用程序的本地系统[浏览器或邮递员]访问下面的url
http://localhost:8080/actuator/metrics
http://localhost:8080/actuator/health
http://localhost:8080/actuator/beans
更多端点,请参见链接:
这里是应用程序.yml
文件,用于将基本路径更改为/&disable/info
management:
endpoints:
web:
base-path: /
endpoint:
#Disable /info
info:
enabled: false
health:
show-details: always
health:
defaults:
enabled: false
我总是喜欢用应用程序的基本URL提供上下文路径。现在要配置执行器,我们应该在pom.xml中包含以下依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
有关详细信息,请看我的博客我也面临着同样的问题,在花了几个小时后,我可以解决。
首先,我们需要将下面的属性设置为*
management.endpoints.web.exposure.include=*
management.endpoints.enabled-by-default=false
我们需要在URL中的server.port上提供以下属性端口
management.server.port=9000
例如:
http://localhost:9000/actuator/loggers/{package}
http://localhost:9000/actuator/health
这在spring boot 2.1.13的micro服务中进行了尝试,具有以下特性,效果良好
management.endpoints.web.exposure.include=*
management.endpoint.loggers.enabled=true
management.endpoint.restart.enabled=true
management.endpoint.refresh.enabled=true
management.endpoint.health.enabled=true
management.security.enabled=false
management.health.db.enabled=true
management.health.diskspace.enabled=true
首先,您应该确保pom.xml中有以下依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
您可以使用application.yml中的以下配置自定义信息点中的信息
management:
endpoint:
health:
enabled: true
show-details: always
endpoints:
web:
exposure:
include: '*'
jmx:
exposure:
include: '*'
info:
app:
name: @project.name@
description: @project.description@
version: @project.version@
encoding: @project.build.sourceEncoding@
java:
version: @java.version@
之后,您可以转到urllocalhost:8080并查看端点列表,如下所示:
希望这个答案能帮助别人你可以尝试这样的基本路径
配置
management:
endpoints:
web:
base-path: /actuator
exposure:
include: info, health
我有显示问题,并通过添加hal浏览器依赖项得到解决。请确保pom.xml中有以下2个依赖项,以便为执行器显示正确的内容
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-explorer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
是否在您的依赖项中?是的,我的依赖项中有。是否已解决?我也面临同样的问题。使用的Spring boot版本-1.3.2我的属性文件endpoints.beans.id=springbeans endpoints.beans.sensitive=true endpoints.shutdown.enabled=true endpoints.enabled=true endpoints.info.enabled=true endpoints.metrics.id=metrics endpoints.metrics.sensitive=true endpoints.metrics.enabled=true endpoints.activator.enabled=trueendpoints.logfile.enabled=true management.port=8081 management.security.enabled=true management.security.role=SUPERUSER security.user.name=admin security.user.password=secret123 security.require\u ssl=false security.basic.enabled=true
这是