actuator-系统监控功能
引入依赖
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
application.yml
server:port: 8080servlet:context-path: /glory
# 若要访问端点信息,需要配置用户名和密码
spring:security:user:name: glorypassword: 123456
management:# 端点信息接口使用的端口,为了和主系统接口使用的端口进行分离server:port: 8090servlet:context-path: /sys# 端点健康情况,默认值"never",设置为"always"可以显示硬盘使用情况和线程情况endpoint:health:show-details: always# 设置端点暴露的哪些内容,默认["health","info"],设置"*"代表暴露所有可访问的端点endpoints:web:exposure:include: '*'
访问
主系统:http://localhost:8080/glory


端点信息:http://localhost:8090/sys

