一、为什么需要改造 Sentinel:

Sentinel-Dashboard 控制台是流量控制、熔断降级规则统一配置和管理的入口,它为用户提供了机器自发现、簇点链路自发现、监控、规则配置等功能。在 Sentinel 控制台上,我们可以配置规则并实时查看流量控制效果。在前面我们也介绍了 sentinel-dashboard 的搭建部署、springcloud 集成 sentinel 进行流控熔断以及 将 Sentinel 规则持久化到 apollo 配置中心 等一系列操作,这一篇文章我们就介绍下如何对 Sentinel 进行改造,使其更加符合生产环境的要求。

​        那为什么需要对 Sentinel 进行改造呢?主要是因为所有规则都只能通过 Nacos 界面或 Apollo 界面来完成修改才能得到持久化存储,而在 Sentinel Dashboard 中修改限流规则虽然可以生效,但是不会被持久化到配置中心。而在这两个配置中心里存储的数据是一个 Json 格式,当存储的规则越来越多,对该 Json 配置的可读性与可维护性会变的越来越差。

​那么如何改造呢?要回答这个问题,我们需要先了解下 Sentinel 的规则管理方式。

1、Sentinel 的规则管理方式:

Sentinel 提供了两种修改规则的方式,第一种是通过 API 编码直接修改(loadRules),但编码的方式一般用于测试和演示;第二种是通过 DataSource 适配不同数据源进行修改,生产环境一般使用该方式来动态管理规则,Sentinel 中动态规则源的管理共有三种模式:

(1)原生模式:Sentinel Dashboard 通过 API 将规则推送至 Sentinel Client 并直接更新到 Sentinel Client 的内存中,因为规则存储在内存中,只要项目重启就丢失了,所以不建议用于生产环境

(2)pull 模式:即拉模式, Sentinel Client 主动向某个规则管理中心定期轮询拉取规则,所以不能保证实时性,如果拉取过于频繁可能会导致性能问题。下图以本地文件数据源为例,推送过程如下图所示:

(3)push 模式:即推模式,由规则中心统一推送, Sentinel Client 通过注册监听器的方式时刻监听变化,比如使用 Nacos、Apollo、ZooKeeper 等配置中心,这种方式有更好的实时性和一致性保证。生产环境下推荐采用 push 模式的数据源,push 推送的操作应该由 Sentinel dashboard 和 Config Center Dashboard 控制台统一进行管理和推送,不应该经 Sentinel Client 推送至配置中心,Sentinel Client 仅负责获取配置中心推送的配置并更新到本地,因此推送规则正确做法应该是:配置中心控制台/Sentinel 控制台 → 配置中心 → Sentinel 客户端。

2、Sentinel 的改造内容:

2.1、改造前后的数据流程图:

了解完 Sentinel 的规则管理方式后,我们肯定能明白在生产环境使用 Sentinel 时,需要将原生的规则管理模式改造 push 模式的原因了,Sentinel 改造前后的数据流向图如下所示:

  • 蓝色箭头 代表了限流规则由配置中心发起修改的更新路径
  • 橙色箭头代表了限流规则由 Sentinel Dashboard 发起修改的更新路径
  • 绿色箭头为公共公共部分,即:不论从配置中心修改,还是从 Sentinel Dashboard 修改都会触发的操作。

从图中可以很明显的看到,在没有整合配置中心来存储规则前,Sentinel Dashboard 与业务服务之间是可以互通获取最新限流规则的。在整合配置中心后但未对 Sentinel-dashboard 改造前,配置中心的修改都可以实时的刷新到业务服务,再而被 Sentinel Dashboard 读取到,但是 Sentinel dashboard 对于这些规则的更新到达各个业务服务之后,并没有一个机制将规则同步到配置中心。但在改造后,从上图的两处修改起点看,所有涉及的部分都能获取到一致的限流规则了。

2.2、核心改造点:

由上图我们可知,我们需要改造的内容如下:

(1)Sentinel dashboard 控制台:

  • ① Sentinel dashboard 控制台将规则写入到 apollo/nacos 配置中心进行持久化
  • ② Sentinel dashboard 能实时更新 apollo/nacos 控制台所修改的规则

