SpringBoot1.5.19.RELEASE
actuaotr是spring boot项目中非常强大的一个功能,有助于对应用程序进行监控和管理,通过restful api请求来监管、审计、收集应用的运行情况,针对微服务而言它是必不可少的一个环节。
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
在全局配置文件中设置关闭安全限制
management.security.enabled=false
<http://localhost:8080/health> <http://localhost:8080/dump><http://localhost:8080/beans>
具体可参考:<https://www.cnblogs.com/baidawei/p/9183531.html>
<https://www.cnblogs.com/baidawei/p/9183531.html>
Spring Boot Admin 提供了很多功能,如显示 name、id 和 version,显示在线状态,Loggers 的日志级别管理,Threads 线程管理,Environment 管理等。
<dependencies> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-server</artifactId> <version>1.5.7</version> </dependency> </dependencies>
@SpringBootApplication @EnableAdminServer public class SpringbootHelloworldApplication { public static void main(String[] args) { SpringApplication.run(SpringbootHelloworldApplication.class, args); } }
<dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> <version>1.5.7</version> </dependency>
#服务端的ip地址和端口 spring.boot.admin.url: http://localhost:8383 management.security.enabled=false
此时客户端的端口是:8080 ; 服务端的端口是8383
先启动服务端,打开网页:http://localhost:8383 (什么都没有,因为客户端还没启动)
原文链接:https://www.cnblogs.com/net-safe/p/13529230.html