SpringBootAdmin监控
说明
Spring Boot Admin能够将 Actuator 中的信息进行界面化的展示,也可以监控所有 Spring Boot 应用的健康状况,提供实时警报功能。
Spring Boot Admin(简称SBA)由两部分组成:SBA Server和SBA Client。
SBA Server: 提供Admin用户界面并独立运行,用于查看被监控的应用
SBA Client: 被监控应用,注册到 SBA Server
SBA Server
pom.xml 添加依赖
版本要兼容 SpringBoot版本,
1
2
3
4
5<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>2.2.3</version>
</dependency>启动类添加注解
1
application.yml 配置
1
2server:
port: 9111
SBA Client
/actuator/** 加入免 token
pom.xml 添加依赖
与 SBA Server 版本一致
1
2
3
4
5<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.2.3</version>
</dependency>application.yml 添加配置
1
2
3
4
5
6
7
8
9
10
11
12
13spring:
application:
name: gateway
boot:
admin:
client:
url: "http://localhost:9111" # 指定 SBA Server 地址
management:
endpoints:
web:
exposure:
include: "*"
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 王文哲的博客!