(2)Sentinel Client:

  • ① Sentinel Client 实时更新 apollo/nacos 配置中心所修改的规则

二、Sentinel 的改造:

文章该部分以 apollo 作为配置中心介绍如何对 Sentinel 进行改造,基于 Nacos 的改造方式推荐参考下面文章:

https://www.freesion.com/article/30571440125/

https://www.imooc.com/article/289464

https://github.com/tanjiancheng/alibaba-sentinel-dashboard-nacos

1、Sentinel dashboard 的改造:

本文是基于 sentinel-dashboard 1.7.2 版本进行改造的,需要先下载官方源码到本地进行改造:https://github.com/alibaba/Sentinel/tree/release-1.7/sentinel-dashboard

1.1、添加 apollo 依赖与配置:

sentinel-dashboard 整合 apollo 进行规则的持久化配置,主要方式是通过 apollo 开放平台的授权方式进行写入与读取,所以需要在 pom.xml 文件引入以下依赖:

 <dependency><groupId>com.ctrip.framework.apollo</groupId><artifactId>apollo-openapi</artifactId><version>1.7.0</version><scope>compile</scope></dependency>

引入之后,在 sentinel-dashboard 的配置文件添加 apollo 的配置,下列各配置参数的获取方式文章第2部分会介绍:

# apollo的中配置的appId
app.id=sentinel-rules
# 如果apollo配置中心控制台的访问地址
apollo.meta=http://portal.xxx.net
# token获取方法下文会介绍
apollo.token=ccc082b44f06f2ae9552bf67a710f36c36e6b777
# apollo的登录用户
apollo.user=apollo
# apollo的集群名称 没有的话请使用default
apollo.clusterName=default
# apollo的命名空间 默认使用application,但考虑到该空间需要给所有项目共同使用,因此单独创建了一个公共空间
apollo.namespaceName=EDU001.sentinel-rules

接下来,我们按照下面两步核心步骤进行改造:

(1)第一步:添加与实现所有规则的 Provider 与 Publisher 的配置拉取与推送接口,改由从 apollo 中获取规则信息,并将添加与修改的规则保存到 apollo

(2)第二步:在 Controller 层中引入改造过后的 Provider 与 Publisher 接口,由改造后的 Provider 与 Publisher 接口负责处理 sentinel-dashboard 看板发起的操作

1.2、规则在 Apollo 的编码与存储配置:

(1)sentinel 规则在 apollo 的编码配置:

package com.alibaba.csp.sentinel.dashboard.rule.apollo;import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiDefinitionEntity;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity;
import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterAppAssignMap;
import com.alibaba.csp.sentinel.datasource.Converter;
import com.alibaba.fastjson.JSON;
import com.ctrip.framework.apollo.openapi.client.ApolloOpenApiClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;import java.util.List;@Configuration
public class ApolloConfig {@Value("${apollo.meta}")private String portalUrl;@Value("${apollo.token}")private String token;/*** 流控规则编码*/@Beanpublic Converter<List<FlowRuleEntity>, String> flowRuleEntityEncoder() {return JSON::toJSONString;}/*** 流控规则解码*/@Beanpublic Converter<String, List<FlowRuleEntity>> flowRuleEntityDecoder() {return s -> JSON.parseArray(s, FlowRuleEntity.class);}/*** 降级规则编码*/@Beanpublic Converter<List<DegradeRuleEntity>, String> degradeRuleEntityEncoder() {return JSON::toJSONString;}/*** 降级规则解码*/@Beanpublic Converter<String, List<DegradeRuleEntity>> degradeRuleEntityDecoder() {return s -> JSON.parseArray(s, DegradeRuleEntity.class);}/*** 授权规则编码*/@Beanpublic Converter<List<AuthorityRuleEntity>, String> authorityRuleEntityEncoder() {return JSON::toJSONString;}/*** 授权规则解码*/@Beanpublic Converter<String, List<AuthorityRuleEntity>> authorityRuleEntityDecoder() {return s -> JSON.parseArray(s, AuthorityRuleEntity.class);}/*** 系统规则编码*/@Beanpublic Converter<List<SystemRuleEntity>, String> systemRuleEntityEncoder() {return JSON::toJSONString;}/*** 系统规则解码*/@Beanpublic Converter<String, List<SystemRuleEntity>> systemRuleEntityDecoder() {return s -> JSON.parseArray(s, SystemRuleEntity.class);}/*** 热点规则编码*/@Beanpublic Converter<List<ParamFlowRuleEntity>, String> paramFlowRuleEntityEncoder() {return JSON::toJSONString;}/*** 热点规则解码*/@Beanpublic Converter<String, List<ParamFlowRuleEntity>> paramFlowRuleEntityDecoder() {return s -> JSON.parseArray(s, ParamFlowRuleEntity.class);}/*** 集群流控规则编码*/@Beanpublic Converter<List<ClusterAppAssignMap>, String> clusterGroupEntityEncoder() {return JSON::toJSONString;}/*** 集群流控规则解码*/@Beanpublic Converter<String, List<ClusterAppAssignMap>> clusterGroupEntityDecoder() {return s -> JSON.parseArray(s, ClusterAppAssignMap.class);}/*** API管理分组编码*/@Beanpublic Converter<List<ApiDefinitionEntity>, String> apiDefinitionEntityEncoder() {return JSON::toJSONString;}/*** API管理分组解码*/@Beanpublic Converter<String, List<ApiDefinitionEntity>> apiDefinitionEntityDecoder() {return s -> JSON.parseArray(s, ApiDefinitionEntity.class);}/*** 网关流控规则编码*/@Beanpublic Converter<List<GatewayFlowRuleEntity>, String> gatewayFlowRuleEntityEncoder() {return JSON::toJSONString;}/*** 网关流控规则解码*/@Beanpublic Converter<String, List<GatewayFlowRuleEntity>> gatewayFlowRuleEntityDecoder() {return s -> JSON.parseArray(s, GatewayFlowRuleEntity.class);}@Beanpublic ApolloOpenApiClient apolloOpenApiClient() {ApolloOpenApiClient client = ApolloOpenApiClient.newBuilder().withPortalUrl(portalUrl).withToken(token).build();return client;}
}

(2)sentinel 规则在 Apollo 中存储的 key 值的前/后缀:

package com.alibaba.csp.sentinel.dashboard.rule.apollo;public final class ApolloConfigUtil
{/*** 网关-api分组id*/public static final String GATEWAY_API_GROUP_DATA_ID_POSTFIX = "gw-api-group-rules";/*** 网关-流控规则id*/public static final String GATEWAY_FLOW_DATA_ID_POSTFIX = "gw-flow-rules";/*** 流控规则id*/public static final String FLOW_DATA_ID_POSTFIX = "flow-rules";/*** 降级规则id*/public static final String DEGRADE_DATA_ID_POSTFIX = "degrade-rules";/*** 热点规则id*/public static final String PARAM_FLOW_DATA_ID_POSTFIX = "param-flow-rules";/*** 系统规则id*/public static final String SYSTEM_DATA_ID_POSTFIX = "system-rules";/*** 授权规则id*/public static final String AUTHORITY_DATA_ID_POSTFIX = "authority-rules";/*** 集群流控id*/public static final String CLUSTER_GROUP_DATA_ID_POSTFIX = "cluster-group-rules";private ApolloConfigUtil(){}public static String getGatewayFlowDataId(String appName){return String.format("%s-%s", appName, GATEWAY_FLOW_DATA_ID_POSTFIX);}public static String getGatewayApiGroupDataId(String appName){return String.format("%s-%s", appName, GATEWAY_API_GROUP_DATA_ID_POSTFIX);}public static String getClusterGroupDataId(String appName){return String.format("%s-%s", appName, CLUSTER_GROUP_DATA_ID_POSTFIX);}public static String getFlowDataId(String appName){return String.format("%s-%s", appName, FLOW_DATA_ID_POSTFIX);}public static String getDegradeDataId(String appName){return String.format("%s-%s", appName, DEGRADE_DATA_ID_POSTFIX);}public static String getParamFlowDataId(String appName){return String.format("%s-%s", appName, PARAM_FLOW_DATA_ID_POSTFIX);}public static String getSystemDataId(String appName){return String.format("%s-%s", appName, SYSTEM_DATA_ID_POSTFIX);}public static String getAuthorityDataId(String appName){return String.format("%s-%s", appName, AUTHORITY_DATA_ID_POSTFIX);}
}

