Spring Cloud Alibaba之服务容错组件 - Sentinel [规则持久化篇]

规则持久化 - 拉模式

在Sentinel控制台对某个微服务的接口资源配置了流控、降级等规则后,若重启了该微服务,那么配置的相关规则就会丢失,因为Sentinel默认将规则存放在内存中。每次重启微服务都得重新配置规则显然是不合理的,所以我们需要将配置好的规则进行持久化存储,而Sentinel提供了两种规则持久化模式:

  • 拉模式(pull)
  • 推模式(push)

本小节先介绍一下拉模式(pull),该模式的架构图如下:

  • Tips:规则在代码中实际上是一个对象,所以通常是转换成json字符串后再存储至本地文件

因为需要读写本地文件,所以实现拉模式需要编写一些代码,首先在项目中添加如下依赖:

<!-- Sentinel Datasource -->
<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-datasource-extension</artifactId>
</dependency>

由于Sentinel有好几种规则,所以需要写的代码也有点多,具体代码如下示例:

package com.zj.node.contentcenter.sentinel;

import com.alibaba.csp.sentinel.command.handler.ModifyParamFlowRulesCommandHandler;
import com.alibaba.csp.sentinel.datasource.*;
import com.alibaba.csp.sentinel.init.InitFunc;
import com.alibaba.csp.sentinel.slots.block.authority.AuthorityRule;
import com.alibaba.csp.sentinel.slots.block.authority.AuthorityRuleManager;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRuleManager;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRuleManager;
import com.alibaba.csp.sentinel.slots.system.SystemRule;
import com.alibaba.csp.sentinel.slots.system.SystemRuleManager;
import com.alibaba.csp.sentinel.transport.util.WritableDataSourceRegistry;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import lombok.extern.slf4j.Slf4j;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

/**
 * 规则持久化 - 拉模式
 *
 * @author 01
 * @date 2019-08-02
 **/
@Slf4j
public class FileDataSourceInitial implements InitFunc {
    /**
     * 定义并实现各个规则对象的转换器,用于将json格式的数据转换为相应的Java对象
     */
    private Converter<String, List<FlowRule>> flowRuleListParser = source -> JSON.parseObject(
            source,
            new TypeReference<List<FlowRule>>() {
            }
    );

    private Converter<String, List<DegradeRule>> degradeRuleListParser = source -> JSON.parseObject(
            source,
            new TypeReference<List<DegradeRule>>() {
            }
    );

    private Converter<String, List<SystemRule>> systemRuleListParser = source -> JSON.parseObject(
            source,
            new TypeReference<List<SystemRule>>() {
            }
    );

    private Converter<String, List<AuthorityRule>> authorityRuleListParser = source -> JSON.parseObject(
            source,
            new TypeReference<List<AuthorityRule>>() {
            }
    );

    private Converter<String, List<ParamFlowRule>> paramFlowRuleListParser = source -> JSON.parseObject(
            source,
            new TypeReference<List<ParamFlowRule>>() {
            }
    );

    @Override
    public void init() throws Exception {
        // 规则持久化文件所存放的路径及文件名,可以按需求自行修改
        String ruleDir = System.getProperty("user.home") + "/sentinel/rules";
        String flowRulePath = ruleDir + "/flow-rule.json";
        String degradeRulePath = ruleDir + "/degrade-rule.json";
        String systemRulePath = ruleDir + "/system-rule.json";
        String authorityRulePath = ruleDir + "/authority-rule.json";
        String paramFlowRulePath = ruleDir + "/param-flow-rule.json";

        // 目录路径及文件若不存在则创建
        this.mkdirIfNotExits(ruleDir);
        this.createFileIfNotExits(flowRulePath);
        this.createFileIfNotExits(degradeRulePath);
        this.createFileIfNotExits(systemRulePath);
        this.createFileIfNotExits(authorityRulePath);
        this.createFileIfNotExits(paramFlowRulePath);

        // 注册各个规则的可读写数据源
        this.registerFlowRWDS(flowRulePath);
        this.registerDegradeRWDS(degradeRulePath);
        this.registerSystemRWDS(systemRulePath);
        this.registerAuthorityRWDS(authorityRulePath);
        this.registerParamRWDS(paramFlowRulePath);
    }

