Spring Cloud Admin
一、Admin简介
提供友好的界面展示actuator统计的数据,可以很好的监控整个微服务系统中的实例运行情况信息。
服务异常告警。
二、服务端配置
启动类添加@EnableAdminServer注解
<!-- Admin 服务 -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
</dependency>
<!-- Admin 界面 -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
</dependency>
三、微服务段配置
<!-- Admin 服务 -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
spring:
boot:
admin:
client:
url: http://localhost:8101
management:
#开启所有端点
endpoints:
web:
exposure:
include: '*'
# 开启shutdown端口 调用关闭服务
endpoint:
shutdown:
enabled: true
# 切换hystrix 线程隔离方式变更为信号量模式
health:
show-details: always
四、邮件通知配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
spring:
mail:
host: smtp.qq.com
username: 123456
password: XXXXXX
properties:
mail:
smpt:
auth: true
starttls:
enable: true
required: true
boot:
admin:
notify:
mail:
#收件邮箱
to: 123456@qq.com
# 发件邮箱 必须和上边username账号配置一样
from: 123456@qq.com
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)