SpringCloud11-Alibaba_Sentinel(熔断与限流)

1、Sentinel介绍

(1)Hystrix缺点:

  • 需要手工搭建监控平台;
  • 没有界面监控细粒度化的配置;
  • Sentinel是一个可以独立出来的单独组件,界面化统一配置;

(2)作用:

  • 从流量监控、熔断降级、负载均衡保护等多个维度保护服务的稳定性;

(3)特性

  • 丰富的应用场景:秒杀、削峰、熔断等多场景使用;
  • 完备的实时监控:实时监控;
  • 广泛的开源生态:开箱即用,快速整合;
  • 完善的SPI扩展点:快速扩展定制逻辑;

2、下载安装

  • 注意8080端口不要被占用

(1)下载:https://github.com/alibaba/Sentinel/releases
SpringCloud11-Alibaba_Sentinel(熔断与限流)_第1张图片
(2)接下来步骤查看:https://blog.csdn.net/weixin_45176509/article/details/123583281

3、使用

  • pom.xml
       <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-sentinelartifactId>
            <version>0.9.0.RELEASEversion>
        dependency>

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>cloud2022artifactId>
        <groupId>org.examplegroupId>
        <version>1.0-SNAPSHOTversion>
    parent>
    <modelVersion>4.0.0modelVersion>

    <groupId>org.consumer8083groupId>
    <artifactId>cloud-alibaba-consumer8083artifactId>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-sentinelartifactId>
            <version>0.9.0.RELEASEversion>
        dependency>
        <dependency>
            <groupId>com.alibaba.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-configartifactId>
            <version>2.2.7.RELEASEversion>
        dependency>
        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discoveryartifactId>
            <version>0.9.0.RELEASEversion>
        dependency>
        <dependency>
            <groupId>com.commonsgroupId>
            <artifactId>commonsartifactId>
            <version>1.0-SNAPSHOTversion>
            <scope>compilescope>
        dependency>

        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-webartifactId>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-actuatorartifactId>
        dependency>
        <dependency>
            <groupId>com.baomidougroupId>
            <artifactId>mybatis-plus-boot-starterartifactId>
        dependency>
        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>druid-spring-boot-starterartifactId>
            <version>1.1.10version>
        dependency>
        
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
        dependency>
        
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-jdbcartifactId>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-devtoolsartifactId>
            <scope>runtimescope>
            <optional>trueoptional>
        dependency>
        <dependency>
            <groupId>org.projectlombokgroupId>
            <artifactId>lombokartifactId>
            <optional>trueoptional>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-testartifactId>
            <scope>testscope>
        dependency>

        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-devtoolsartifactId>
            <scope>runtimescope>
            <optional>trueoptional>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-autoconfigureartifactId>
        dependency>

    dependencies>

project>


  • application.yml
server:
  port: 8083

spring:
  application:
    name: consumer-nacos
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
      config:
        server-addr: localhost:8848
        file-extension: yaml
    sentinel: #配置
      transport:
        dashboard: localhost:8080
        port: 8719 #默认为8719,如果占用会从8719+1开始扫描寻找未占用端口

management: #暴露监控
  endpoints:
    web:
      exposure.include: '*'

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第2张图片

  • 主启动
package com.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

@SpringBootApplication
@EnableDiscoveryClient
public class NacosConsumerDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(NacosConsumerDemoApplication.class, args);
    }


}

  • 业务Controller:未作变化,与Nacos相同
package com.consumer.Controller;

import com.commons.Entity.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("nacos/")
@RefreshScope //动态刷新
public class ConsumerController {

    @Resource
    private RestTemplate restTemplate;

    @Value("${spring.datasource.username}")
    private String configInfo;

    @Value("${service-url.nacos-user-service}")
    private String url;

    @GetMapping("/{id}")
    public Result saveEntity(@PathVariable("id") Integer id) {

        return restTemplate.getForObject(url+"/nacos/"+id,Result.class);
    }

    @GetMapping("/getInfo")
    public String getInfo() {
        return configInfo;
    }

}

  • 启动项目,首次访问sentinel空空如也,他是懒加载机制,要访问接口之后才会加载,访问Controller接口,再次访问,效果如下:

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第3张图片

4、规则

(1)簇点链路

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第4张图片

(2)流控规则

配置说明:
SpringCloud11-Alibaba_Sentinel(熔断与限流)_第5张图片

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第6张图片

  • 阈值类型
    配置QPS快速失败:
    SpringCloud11-Alibaba_Sentinel(熔断与限流)_第7张图片
    SpringCloud11-Alibaba_Sentinel(熔断与限流)_第8张图片
    QPS:御敌于国门之外;
    线程数:关门打狗;
  • 流控模式

