标签:pbm 添加 void run 一个 tar cuc 两种 HERE
Spring Boot Admin 用于管理和监控一个或者多个 Spring Boot 程序
<parent>
<artifactId>spring-cloud-parent</artifactId>
<groupId>com.karonda</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-admin-server</artifactId>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
spring-boot-admin-starter-server 需要指定版本号
server:
port: 8071
eureka:
client:
service-url:
defaultZone: http://localhost:8001/eureka/
spring:
application:
name: admin-server
@EnableAdminServer // 开启 Admin Server
@EnableEurekaClient
@SpringBootApplication
public class AdminServerApp {
public static void main(String[] args){
SpringApplication.run(AdminServerApp.class, args);
}
}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
注册 Spring Boot Admin (SBA) 客户端有两种方式:一种是通过引入 SBA Client (spring-boot-admin-starter-client);另一种是基于 Spring Cloud Discovery, 不需要添加依赖
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
完整代码:GitHub
本人 C# 转 Java 的 newbie, 如有错误或不足欢迎指正,谢谢
Spring Cloud 学习 (八) Spring Boot Admin
标签:pbm 添加 void run 一个 tar cuc 两种 HERE
原文地址:https://www.cnblogs.com/victorbu/p/11031166.html