actuator 服务监控与管理(个人简单理解为spring的私人医生。)
项目依赖
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
配置文件:
server:
port: 8080
management:
security:
enabled: false #关掉安全认证
port: 8088 #管理端口调整成8088
context-path: /monitor #actuator的访问路径
endpoints:
shutdown:
enabled: true
info:
app:
name: spring-boot-actuator
version: 1.0.0
http://localhost:8088/monitor/autoconfig 访问
这个配置亲测1.5.8版本可用。spring2中该配置进行了修改。
management:
endpoints:
web:
exposure:
include: "*"
未测试是否有效。