    /**
     * 注册流控规则的可读写数据源
     */
    private void registerFlowRWDS(String flowRulePath) throws FileNotFoundException {
        // 构建可读数据源,用于定时读取本地的json文件
        ReadableDataSource<String, List<FlowRule>> flowRuleRDS = new FileRefreshableDataSource<>(
                flowRulePath,
                flowRuleListParser
        );
        // 将可读数据源注册至FlowRuleManager,当文件里的规则内容发生变化时,就会更新到缓存里
        FlowRuleManager.register2Property(flowRuleRDS.getProperty());

        // 构建可写数据源
        WritableDataSource<List<FlowRule>> flowRuleWDS = new FileWritableDataSource<>(
                flowRulePath,
                this::toJson
        );
        // 将可写数据源注册至transport模块的WritableDataSourceRegistry中
        // 这样收到控制台推送的规则时,Sentinel会先更新到内存,然后将规则写入到文件中
        WritableDataSourceRegistry.registerFlowDataSource(flowRuleWDS);
    }

    /**
     * 注册降级规则的可读写数据源
     */
    private void registerDegradeRWDS(String degradeRulePath) throws FileNotFoundException {
        ReadableDataSource<String, List<DegradeRule>> degradeRuleRDS = new FileRefreshableDataSource<>(
                degradeRulePath,
                degradeRuleListParser
        );
        DegradeRuleManager.register2Property(degradeRuleRDS.getProperty());
        WritableDataSource<List<DegradeRule>> degradeRuleWDS = new FileWritableDataSource<>(
                degradeRulePath,
                this::toJson
        );
        WritableDataSourceRegistry.registerDegradeDataSource(degradeRuleWDS);
    }

    /**
     * 注册系统规则的可读写数据源
     */
    private void registerSystemRWDS(String systemRulePath) throws FileNotFoundException {
        ReadableDataSource<String, List<SystemRule>> systemRuleRDS = new FileRefreshableDataSource<>(
                systemRulePath,
                systemRuleListParser
        );
        SystemRuleManager.register2Property(systemRuleRDS.getProperty());
        WritableDataSource<List<SystemRule>> systemRuleWDS = new FileWritableDataSource<>(
                systemRulePath,
                this::toJson
        );
        WritableDataSourceRegistry.registerSystemDataSource(systemRuleWDS);
    }

    /**
     * 注册授权规则的可读写数据源
     */
    private void registerAuthorityRWDS(String authorityRulePath) throws FileNotFoundException {
        ReadableDataSource<String, List<AuthorityRule>> authorityRuleRDS = new FileRefreshableDataSource<>(
                authorityRulePath,
                authorityRuleListParser
        );
        AuthorityRuleManager.register2Property(authorityRuleRDS.getProperty());
        WritableDataSource<List<AuthorityRule>> authorityRuleWDS = new FileWritableDataSource<>(
                authorityRulePath,
                this::toJson
        );
        WritableDataSourceRegistry.registerAuthorityDataSource(authorityRuleWDS);
    }

    /**
     * 注册热点参数规则的可读写数据源
     */
    private void registerParamRWDS(String paramFlowRulePath) throws FileNotFoundException {
        ReadableDataSource<String, List<ParamFlowRule>> paramFlowRuleRDS = new FileRefreshableDataSource<>(
                paramFlowRulePath,
                paramFlowRuleListParser
        );
        ParamFlowRuleManager.register2Property(paramFlowRuleRDS.getProperty());
        WritableDataSource<List<ParamFlowRule>> paramFlowRuleWDS = new FileWritableDataSource<>(
                paramFlowRulePath,
                this::toJson
        );
        ModifyParamFlowRulesCommandHandler.setWritableDataSource(paramFlowRuleWDS);
    }

    private void mkdirIfNotExits(String filePath) {
        File file = new File(filePath);
        if (!file.exists()) {
            boolean result = file.mkdirs();
            log.info("创建目录: {} filePath: {}", result ? "成功" : "失败", filePath);
        }
    }

    private void createFileIfNotExits(String filePath) throws IOException {
        File file = new File(filePath);
        if (!file.exists()) {
            boolean result = file.createNewFile();
            log.info("创建文件: {} filePath: {}", result ? "成功" : "失败", filePath);
        }
    }