直接:默认模式;

关联:当与自己关联的资源达到阈值后就限流自己;
SpringCloud11-Alibaba_Sentinel(熔断与限流)_第9张图片

链路:多个请求操作同一个微服务

  • 流控效果

快速失败:默认处理;

WarmUp(预热):长期处于低访问,在某一时刻高访问,需要通过限流慢慢启动,预热时长之后才会慢慢达到单价阈值;
SpringCloud11-Alibaba_Sentinel(熔断与限流)_第10张图片

排队等待:排队挨个挨个处理
SpringCloud11-Alibaba_Sentinel(熔断与限流)_第11张图片

(3)熔断降级

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第12张图片

Sentinel断路器非开即断,没有半开状态;

  • RT(平均响应时间):当1秒内进入5个请求,平均响应时间均超过阈值,那么接下来的时间窗口之内,调用这个方法就会自动熔断,时间窗口期结束,关闭熔断。默认为4900ms,若要设置上线需要配置;

  • 异常比例:当统计时间内,请求次数达到设置数,异常次数达到异常数,则发生熔断,超过熔断时长,关闭熔断;

  • 异常数:当统计时间内,请求次数达到设置数,异常比列到达设置比例,则发生熔断,超过熔断时长,关闭熔断;

(4)热点Key规则

  • 热点即为经常访问的数据;
  • 访问时根据路径是否携带约定参数来决定是否需要限流;

实现:

  • 配置:当第一个参数存在,并且1秒内访问超过1次,就使用配置方法。

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第13张图片

  • 接口: @SentinelResource(value = "nacosId",blockHandler = "dealHandler")

该注解执行的是配置的热点规则,如果出现java异常,不会执行限流方法;

package com.consumer.Controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.commons.Entity.Result;
import com.sun.deploy.security.BlockedException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("nacos/")
@RefreshScope //动态刷新
public class ConsumerController {

    @Resource
    private RestTemplate restTemplate;

    @Value("${spring.datasource.username}")
    private String configInfo;

    @Value("${service-url.nacos-user-service}")
    private String url;

    @GetMapping("/{id}")
    @SentinelResource(value = "nacosId",blockHandler = "dealHandler")
    public Result saveEntity(@PathVariable("id") Integer id,
                             @RequestParam(value = "p1",required = false) String p1,
                             @RequestParam(value = "p2",required = false) String p2) {

        return restTemplate.getForObject(url+"/nacos/"+id,Result.class);
    }

    public Result dealHandler(Integer id, String p1, String p2, BlockException blockException){
        Result result = new Result(404,"/","");
        return result;
    }

}

踩坑:com.alibaba.csp.sentinel.slots.block.flow.FlowException

  • 是否与原方法参数一致;
  • 是否与原方法返回值一致;
  • 是否添加BlockException参数;

参数例外项

  • 以上例子指定某个位置参数后,就会对该参数进行统计限流,但是有时候希望该参数携带某个特殊值时,对它进行特殊限流规则;
  • 当第一个参数值为5时,阈值可达100才会限流;
    SpringCloud11-Alibaba_Sentinel(熔断与限流)_第14张图片

(5)系统自适应规则

  • 从整体维度应用入口进行控制,该规则会对整个服务应用起作用;
维度 描述
Load自适应 系统最高负载,建议取值 CPU cores * 2.5
并发线程数 单机应用的最大线程并发数
入口QPS 单机应用维度入口QPS
平均RT 单机应用所有请求的平均RT
CPU使用率 CPU使用率,取值范围[0, 1]

5、配置使用

5.1 @SentinelResource配置

不支持private方法;

@RestController
public class RateLimitController {

    @GetMapping("/getRate")
    @SentinelResource(value = "getRate" ,blockHandler = "error")
    public Result get(){
        return new Result(200,"正常访问","200");
    }

    public Result error(BlockException blockException){
        return new Result(404,blockException.getClass().getName()+"异常访问","404");
    }
}

存在2种配置:

  • 使用限流资源名称配置:getRate
  • 使用访问Url配置:/getRate

如果有配置blockHandler 方法,则使用该方法,没有则使用系统默认方法;

以上配置导致业务代码和处理代码混合,每个方法都需要配置,导致代码膨胀,改造如下:

  • 提出单独的Handler处理规则,注意方法参数值和返回类型要一致
package com.consumer.Handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.commons.Entity.Result;

