sentinel原理源码分析系列(二)-动态规则和transport

本文是sentinel原理源码分析系列第二篇,分析两个组件,动态配置和transport

动态规则

Sentinel提供动态规则机制,依赖配置中心,如nacos,zookeeper,组件支持动态配置,模板类型为规则,支持动态规则

上图是动态配置模型

PropertyListener 用户(sentinel的插槽)实现,监听规则变更通知,变更是全量DynamicSentinelProperty 持有PropertyListener,支持多个,规则数据源实现利用自身的发现机制,当规则配置变更,调用DynamicSentinelProperty的updateValue,后者通知监听器

下图是zookeeper规则数据源实现,使用curator监听规则znode的变更

transport

transport是一个嵌入到保护资源内的组件,dashboard通过该组件拉取资源的metrics

server 内置远程服务,有3个实现,netty,socket,web mvc

dispatcher负责识别和分发请求到command处理器,后者实际处理请求,支持用户可实现自身的处理器

心跳功能,通过该功能注册到dashboard,构建机器/app资料库(discovery)

Sentinel提供SentinelApiClient访问transport

NEXT 下一篇介绍sentinel的启动和初始化

相关推荐
小样vvv1 天前
【分布式】深入剖析 Sentinel 限流:原理、实现
分布式·c#·sentinel
无眠_1 天前
【Spring Boot 与 Spring Cloud 深度 Mape 之七】服务容错与流量防护:Sentinel 全方位实战
spring boot·spring cloud·sentinel
点点滴滴的记录2 天前
Sentinel 相关知识点
java·微服务·sentinel
上等猿3 天前
Sentinel
sentinel
小马爱打代码3 天前
Sentinel 限流利器(功能以及源码解析)
sentinel
半导体郗3 天前
springboot使用阿里限流框架-sentinel
spring boot·后端·sentinel
宋发元9 天前
Redis Sentinel 详解
redis·bootstrap·sentinel
hycccccch9 天前
熔断降级(Sentinel解决)
笔记·sentinel
GIS工具-gistools20219 天前
哨兵-6 (Sentinel-6)
大数据·sentinel·gis
IT成长日记11 天前
Redis哨兵模式(Sentinel)高可用方案介绍与配置实践
redis·sentinel·高可用·哨兵模式