seninel部署
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lin.Liang ba146765e3 Reuse connections of the same address in ZooKeeper data-source (#788) 5 yıl önce
..
src Reuse connections of the same address in ZooKeeper data-source (#788) 5 yıl önce
README.md Refactor Sentinel data source hierarchy 6 yıl önce
pom.xml Update ZooKeeper client in data-source module to 3.4.14 to fix vulnerability 5 yıl önce

README.md

Sentinel DataSource ZooKeeper

Sentinel DataSource ZooKeeper provides integration with ZooKeeper so that ZooKeeper can be the dynamic rule data source of Sentinel. The data source uses push model (listener).

To use Sentinel DataSource ZooKeeper, you should add the following dependency:

<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-datasource-zookeeper</artifactId>
    <version>x.y.z</version>
</dependency>

Then you can create an ZookeeperDataSource and register to rule managers. For instance:

// `path` is the data path in ZooKeeper
ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new ZookeeperDataSource<>(remoteAddress, path, source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {}));
FlowRuleManager.register2Property(flowRuleDataSource.getProperty());

Note: It’s not recommended to add a large amount of rules to a single path (has limitation, also leads to bad performance).

We’ve also provided an example: sentinel-demo-zookeeper-datasource.