Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The way Sentinel Dashboard integrates Zookeeper persistence

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains the "Sentinel Dashboard integration Zookeeper persistence way", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "Sentinel Dashboard integration Zookeeper persistence way"!

Integration mode

Copy the file corresponding to the test module to the corresponding location of main, and delete the imported test scope

FlowControllerV2 modifies @ Qualifier of ruleProvider and rulePublisher to copy FlowRuleZookeeperProvider and FlowRuleZookeeperPublisher

@ Autowired@Qualifier ("flowRuleZookeeperProvider") private DynamicRuleProvider ruleProvider;@Autowired@Qualifier ("flowRuleZookeeperPublisher") private DynamicRulePublisher rulePublisher

Static file configuration modification

At this point, after packaging, you can directly modify the rules in the console and write them to the zk.

The above modification is only for FlowControllerV2. The gateway traffic control uses GatewayFlowRuleController, and the corresponding entity is different. Refer to the above modification to add GatewayFlowRuleZookeeperProvider and GatewayFlowRuleZookeeperPublisher, and modify the GatewayFlowRuleController persistence mode.

List.json query directly query zk data

/ / List rules = sentinelApiClient.fetchGatewayFlowRules (app, ip, port). Get (); List rules = ruleProvider.getRules (app)

Synchronous persistence of zk after memory storage of new.json, save.json, delete.json

Entity = repository.save (entity); publishRules (entity.getApp ()); / * zk push rules * @ param app * @ throws Exception * / private void publishRules (/ * @ NonNull*/ String app) throws Exception {List rules = repository.findAllByApp (app); rulePublisher.publish (app, rules) } Thank you for your reading. the above is the content of "Sentinel Dashboard Integration Zookeeper persistence". After the study of this article, I believe you have a deeper understanding of the way Sentinel Dashboard integrates Zookeeper persistence, and the specific usage still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report