    private <T> String toJson(T t) {
        return JSON.toJSONString(t);
    }
}

这里有两个重要的API:

  • FileRefreshableDataSource 定时从指定文件中读取规则JSON文件【上图中的本地文件】,如果发现文件发生变化,就更新规则缓存
  • FileWritableDataSource 接收控制台规则推送,并根据配置,修改规则JSON文件【上图中的本地文件】

编写完以上代码后,还需要在项目的 resources/META-INF/services 目录下创建一个文件,名为 com.alibaba.csp.sentinel.init.InitFunc ,如下图所示:

然后编辑文件内容如下:

# 修改为上面FileDataSourceInitial的包名类名全路径
com.zj.node.contentcenter.sentinel.FileDataSourceInitial

完成以上步骤后,重启项目,此时就可以自行测试一下规则是否能持久化存储了。

拉模式的优缺点:

  • 优点:

    • 简单易懂,没有多余依赖(如配置中心、缓存等依赖)
  • 缺点:
    • 由于规则是用 FileRefreshableDataSource 定时更新的,所以规则更新会有延迟。如果FileRefreshableDataSource定时时间过大,可能长时间延迟;如果FileRefreshableDataSource过小,又会影响性能
    • 规则存储在本地文件,如果有一天需要迁移微服务,那么需要把规则文件一起迁移,否则规则会丢失

如果有了解过规则持久化相关配置的小伙伴可能会有疑问,Spring Cloud Alibaba不是提供了如下配置了吗?为什么要全部自己写呢?

spring.cloud.sentinel.datasource.ds1.file.file=classpath: degraderule.json
spring.cloud.sentinel.datasource.ds1.file.rule-type=flow

#spring.cloud.sentinel.datasource.ds1.file.file=classpath: flowrule.json
#spring.cloud.sentinel.datasource.ds1.file.data-type=custom
#spring.cloud.sentinel.datasource.ds1.file.converter-class=com.alibaba.cloud.examples.JsonFlowRuleListConverter
#spring.cloud.sentinel.datasource.ds1.file.rule-type=flow

关于这个问题,可以查看一下这个Issues

官方文档:


规则持久化 - 推模式

在上一小节中,我们了解了规则持久化中拉模式的原理及使用方式,本小节将介绍在生产环境中更为常用的推模式(push)。

推模式的架构图如下:

  • Sentinel控制台不再是调用客户端的API推送规则数据,而是将规则推送到Nacos或其他远程配置中心
  • Sentinel客户端通过连接Nacos,来获取规则配置;并监听Nacos配置变化,如发生变化,就更新本地缓存(从而让本地缓存总是和Nacos一致)
  • Sentinel控制台也监听Nacos配置变化,如发生变化就更新本地缓存(从而让Sentinel控制台的本地缓存总是和Nacos一致)

改造Sentinel控制台

使用推模式进行规则的持久化还是稍微有些麻烦的,因为需要改动Sentinel控制台的源码,对控制台的改造主要是为了实现:

  • DynamicRuleProvider:从Nacos上读取配置
  • DynamicRulePublisher:将规则推送到Nacos上

这里仅演示对流控规则的改造让其支持推模式的规则持久化,因为其他规则的改造过程也是类似的,稍微琢磨一下就可以了。首先需要下载Sentinel的源码包,我这里使用的是1.6.3版本:

下载并解压完成后,使用IDE打开sentinel-dashboard这个项目,如下:

第一步:修改该项目的pom.xml文件,找到如下依赖项:

<!-- for Nacos rule publisher sample -->
<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-datasource-nacos</artifactId>
    <scope>test</scope>
</dependency>

&lt;scope&gt;test&lt;/scope&gt;一行注释掉,即修改为如下:

<!-- for Nacos rule publisher sample -->
<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-datasource-nacos</artifactId>
    <!-- <scope>test</scope> -->
</dependency>

第二步:找到 sentinel-dashboard/src/test/java/com/alibaba/csp/sentinel/dashboard/rule/nacos目录,将整个目录拷贝到 sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacos下,如下图所示:

拷贝完成后rule包结构如下图:

第三步:修改流控规则Controller,到com.alibaba.csp.sentinel.dashboard.controller.v2.FlowControllerV2类的源码中找到这一段:

@Autowired
@Qualifier("flowRuleDefaultProvider")
private DynamicRuleProvider<List<FlowRuleEntity>> ruleProvider;
@Autowired
@Qualifier("flowRuleDefaultPublisher")
private DynamicRulePublisher<List<FlowRuleEntity>> rulePublisher;

修改@Qualifier注解的内容,将其修改为:

@Autowired
@Qualifier("flowRuleNacosProvider")
private DynamicRuleProvider<List<FlowRuleEntity>> ruleProvider;
@Autowired
@Qualifier("flowRuleNacosPublisher")
private DynamicRulePublisher<List<FlowRuleEntity>> rulePublisher;

第四步:打开sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/sidebar/sidebar.html文件,找到一段被注释的代码,如下:

  <!--<li ui-sref-active="active" ng-if="entry.appType==0">-->
    <!--<a ui-sref="dashboard.flow({app: entry.app})">-->
      <!--<i class="glyphicon glyphicon-filter"></i>&nbsp;&nbsp;流控规则 V1</a>-->
  <!--</li>-->

只需要把注释解开,即改为:

  <li ui-sref-active="active" ng-if="entry.appType==0">
    <a ui-sref="dashboard.flow({app: entry.app})">
      <i class="glyphicon glyphicon-filter"></i>&nbsp;&nbsp;流控规则 V1</a>
  </li>

到这步为止,我们就对sentinel-dashboard源码改造完毕了,现在流控规则就可以支持推模式的持久化了,接下来就是编译、启动以及测试。

打开idea的terminal,执行如下命令进行打包编译:

mvn clean package -DskipTests

然后进入target目录,使用如下命令执行jar包,启动Sentinel控制台:

java -jar sentinel-dashboard.jar

注:也可以选择直接在idea中点击启动按钮来启动Sentinel控制台,效果是一样的

启动完成后,使用浏览器打开,可以看到Sentinel的菜单栏中比之前多出了一项流控规则 V1

注:若没有显示该项,可以尝试清除浏览器缓存或换个浏览器打开


改造Sentinel客户端( 微服务)

改造完控制台后,接下来开始改造客户端,首先在项目中添加如下依赖:

<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-datasource-nacos</artifactId>
</dependency>

然后添加各个规则配置:

spring:
  cloud:
    sentinel:
      datasource:
        # 名称随意
        flow:
          nacos:
            server-addr: localhost:8848
            dataId: ${spring.application.name}-flow-rules
            groupId: SENTINEL_GROUP
            # 规则类型,取值见:
            # org.springframework.cloud.alibaba.sentinel.datasource.RuleType
            rule-type: flow
        degrade:
          nacos:
            server-addr: localhost:8848
            dataId: ${spring.application.name}-degrade-rules
            groupId: SENTINEL_GROUP
            rule-type: degrade
        system:
          nacos:
            server-addr: localhost:8848
            dataId: ${spring.application.name}-system-rules
            groupId: SENTINEL_GROUP
            rule-type: system
        authority:
          nacos:
            server-addr: localhost:8848
            dataId: ${spring.application.name}-authority-rules
            groupId: SENTINEL_GROUP
            rule-type: authority
        param-flow:
          nacos:
            server-addr: localhost:8848
            dataId: ${spring.application.name}-param-flow-rules
            groupId: SENTINEL_GROUP
            rule-type: param-flow

完成以上步骤后重启项目,然后回到Sentinel控制台里的流控规则 V1中新增流控规则,之所以不在簇点链路中添加,是因为簇点链路中的按钮依旧是调用之前的逻辑添加到内存中。新增流控规则如下:

新增完成后,到Nacos Server的配置列表上,可以看到该规则的配置数据,证明已经持久化存储到Nacos了:

若直接在Nacos上修改流控规则,然后刷新Sentinel控制台,控制台上的显示也会被修改

此时重启Sentinel控制台和微服务,然后刷新控制台,可以发现该流控规则依旧存在:

以上折腾了那么多只实现了流控规则的持久化,这还是因为官方准备好了示例代码。Sentinel有若干种规则,例如降级规则、系统规则、授权规则、热点规则等,都需要使用类似的方式,修改 com.alibaba.csp.sentinel.dashboard.controller 包中对应的Controller,才能实现持久化,所以本小节仅是抛砖引玉,其他规则可以自行动手参考着实现。

