1. Spring Boot Admin 定义
Spring Boot Admin 是针对 Spring Boot 的actuator接口进行UI美化的接口,可以方便的浏览被监控的Spring Boot项目的基本信息、详细的Health信息、JVM信息、垃圾回收信息、各种配置信息(数据源、缓存、命中率等)
2 系统搭建
server 端搭建
-
gradle中引入一下依赖
compile('de.codecentric:spring-boot-admin-server:1.5.6') compile('de.codecentric:spring-boot-admin-server-ui:1.5.6')
-
配置properties
server.port=8082
入口函数需要加入的注解
@Configuration @EnableAutoConfiguration @EnableAdminServer public class AdminServerApplication { public static void main(String[] args){ SpringApplication.run(AdminServerApplication.class,args); } }
client搭建
- gradle 需要引入的依赖
compile('org.springframework.boot:spring-boot-starter-actuator') compile('de.codecentric:spring-boot-admin-starter-client:1.5.6')
- application.yml需要的配置
main函数编写management: security: enabled: false spring: boot: admin: url: http://localhost:8082
@SpringBootApplication public class ShirSpringBootApplication { public static void main(String[] args){ SpringApplication.run(ShirSpringBootApplication.class,args); } }
网友评论