使用Spring Boot Admin步骤:
1、搭建服务端,用来检测客户端浏览器服务器
其实服务端也是一个springboot项目
2、在pom中添加依赖
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>1.5.7</version>
</dependency>
3、在springboot启动类上添加注解@EnableAdminService
@SpringBootApplication
@EnableAdminServer
public class SpringBootServiceApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootServiceApplication.class, args);
}
}
搭建客户端
1、添加依赖
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.7</version>
</dependency>
2、在properties配置文件设置参数
management.security.enabled=false
安全设置关闭
spring.boot.admin.url= http://localhost:9090
http://localhost:9090 表示是 Spring Boot Admin 服务单的 IP 地址以及端口号
经验总结:
使用admin1.5.7的就无法使用springboot2.0.0