public class BlockHandler {
    public static Result error1(BlockException blockException){
        return new Result(404,blockException.getClass().getName()+"异常访问1","404");
    }

    public static Result error2(BlockException blockException){
        return new Result(404,blockException.getClass().getName()+"异常访问2","404");
    }
}

  • 更改注解配置: @SentinelResource(value = "getRate" ,blockHandlerClass = BlockException.class,blockHandler = "error1")
package com.consumer.Controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.commons.Entity.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RateLimitController {

    @GetMapping("/getRate")
    @SentinelResource(value = "getRate" ,blockHandlerClass = BlockException.class,blockHandler = "error1")
    public Result get(){
        return new Result(200,"正常访问","200");
    }
    
}

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第15张图片
Sentinel核心API:Sphu(定义资源)、Tracer(定义统计)、ContextUtil(定义上下文)

6、整合

6.1 Ribbon搭建

pom.xml

 <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-sentinelartifactId>
            <version>0.9.0.RELEASEversion>
        dependency>
        <dependency>
            <groupId>com.alibaba.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-configartifactId>
            <version>2.2.7.RELEASEversion>
        dependency>
        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discoveryartifactId>
            <version>0.9.0.RELEASEversion>
        dependency>

application.yml

spring:
  application:
    name: consumer-nacos
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
      config:
        server-addr: localhost:8848
        file-extension: yaml
    sentinel: #配置******************************
      transport:
        dashboard: localhost:8080
        port: 8719 #默认为8719,如果占用会从8719+1开始扫描寻找未占用端口

management: #暴露监控
  endpoints:
    web:
      exposure.include: '*'

主启动

package com.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

@SpringBootApplication
@EnableDiscoveryClient
public class NacosConsumerDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(NacosConsumerDemoApplication.class, args);
    }

}

业务Controller

package com.consumer.Controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.commons.Entity.Result;
import com.sun.deploy.security.BlockedException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("nacos/")
@RefreshScope //动态刷新
public class ConsumerController {

    @Resource
    private RestTemplate restTemplate;

    @Value("${spring.datasource.username}")
    private String configInfo;

    @Value("${service-url.nacos-user-service}")
    private String url;

    @GetMapping("/{id}")
    @SentinelResource(value = "nacosId")
    public Result saveEntity(@PathVariable("id") Integer id,
                             @RequestParam(value = "p1",required = false) String p1,
                             @RequestParam(value = "p2",required = false) String p2) {

        return restTemplate.getForObject(url+"/nacos/"+id,Result.class);
    }

}

RestTemplate配置