1.3、新增 Provider 与 Publisher:

Sentinel Dashboard 从 1.4.0 版本开始就抽取出了接口用于向远程配置中心推送规则以及拉取规则:DynamicRuleProvider 拉取规则、DynamicRulePublisher 推送规则,所以,只需要通过这两个接口,实现对配置中心中存储规则的读写,就能实现 Sentinel Dashboard 中修改规则与配置中心存储同步的效果。

这里仅提供对流控规则的修改案例,其他规则类型(流控/降级/热点/系统/授权)的修改基本与流控相同,就不重复介绍:

(1)新增 Provider,从 Apollo 配置中心查询持久化的规则:

@Component("flowRuleApolloProvider")
public class FlowRuleApolloProvider implements DynamicRuleProvider<List<FlowRuleEntity>> {@Autowiredprivate ApolloOpenApiClient apolloOpenApiClient;@Autowiredprivate Converter<String, List<FlowRuleEntity>> converter;@Value("${app.id}")private String appId;@Value("${spring.profiles.active}")private String env;@Value("${apollo.clusterName}")private String clusterName;@Value("${apollo.namespaceName}")private String namespaceName;@Overridepublic List<FlowRuleEntity> getRules(String appName){String flowDataId = ApolloConfigUtil.getFlowDataId(appName);OpenNamespaceDTO openNamespaceDTO = apolloOpenApiClient.getNamespace(appId, env, clusterName, namespaceName);String rules = openNamespaceDTO.getItems().stream().filter(p -> p.getKey().equals(flowDataId)).map(OpenItemDTO::getValue).findFirst().orElse("");if (StringUtil.isEmpty(rules)) {return new ArrayList<>();}return converter.convert(rules);}
}

(2)新增 Publisher,将流控规则持久化到 Apollo 配置中心里面:

@Component("flowRuleApolloPublisher")
public class FlowRuleApolloPublisher implements DynamicRulePublisher<List<FlowRuleEntity>> {@Autowiredprivate ApolloOpenApiClient apolloOpenApiClient;@Autowiredprivate Converter<List<FlowRuleEntity>, String> converter;@Value("${app.id}")private String appId;@Value("${spring.profiles.active}")private String env;@Value("${apollo.user}")private String user;@Value("${apollo.clusterName}")private String clusterName;@Value("${apollo.namespaceName}")private String namespaceName;@Overridepublic void publish(String app, List<FlowRuleEntity> rules){AssertUtil.notEmpty(app, "app name cannot be empty");if (rules == null) {return;}filterField(rules);// Increase the configurationString flowDataId = ApolloConfigUtil.getFlowDataId(app);OpenItemDTO openItemDTO = new OpenItemDTO();openItemDTO.setKey(flowDataId);openItemDTO.setValue(converter.convert(rules));openItemDTO.setComment("Program auto-join");openItemDTO.setDataChangeCreatedBy(user);apolloOpenApiClient.createOrUpdateItem(appId, env, clusterName, namespaceName, openItemDTO);// Release configurationNamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO();namespaceReleaseDTO.setEmergencyPublish(true);namespaceReleaseDTO.setReleaseComment("Modify or add configurations");namespaceReleaseDTO.setReleasedBy(user);namespaceReleaseDTO.setReleaseTitle("Modify or add configurations");apolloOpenApiClient.publishNamespace(appId, env, clusterName, namespaceName, namespaceReleaseDTO);}/*** 过滤不必要的字段*/private void filterField(List<FlowRuleEntity> rules) {// 对不必要的信息进行过滤for (FlowRuleEntity rule : rules) {rule.setGmtCreate(null);rule.setGmtModified(null);}}
}

(3)在 Controller 中引入 Provider 和 Publisher:

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

(4)修改 controller 的查询接口,改由从 apollo 中查询 sentinel 的规则:

/*** 查询流控配置,用于展示在sentinel-dashboard上 */
@GetMapping("/rules")
@AuthAction(PrivilegeType.READ_RULE)
public Result<List<FlowRuleEntity>> apiQueryMachineRules(@RequestParam String app, @RequestParam String ip, @RequestParam Integer port) {if (StringUtil.isEmpty(app)){return Result.ofFail(-1, "app can't be null or empty");}if (StringUtil.isEmpty(ip)){return Result.ofFail(-1, "ip can't be null or empty");}if (port == null){return Result.ofFail(-1, "port can't be null");}try {List<FlowRuleEntity> rules = ruleProvider.getRules(app);if (rules != null && !rules.isEmpty()){for (FlowRuleEntity entity : rules){entity.setApp(app);if (entity.getClusterConfig() != null && entity.getClusterConfig().getFlowId() != null){entity.setId(entity.getClusterConfig().getFlowId());}}}repository.saveAll(rules);return Result.ofSuccess(rules);}catch (Throwable throwable){logger.error("Error when querying flow rules", throwable);return Result.ofThrowable(-1, throwable);}
}

(5)修改 controller 的新增或修改接口,每次新增或修改都同步到 Apollo 中:

/*** 发布限流配置*/
private CompletableFuture<Void> publishRules(String app, String ip, Integer port) {List<FlowRuleEntity> rules = repository.findAllByMachine(MachineInfo.of(app, ip, port));try {rulePublisher.publish(app, rules);} catch (Exception e) {e.printStackTrace();}return sentinelApiClient.setFlowRuleOfMachineAsync(app, ip, port, rules);
}

2、配置 sentinel-dashboard 的 Apollo 空间:

2.1、创建 sentinel-dashboard 项目的 apollo 应用:

2.2、创建一个用于存放 sentinel-dashboard 规则的公共 namespace 空间:

进入应用后,点击 "添加Namespace",创建一个具体存储 Sentinel 各种限流、熔断降级等规则的 Apollo 存储空间,这里需要注意的是所创建的空间类型一定要是"public"公共空间,因为最终这些规则是需要具体的微服务应用去获取的,而在Apollo中应用下只有公共Namecspace才能被其他应用继承。

2.3、创建基于该应用的开放授权信息token:

(1)点击控制台右上角的管理员工具 -> 开放平台授权管理

(2)第三方应用ID=AppId,第三方应用名称=请随意填写,项目负责人=配置文件中的apollo.user,第一次请点击创建, 如果右上角提示已经存在,则点击查询

(3)授权类型请选择app:

最终生成的Token信息将作为 sentinel-dashboard 与 Apollo 接口对接的重要凭证被配置。至此,通过上面几个步骤,就完成了 sentinel-dashboard 项目的改造,接下来将介绍其他项目如何与改造后的 sentinel-dashboard 进行集成并打通

3、spring boot 集成 sentinel 并持久化规则到 apollo 中:

此部分以 gateway-bbk 网关项目为例,如果非网关项目去掉网关相关配置

3.1、引入依赖:

<dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-sentinel</artifactId><version>2.2.6.RELEASE</version>
</dependency>
<!--apollo-->
<dependency><groupId>com.alibaba.csp</groupId><artifactId>sentinel-datasource-apollo</artifactId><version>1.5.2</version>
</dependency>

3.2、配置文件:

sentinel-dashboard 是将规则写入它在 Apollo 所在应用的公共空间下 sentinel-rules,因此其他微服务可以通过 Apollo 继承并读取到该公共空间的配置。只是我们在进行 sentinel-dashboard的 改造将规则的写入编成了一定的前/后缀标识,所以 SpringCloud 微服务要想匹配到相应的规则,也需要在自身服务的配置中约定读取方式,具体以限流、熔断这两个规则为例进行配置,如下的 flowRulesKey 所示:

# sentinel + apollo进行规则持久化,RulesKey指定该规则在apollo中key的名称,命名格式需与sentinel-dashboard配置的格式保持一致
sentinel.datasource.rules.apollo.namespace-name = EDU001.sentinel-rules
# 从Apollo公共空间中EDU001.sentinel-rules读取限流规则
spring.cloud.sentinel.datasource.flow.apollo.ruleType = flow
spring.cloud.sentinel.datasource.flow.apollo.namespace-name = ${sentinel.datasource.rules.apollo.namespace-name}
spring.cloud.sentinel.datasource.flow.apollo.flowRulesKey = ${spring.application.name}-${spring.cloud.sentinel.datasource.flow.apollo.ruleType}-rules
# 从Apollo公共空间中EDU001.sentinel-rules读取熔断规则
spring.cloud.sentinel.datasource.degrade.apollo.ruleType = degrade
spring.cloud.sentinel.datasource.degrade.apollo.namespace-name = ${sentinel.datasource.rules.apollo.namespace-name}
spring.cloud.sentinel.datasource.degrade.apollo.flowRulesKey = ${spring.application.name}-${spring.cloud.sentinel.datasource.degrade.apollo.rule-ruleType}-rules
# 从Apollo公共空间中EDU001.sentinel-rules读取网关限流规则
spring.cloud.sentinel.datasource.gwFlow.apollo.ruleType = gw-flow
spring.cloud.sentinel.datasource.gwFlow.apollo.namespace-name = ${sentinel.datasource.rules.apollo.namespace-name}
spring.cloud.sentinel.datasource.gwFlow.apollo.flowRulesKey = ${spring.application.name}-${spring.cloud.sentinel.datasource.gwFlow.apollo.ruleType}-rules
# 从Apollo公共空间中EDU001.sentinel-rules读取网关API管理规则
spring.cloud.sentinel.datasource.gwApiGroup.apollo.ruleType = gw-api-group
spring.cloud.sentinel.datasource.gwApiGroup.apollo.namespace-name = ${sentinel.datasource.rules.apollo.namespace-name}
spring.cloud.sentinel.datasource.gwApiGroup.apollo.flowRulesKey = ${spring.application.name}-${spring.cloud.sentinel.datasource.gwApiGroup.apollo.ruleType}-rules# sentinel看板的地址
spring.cloud.sentinel.transport.dashboard = 112.74.98.151:80
# 开启对sentinel看板的饥饿式加载
spring.cloud.sentinel.eager = true# 此项为该项目在配置中心的项目名
app.id=gateway-bbk
# 加载的配置文件名,需引入 sentinel-dashboard 配置的公共空间
apollo.bootstrap.namespaces=application,EDU001.sentinel-rules
apollo.bootstrap.enabled=true
# 指定apollo的注册地址:
#本地开发环境 Local environment
local.meta=http://47.112.238.105:8004
#开发联调环境 Development environment
dev.meta=http://172.18.227.113:8080
#功能验收测试环境 Feature Acceptance Test environment
fat.meta=http://172.18.227.115:8080
#生产环境 Production environment
pro.meta=http://xxxx.xxx.net

通过上述配置可以看出,我们是通过 Sentinel Client 依赖约定的配置方式,对各类规则通过命名规则进行了匹配(这里Sentinel规则的命名规则可以结合实际的管理需求进行约定,确保 sentinel-dashboard 写入与微服务读取匹配就行)!例如:如果从管理角度分类,可以加上{部门名称}.sentinel-rules,这要求创建namespace公共空间时带上部门名前缀。

4、集成测试:

4.1、新增规则:

在 sentinel-dashboard 控制台中添加新的规则:

4.2、同步至Apollo中:

在 sentinel dashiboard 控制台添加成功后,我们进入 apollo 配置中心就可以看到新增的规则已经持久化到配置中心了

参考文章:https://zhuanlan.zhihu.com/p/64892865

Sentinel-Dashboard 与 apollo 规则的相互同步相关推荐

