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
posted @   -Lucas  阅读(227)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示