无法访问Spring Boot Actuator"/执行器"端点

grk*_*hyd 22 spring spring-boot spring-boot-actuator

我能够访问端点一样http://localhost:8081/health,/status,/env,/metrics,/shutdown没有 /actuator/loginfo端点.

低于例外.

{"timestamp":1455929182552,"status":404,"error":"Not Found","message":"No message available","path":"/actuator"}
Run Code Online (Sandbox Code Playgroud)

如何访问http:// localhost:8081 /执行器端点?

Sha*_*pta 27

从春季启动版本2.0.1使用以下属性将起作用

management.endpoints.web.exposure.include=<comma separated endpoints you wish to expose>
Run Code Online (Sandbox Code Playgroud)

如果您*不担心安全性,可以使用通配符在Web上公开所有执行器端点.

此外,端点似乎已从先前版本移开.对于前者 如果你想使用bean,你现在会有/actuator/beans端点.

只是为了确保查看这些端点的启动日志.

有关端点的更多信息,请点击此处


xue*_*eng 11

看起来您将Actuator端点映射到基本路径/。检查您的配置中是否有以下行:

management.endpoints.web.base-path=/
Run Code Online (Sandbox Code Playgroud)

所以,如果你省略这一行,那么你将访问actuator路径下的所有端点,例如:

http://localhost:8081/actuator/health
Run Code Online (Sandbox Code Playgroud)

并且执行器本身将在此处变得可访问:

http://localhost:8081/actuator
Run Code Online (Sandbox Code Playgroud)


Sha*_*ran 7

我遇到了同样的问题,花了几个小时后,可以解决。首先我们需要将下面的属性设置为 *

management.endpoints.web.exposure.include=*
management.endpoints.enabled-by-default=false
Run Code Online (Sandbox Code Playgroud)

并且我们需要提供以下属性端口,而不是 URL 中的 server.port。

management.server.port=9000
Run Code Online (Sandbox Code Playgroud)

例子:

http://localhost:9000/actuator/loggers/{package}
http://localhost:9000/actuator/health
Run Code Online (Sandbox Code Playgroud)

这是在带有 spring boot 2.1.13 的微服务中尝试过的,具有以下属性并且工作正常。

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
Run Code Online (Sandbox Code Playgroud)


Ade*_*lin 6

我收到了一条很有描述性的信息

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.
Run Code Online (Sandbox Code Playgroud)

所以我把属性放在applicaiton.properties中

management.security.enabled=false 
Run Code Online (Sandbox Code Playgroud)

它会起作用

  • `management.security.enabled`现在在spring boot 2中已弃用 (3认同)

BER*_*ine 6

如果键入http://localhost:8080/actuator/ yo,您将获得默认情况下公开的端点列表(3个端点),因此为了公开所有端点,您必须在application.properties/yml文件中添加以下内容:

management.endpoints.web.exposure.include=*
Run Code Online (Sandbox Code Playgroud)


Kum*_*hek 5

Actuator 端点在 Spring Boot 2.0.0 中移动,因此您需要检查/application/health.

摇篮:

compile('org.springframework.boot:spring-boot-starter-actuator')
springBootVersion = '2.0.0.M3'*
Run Code Online (Sandbox Code Playgroud)

编辑 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"}
Run Code Online (Sandbox Code Playgroud)

  • Acutator端点再次移动,前缀现在是`/actuator`而不是`/application` (6认同)

Moh*_*eeq 5

截至springboot 2.0.5.RELEASE 运行状况检查端点为http://hostname:portnumber/applicationroot/actuator/health

还检查您是否已添加依赖项

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
Run Code Online (Sandbox Code Playgroud)


小智 2

确保启用这些“敏感”端点。本文档描述如何启用所有敏感端点或单个端点。听起来您启用了某些敏感端点(例如关闭),但没有启用其他端点(例如执行器)。

要启用所有敏感端点:

endpoints.sensitive=true
Run Code Online (Sandbox Code Playgroud)

要单独启用执行器和日志文件:

endpoints.actuator.enabled=true
endpoints.logfile.enabled=true
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

45154 次

最近记录:

6 年,2 月 前