启动两个项目:server、client
server配置:注意spring-boot-admin的版本号和spring-boot-starter-parent版本号,不能偏差过大。
de.codecentric spring-boot-admin-starter-server2.2.4
@EnableAdminServer
@SpringBootApplication
public class LogAadminApplication {
public static void main(String[] args) {
SpringApplication.run(LogAadminApplication.class, args);
}
}
server.port=8000
client配置:
de.codecentric spring-boot-admin-starter-client2.2.4
server.port=8081 spring.application.name= demo spring.boot.admin.client.url=http://localhost:8000 spring.boot.admin.client.instance.prefer-ip=true #监控配置 开启所有监控 management.endpoints.enabled-by-default=true management.endpoints.web.exposure.include=*
点击应用墙,访问对应应用:http://localhost:8000/