package com.consumer.Config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class RestTemplateConfig {

    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第16张图片

6.2 fallback处理运行时异常,blockHandler处理配置违规

只改造业务Controller,其他相同

package com.consumer.Controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.commons.Entity.Result;
import com.sun.deploy.security.BlockedException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("nacos/")
@RefreshScope //动态刷新
public class ConsumerController {

    @Resource
    private RestTemplate restTemplate;

    @Value("${spring.datasource.username}")
    private String configInfo;

    @Value("${service-url.nacos-user-service}")
    private String url;

    @GetMapping("/{id}")
    //fallback处理运行时异常,blockHandler处理配置违规
    @SentinelResource(value = "nacosId",fallback = "dealHandler1" ,blockHandler = "dealHandler2")
    public Result saveEntity(@PathVariable("id") Integer id,
                             @RequestParam(value = "p1",required = false) String p1,
                             @RequestParam(value = "p2",required = false) String p2) {

        return restTemplate.getForObject(url+"/nacos/"+id,Result.class);
    }

    public Result dealHandler1(Integer id, String p1, String p2, BlockException blockException){
        Result result = new Result(404,"/","1");
        return result;
    }

    public Result dealHandler2(Integer id, String p1, String p2, BlockException blockException){
        Result result = new Result(404,"/","2");
        return result;
    }
}

当二者同时出现方法调用时,blockHandler 优先级高于fallback ;

异常忽略 exceptionsToIgnore

  @GetMapping("/{id}")
    @SentinelResource(value = "nacosId",fallback = "dealHandler1" ,blockHandler = "dealHandler2",
    exceptionsToIgnore = {IllegalArgumentException.class})
    public Result saveEntity(@PathVariable("id") Integer id,
                             @RequestParam(value = "p1",required = false) String p1,
                             @RequestParam(value = "p2",required = false) String p2) {

        return restTemplate.getForObject(url+"/nacos/"+id,Result.class);
    }

配置该属性之后,如果发生IllegalArgumentException异常不会执行fallback 指定方法;

断路方式对比

Sentinel Hystrix
信号量隔离 线程池、信号量隔离
基于响应时间、异常比率、异常数 基于异常比率
基于QPS、调用关系限流 有限的限流支持

7 、规则持久化

  • 重启服务,配置的规则回消失,需要将规则持久化保存;
  • 可以通过eureka、nacos、consul、redis等持久化媒介实现,官方推荐nacos。

7.1 实现

  • pom.xml
        <dependency>
            <groupId>com.alibaba.cspgroupId>
            <artifactId>sentinel-datasource-nacosartifactId>
        dependency>

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>cloud2022artifactId>
        <groupId>org.examplegroupId>
        <version>1.0-SNAPSHOTversion>
    parent>
    <modelVersion>4.0.0modelVersion>

    <groupId>org.consumer8083groupId>
    <artifactId>cloud-alibaba-consumer8083artifactId>

    <dependencies>
        <dependency>
            <groupId>com.alibaba.cspgroupId>
            <artifactId>sentinel-datasource-nacosartifactId>
        dependency>
        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-openfeignartifactId>
        dependency>
        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-sentinelartifactId>
            <version>0.9.0.RELEASEversion>
        dependency>
        <dependency>
            <groupId>com.alibaba.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-configartifactId>
            <version>2.2.7.RELEASEversion>
        dependency>
        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discoveryartifactId>
            <version>0.9.0.RELEASEversion>
        dependency>
        <dependency>
            <groupId>com.commonsgroupId>
            <artifactId>commonsartifactId>
            <version>1.0-SNAPSHOTversion>
            <scope>compilescope>
        dependency>

        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-webartifactId>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-actuatorartifactId>
        dependency>
        <dependency>
            <groupId>com.baomidougroupId>
            <artifactId>mybatis-plus-boot-starterartifactId>
        dependency>
        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>druid-spring-boot-starterartifactId>
            <version>1.1.10version>
        dependency>
        
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
        dependency>
        
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-jdbcartifactId>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-devtoolsartifactId>
            <scope>runtimescope>
            <optional>trueoptional>
        dependency>
        <dependency>
            <groupId>org.projectlombokgroupId>
            <artifactId>lombokartifactId>
            <optional>trueoptional>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-testartifactId>
            <scope>testscope>
        dependency>

        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-devtoolsartifactId>
            <scope>runtimescope>
            <optional>trueoptional>
        dependency>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-autoconfigureartifactId>
        dependency>

    dependencies>

project>


  • application.yml
   #数据数据源
      datasource: 
        ds1: #数据源1
          nacos:
            server-addr: localhost:8848 #nacos地址
            dataId: cloudalibaba-sentinel-service  #dataId名称
            groupId: DEFAULT_GROUP #分组名称
            data-type: json #文件类型
            rule-type: flow
server:
  port: 8083

spring:
  application:
    name: consumer-nacos
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
      config:
        server-addr: localhost:8848
        file-extension: yaml
    sentinel: #配置
      transport:
        dashboard: localhost:8080
        port: 8719 #默认为8719,如果占用会从8719+1开始扫描寻找未占用端口
        #数据数据源
      datasource:
        ds1: #数据源1
          nacos:
            server-addr: localhost:8848 #nacos地址
            dataId: cloudalibaba-sentinel-service  #dataId名称
            groupId: DEFAULT_GROUP #分组名称
            data-type: json #文件类型
            rule-type: flow

management: #暴露监控
  endpoints:
    web:
      exposure.include: '*'

 #激活feign对sentinel支持
feign:
  sentinel:
    enabled: true
  • 主启动
package com.consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class NacosConsumerDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(NacosConsumerDemoApplication.class, args);
    }


}

  • Nacos设置规则

SpringCloud11-Alibaba_Sentinel(熔断与限流)_第17张图片

    resourcenacosId:资源名称
    limitAppdefalut: 来源应用
    grade:阈值类型:0-线程数 1-QPS
    count:单机阈值
    strategy: 流控模式 0-直接 1-关联 2-链路
    controlBehavior:流控效果:0-快速失败 2-WarmUp 3-表示排队等待
    clusterModefalse :是否集群
  • Sentinel流控规则
    需要调用接口触发,否则此处为空;
    SpringCloud11-Alibaba_Sentinel(熔断与限流)_第18张图片
    总结SpringCloud11-Alibaba_Sentinel(熔断与限流)_第19张图片

你可能感兴趣的:(5-Java开发框架,#,5-6,SpringCloud,中间件,sentinel,springcloud,java)