在pom中引入依赖:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
在application.properties中配置:
springboot2.0.5版本配置:
#actuator端口 management.server.port=9001 #修改访问路径 2.0之前默认是/ 2.0默认是 /actuator 可以通过这个属性值修改 management.endpoints.web.base-path=/ #开放所有页面节点 默认只开启了health、info两个节点 management.endpoints.web.exposure.include=* #显示健康具体信息 默认不会显示详细信息 management.endpoint.health.show-details=always
查看运行程序的健康状态 http://127.0.0.1:9001/health
查看运行程序的 Bean http://127.0.0.1:9001/beans