alibaba / Sentinel

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
https://sentinelguard.io/
Apache License 2.0
22.45k stars 8.04k forks source link

How to do persistence for parameter flow rules and cluster config #414

Closed Wizzercn closed 5 years ago

Wizzercn commented 5 years ago

Issue Description

Type: feature request

Describe what happened (or what feature you want)

已经对流控规则、降级规则、系统规则、授权规则,进行读写持久化,不知道集群流控的配置和热点规则,如何进行持久化?

How to do persistence for parameter flow rules and cluster config?

Describe what you expected to happen

源码见这里 (The source code is here): https://github.com/nutzam/nutzboot/blob/dev/nutzboot-starter/nutzboot-starter-sentinel-dubbo/src/main/java/org/nutz/boot/starter/sentinel/SentinelStarter.java

Tell us your environment

Sentinel 1.4.1

sczyh30 commented 5 years ago

Hi, we support dynamic configuration for parameter flow rules and cluster config:

For cluster embedded mode, here is a demo: https://github.com/alibaba/Sentinel/tree/master/sentinel-demo/sentinel-demo-cluster/sentinel-demo-cluster-embedded

Wizzercn commented 5 years ago

I want to store the cluster configuration info in redis,and from redis,how do it?

Wizzercn commented 5 years ago
FlowRuleManager.register2Property(redisDataSource.getProperty());
WritableDataSourceRegistry.registerFlowDataSource(wds);

for example FlowRule's read and write sources can be changed. How do you do Cluster ?

sczyh30 commented 5 years ago

For reading configuration, you could register dynamic data sources. For publishing configurations you might need to refactor the Sentinel dashboard.