  1. Spring Cloud Alibaba基础教程:Sentinel Dashboard中修改规则同步到Apollo

    在之前的两篇教程中我们分别介绍了如何将Sentinel的限流规则存储到Nacos和Apollo中.同时,在文末的思考中,我都指出了这两套整合方案都存在一个不足之处:不论采用什么配置中心,限流规则都只能 ...

  2. Sentinel Dashboard 中修改规则同步到 Nacos

    点击蓝色"程序猿DD"关注我哟 加个"星标",不忘签到哦 上一篇我们介绍了如何通过改造Sentinel Dashboard来实现修改规则之后自动同步到Apoll ...

  3. Sentinel(二十六)之Sentinel Dashboard中修改规则同步到Nacos

    转载自  Spring Cloud Alibaba基础教程:Sentinel Dashboard中修改规则同步到Nacos 上一篇我们介绍了如何通过改造Sentinel Dashboard来实现修改规 ...

  4. Spring Cloud Alibaba基础教程:Sentinel Dashboard中修改规则同步到Nacos

    上一篇我们介绍了如何通过改造Sentinel Dashboard来实现修改规则之后自动同步到Apollo.下面通过这篇,详细介绍当使用Nacos作为配置中心之后,如何实现Sentinel Dashbo ...

  5. Sentinel(二十四)之Sentinel Dashboard中修改规则同步到ZooKeeper

