1.系统监控使用springboot admin
2.springboot admin server
2.1 修改pom.xml增加dependency
de.codecentric spring-boot-admin-server 1.3.2 de.codecentric spring-boot-admin-server-ui 1.3.2 org.springframework.boot spring-boot-starter-actuator
2.2 启动类SpringbootApplication增加admin注解支持
@SpringBootApplication@EnableAutoConfiguration@EnableAdminServerpublic class SpringbootApplication { public static void main(String[] args) { SpringApplication.run(SpringbootApplication.class, args); }}
2.3 修改属性文件application.properties
server.display-name=springbootserverserver.context-path=/server.servlet-path=/server.port=8090# adminspring.boot.admin.url=http://localhost:${server.port}
3.springboot admin client
3.1 修改pom.xml增加dependency
de.codecentric spring-boot-admin-starter-client 1.3.4 org.jolokia jolokia-core org.springframework.boot spring-boot-starter-actuator
3.2 修改属性文件application.properties
server.display-name=springbootserverserver.context-path=/server.servlet-path=/server.port=8090# adminspring.boot.admin.url=http://localhost:8090
3.3 logback.xml增加配置
启动server和client即可查看应用的状态
http://localhost:8090