Spring Boot Admin 用于管理和监控一个或者多个 Spring Boot 程序

新建 spring-boot-admin-server

pom

<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 需要指定版本号

application.yml

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);
}
}

eureka-client

添加依赖

<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, 不需要添加依赖

application.xml 添加

management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS

测试

  1. 启动 eureka-server
  2. 启动 config-server
  3. 启动 eureka-client
  4. 启动 admin-server

访问 http://localhost:8071

完整代码:GitHub

本人 C# 转 Java 的 newbie, 如有错误或不足欢迎指正,谢谢

Spring Cloud 学习 (八) Spring Boot Admin的更多相关文章

  1. Spring Cloud 学习 之 Spring Cloud Eureka(源码分析)

    Spring Cloud 学习 之 Spring Cloud Eureka(源码分析) Spring Boot版本:2.1.4.RELEASE Spring Cloud版本:Greenwich.SR1 ...

  2. Spring Cloud学习笔记--Spring Boot初次搭建

    1. Spring Boot简介 初次接触Spring的时候,我感觉这是一个很难接触的框架,因为其庞杂的配置文件,我最不喜欢的就是xml文件,这种文件的可读性很不好.所以很久以来我的Spring学习都 ...

  3. Spring Cloud 学习 之 Spring Cloud Bus实现修改远程仓库后配置自动刷新

    ​ 版本号: ​ Spring Boot:2.1.3.RELEASE ​ Spring Cloud:G版 ​ 开发工具:IDEA 搭建配置中心,这里我们搭建一个简单版的就行 POM: <?xml ...

  4. Spring Cloud 学习 之 Spring Cloud Ribbon(基础知识铺垫)

    文章目录 1.负载均衡: 2.RestTemplate详解: xxxForEntity/xxxForObject:主要介绍get跟post exchange: execute源码分析: 1.负载均衡: ...

  5. Spring Cloud 学习 之 Spring Cloud Eureka(搭建)

    Spring Boot版本:2.1.4.RELEASE Spring Cloud版本:Greenwich.SR1 文章目录 搭建服务注册中心: 注册服务提供者: 高可用注册中心: 搭建服务注册中心: ...

  6. Spring Cloud 学习 (九) Spring Security, OAuth2

    Spring Security Spring Security 是 Spring Resource 社区的一个安全组件.在安全方面,有两个主要的领域,一是"认证",即你是谁:二是& ...

  7. spring cloud学习(七)Spring Cloud Config(续)

    Spring Cloud Config(续) 个人参考项目 个人博客 : https://zggdczfr.cn/ 个人参考项目 : (整合到上一个案例中)https://github.com/Fun ...

  8. spring cloud学习(六)Spring Cloud Config

    Spring Cloud Config 参考个人项目 参考个人项目 : (希望大家能给个star~) https://github.com/FunriLy/springcloud-study/tree ...

  9. Spring Cloud学习 之 Spring Cloud Ribbon 重试机制及超时设置不生效

    今天测了一下Ribbon的重试跟超时机制,发现进行的全局超时配置一直不生效,配置如下: ribbon: #单位ms,请求连接的超时时间,默认1000 ConnectTimeout: 500 #单位ms ...

随机推荐

  1. 2018noip游记

    2018noip游记 相隔一年多才想起可以弄一篇博客纪念一下我的首次比赛, 以现在的水平回望过去,发现很好玩很有纪念意义, 于是这篇博客诞生了 \(T1\) 当时的我刚学会什么是字符串,但仍然很不熟练 ...

  2. APIO 2020 爆零记

    Day -3 这几天集训,貌似大家都没有把APIO放在心上... Day 0 试了下机(非官方选手)... 感觉界面还是比较清新,(至少吊打BZOJ一个数量级) (话说APIO2020中国镜像为什么还 ...

  3. JS中this的指向性问题

    一.this用于访问当前方法所属的对象,谁调用的方法,方法就属于谁 // 普通函数 let obj = { a : 12, fn() { console.log(this == obj); // tr ...

  4. R语言删除不规范的值(或NA)

    在使用R语言处理表格时(xlsx, csv),有时里面含有缺失值,或者不规范的数值,比如下图有许多的问号"?",为了便于处理数据,这些都应该整行地删掉. 为了删掉那些包含" ...

  5. WSL Ubuntu 18.04 LTS + VS Code

    WSL Ubuntu 18.04 LTS + VS Code ​ WSL(Windows Subsystem for Linux)使得Windows用户能够在Windows系统上使用原生的Linux环 ...

  6. Python列表排序方法汇总,超详细!

    1. 修改原列表,不创建新列表的排序 1 a = [3, 2, 8, 4, 6] 2 print(id(a)) # 2180873605704 3 a.sort() # 默认升序 4 print(a) ...

  7. Spider_基础总结6--动态网页抓取--selenium

    # 有些网站使用 '检查元素'也不能够好使,它们会对地址进行加密,此时使用Selenium 调用浏览器渲染引擎可以模拟用户的操作,完成抓取: # 注:selenium既可以抓取静态网页也可以抓取动态网 ...

  8. 获取元素计算样式getComputedStyle()与currentStyle

    window.getComputedStyle()方法是标准化接口,返回一个对象,该对象在应用活动样式表并解析这些值可能包含的任何基本计算后报告元素的所有CSS属性的值. 私有的CSS属性值可以通过对 ...

  9. MySQL索引结构之B+树索引(面)

    首先要明白索引(index)是在存储引擎(storage engine)层面实现的,而不是server层面.不是所有的存储引擎都支持所有的索引类型.即使多个存储引擎支持某一索引类型,它们的实现和行为也 ...

  10. 06 Vue路由简介,原理,实现及嵌套路由,动态路由

    路由概念 路由的本质就是一种对应关系,比如说我们在url地址中输入我们要访问的url地址之后,浏览器要去请求这个url地址对应的资源. 那么url地址和真实的资源之间就有一种对应的关系,就是路由. 路 ...