    转载自  Springboot使用Sentinel限流,集成zookeeper完成规则的持久化 上一篇简单介绍了sentinel限流的基本配置和使用,这一篇我们来稍微深入一点,看看如何将zookeep ...

  6. Sentinel(二十五)之Sentinel Dashboard同步Apollo存储规则

    转载自   Spring Cloud Alibaba基础教程:Sentinel Dashboard同步Apollo存储规则 在之前的两篇教程中我们分别介绍了如何将Sentinel的限流规则存储到Nac ...

  7. Spring Cloud Alibaba基础教程:Sentinel Dashboard同步Apollo存储规则

    点击蓝色"程序猿DD"关注我哟 加个"星标",不忘签到哦 在之前的两篇教程中我们分别介绍了如何将Sentinel的限流规则存储到Nacos和Apollo中.同时 ...

  8. 阿里Sentinel控制台源码修改-对接Apollo规则持久化

    改造背景 前面我们讲解了如何对接Apollo来持久化限流的规则,对接后可以直接通过Apollo的后台进行规则的修改,推送到各个客户端实时生效. 但还有一个问题就是Sentinel控制台没有对接Apol ...

  9. Spring Cloud Alibaba基础教程:Sentinel使用Nacos存储规则

    点击蓝色"程序猿DD"关注我哟 加个"星标",不忘签到哦 通过上一篇<使用Sentinel实现接口限流>的介绍,相信大家对Sentinel已经有了初 ...

最新文章

  1. CentOS7 network
  2. 在mysql-workbench中运行set和declare并且观察区别
  3. 观察+|腾讯网易终获游戏版号,但all in 游戏时代已结束
  4. 电子商务系统的设计与实现(九):后端管理系统功能细化
  5. 前端学习(1904)vue之电商管理系统电商系统之修改用户的操作
  6. 内部类(innerclasses)
  7. 推荐系统整体框架概览
  8. Mozilla 发布新 Firefox 用户信息反跟踪策略
  9. java全局变量加锁_Java锁Synchronized,对象锁和类锁举例
  10. 疯狂Android讲义
  11. ijkplayer框架详解
  12. android平板电脑浏览器,安卓平板用什么浏览器
  13. imple introduction to LDD
  14. 一看就懂【来自英雄联盟盖伦的怒吼】与 Python 详解设计模式(二)观察者模式...
  15. 设置文字为计算机屏幕保护,win10系统设置炫酷三维文字屏幕保护的具体技巧
  16. 应届生找互联网工作及实习指北
  17. 企业微信社群该如何引流
  18. 把照片做成计算机符号,把家驹的照片做成了符号的形式
  19. 安卓软件开发你知道需要学什么吗,看这里?
  20. 创建数据库,有次要文件的数据库,以及给现有数据库添加次要数据库,

热门文章

  1. sklearn 主成分分析法 PCA和IPCA
  2. 降低百倍时间步,精度媲美传统神经网络:上交等机构提出ANN-SNN转换框架
  3. 高德技术开放日 | 聊聊技术与成长那些事,大量实习岗、社招岗开放
  4. NeurIPS 2020 | 利用像素级别循环一致性解决领域自适应语义分割问题
  5. 清华大学王晨阳:轻量级Top-K推荐框架及相关论文介绍
  6. BERT or XLNet,围观NLP巅峰烧钱大战。技术发展太快,如何才能跟得上节奏?
  7. ACM公选课第七节DP基础2+3 2020.4.21-5.10补
  8. HDU 1556 前缀和 树状数组 线段树
  9. Show Attend and Tell的词表
  10. ios滚动条影响父页面 vue_父元素设置overflow:scroll时vuedraggable组件出现奇怪效果的解决方案...