推模式优缺点:

  • 优点:

    • 一致性良好,性能优秀,贴近生产使用
  • 缺点:
    • 需要对控制台的源码进行改动比较麻烦,并且所有规则加起来的改动工作量较大
    • 引入额外的依赖(Nacos)

官方文档:


将应用接入阿里云 AHAS 服务

在生产环境使用Sentinel是必须要实现规则持久化的,而通过以上两个小节的学习,我们可以得知不管使用哪个模式都需要进行相应的改动,其中想要实现贴近生产使用的推模式需要改动的地方更多更麻烦。

如果不想做这些麻烦的改动,又希望在生产环境使用Sentinel的话,则需要考虑使用阿里云提供的在线托管Sentinel控制台(AHAS),该在线Sentinel控制台实现了推模式的规则持久化并可用于生产:

接下来演示一下如何使用这个在线的Sentinel控制台,根据开通说明文档注册了阿里云账户后,进入开通页面:

根据提示开通完成后,进入管理控制台,点击接入应用流控:

进入应用接入界面后可以选择不同的应用接入,这里按照Spring Boot应用接入的说明完成相应步骤:

需要说明一下的是,第二步中的HTTP接口埋点和普通接口埋点都可以省略掉,因为spring-cloud-starter-alibaba-sentinel依赖包里已经实现了,但需要排除该依赖中的sentinel-transport-simple-http模块,避免连接了本地的Sentinel控制台,即修改依赖如下并添加AHAS Client依赖:

<!-- Sentinel -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
    <!-- 排除该模块的目的是不与本地的Sentinel控制台进行通信,以免造成不必要的干扰 -->
    <exclusions>
        <exclusion>
            <groupId>com.alibaba.csp</groupId>
            <artifactId>sentinel-transport-simple-http</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<!-- ahas client -->
<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>spring-boot-starter-ahas-sentinel-client</artifactId>
    <version>1.3.3</version>
</dependency>

除了修改依赖以外,还需要将配置文件中关于Sentinel控制台的配置都注释掉,因为此时我们连接的是在线的Sentinel控制台。如下:

然后只需要添加AHAS的启动参数:

ahas:
  license: xxxxxxxxx
  namespace: default
project:
  name: ${spring.application.name}

完成以上步骤后,重启项目并访问该项目的接口,应用正常接入的情况下可以在阿里云的控制台中看到该应用的展示,如下:

点击该应用就可以进入到Sentinel控制台,可以看到这里基本上和我们自己搭建的Sentinel控制台是差不多的,同样支持实时监控、查看簇点链路及配置各种规则:

例如流控规则的添加也是一样的,只是界面稍微好看一点而已:

至此就完成将应用接入AHAS了,由于操作与Sentinel控制台基本一样这里就不展开介绍了,可以自行测试捣鼓一下,反正可视化的页面使用起来还是比较容易的。

原文地址:https://blog.51cto.com/zero01/2426234

时间: 2024-07-31 13:27:24

Spring Cloud Alibaba之服务容错组件 - Sentinel [规则持久化篇]的相关文章

Spring Cloud Alibaba之服务发现组件 - Nacos

服务发现 为了实现多个微服务之间的调用,我们除了需要Feign这种调用组件外还得依赖服务发现组件.主要的原因是每个微服务所在的机器ip并非总是固定的,并且每个微服务都可能部署多个实例在不同的机器上,所以我们不能把依赖的微服务ip地址写在代码或配置文件里,我们需要有个组件去动态的管理,这就是为什么微服务架构里服务发现功能是必须的. 那么服务发现组件是怎么实现服务发现的呢?我们以大家比较熟悉的MySQL来做类比,通过MySQL简单说明一下服务发现机制的实现.如下图: 简单说明一下什么是服务提供者与服

Spring Cloud Alibaba之负载均衡组件 - Ribbon

负载均衡 我们都知道在微服务架构中,微服务之间总是需要互相调用,以此来实现一些组合业务的需求.例如组装订单详情数据,由于订单详情里有用户信息,所以订单服务就得调用用户服务来获取用户信息.要实现远程调用就需要发送网络请求,而每个微服务都可能会存在有多个实例分布在不同的机器上,那么当一个微服务调用另一个微服务的时候就需要将请求均匀的分发到各个实例上,以此避免某些实例负载过高,某些实例又太空闲,所以在这种场景必须要有负载均衡器. 目前实现负载均衡主要的两种方式: 1.服务端负载均衡:例如最经典的使用N

Spring Cloud Alibaba | 微服务分布式事务之Seata

Spring Cloud Alibaba | 微服务分布式事务之Seata 本篇实战所使用Spring有关版本: SpringBoot:2.1.7.RELEASE Spring Cloud:Greenwich.SR2 Spring CLoud Alibaba:2.1.0.RELEASE 1. 概述 在构建微服务的过程中,不管是使用什么框架.组件来构建,都绕不开一个问题,跨服务的业务操作如何保持数据一致性. 2. 什么是分布式事务? 首先,设想一个传统的单体应用,无论多少内部调用,最后终归是在同一

Spring Cloud Alibaba微服务从入门到进阶 完整版

第1章 课程介绍课程的总体介绍,课程需要的环境搭建和一些常用的快捷键介绍. 第2章 Spring Boot基础前期先带着学习Spring Boot基础,创建Spring Boot项目,讲解Spring Boot的配置,是学习Spring Cloud Alibaba的必知必会. 第3章 微服务的拆分与编写这一章讲解的微服务的概念,使用场景,建模,架构通览,讲师带着拆分微服务并且一步步分析,编写一些基础的微服务功能 第4章 Spring Cloud Alibaba介绍学习Spring Cloud A

Spring Cloud 八:服务容错保护(Hystrix断路器)【Dalston版】

断路器 断路器模式源于Martin Fowler的Circuit Breaker一文."断路器"本身是一种开关装置,用于在电路上保护线路过载,当线路中有电器发生短路时,"断路器"能够及时的切断故障电路,防止发生过载.发热.甚至起火等严重后果. 在分布式架构中,断路器模式的作用也是类似的,当某个服务单元发生故障(类似用电器发生短路)之后,通过断路器的故障监控(类似熔断保险丝),直接切断原来的主逻辑调用.但是,在Hystrix中的断路器除了切断主逻辑的功能之外,还有更复

Spring Cloud Alibaba微服务从入门到进阶 持续更新中

一.Spring Cloud Alibaba简介  https://www.cnblogs.com/my-program-life/p/12203487.html 二.Spring Boot基础  https://www.cnblogs.com/my-program-life/p/12253009.html 三.微服务的拆分和编写  https://www.cnblogs.com/my-program-life/p/12253139.html 原文地址:https://www.cnblogs.c

Spring Cloud Alibaba基础教程:Nacos的数据持久化

前情回顾: <Spring Cloud Alibaba基础教程:使用Nacos实现服务注册与发现> <Spring Cloud Alibaba基础教程:支持的几种服务消费方式> <Spring Cloud Alibaba基础教程:使用Nacos作为配置中心> <Spring Cloud Alibaba基础教程:Nacos配置的加载规则详解> <Spring Cloud Alibaba基础教程:Nacos配置的多环境管理> <Spring C

Spring Cloud Alibaba | Sentinel:分布式系统的流量防卫兵基础实战

Spring Cloud Alibaba | Sentinel:分布式系统的流量防卫兵基础实战 Springboot: 2.1.8.RELEASE SpringCloud: Greenwich.SR2 1. Sentinel控制台概述 在介绍入门实战之前,先来介绍一下Sentinel.Sentinel控制台提供一个轻量级的开源控制台,它提供机器发现以及健康情况管理.监控(单机和集群),规则管理和推送的功能. Sentinel控制台主要功能: 查看机器列表以及健康情况:收集 Sentinel 客户

Spring Cloud Alibaba 新一代微服务解决方案

本篇是「跟我学 Spring Cloud Alibaba」系列的第一篇, 每期文章会在公众号「架构进化论」进行首发更新,欢迎关注. 1.Spring Cloud Alibaba 是什么 Spring Cloud Alibaba 是阿里巴巴提供的微服务开发一站式解决方案,是阿里巴巴开源中间件与 Spring Cloud 体系的融合. 马老师左手双十一,右手阿里开源组件,不仅占据了程序员的购物车,还要攻占大家的开发工具. 先说说 Spring Cloud 提起微服务,不得不提 Spring Clou