# sentinel-dashboard-nacos **Repository Path**: cs_sun/sentinel-dashboard-nacos ## Basic Information - **Project Name**: sentinel-dashboard-nacos - **Description**: 实现sentinel的限流和降级数据同步到nacos - **Primary Language**: Java - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-08-13 - **Last Updated**: 2021-08-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # sentinel-dashboard-nacos #### 介绍 实现sentinel的限流和降级数据持久化,用nacos来管理 #### 软件架构 基于alibaba sentinel-parent 1.7版本修改 #### 安装教程 1. 下载本工程后,mvn install打包后,运行脚本参考sentinel.bat 2. 在业务服务的pom文件引用sentinel nacos数据源配置 ``` com.alibaba.csp sentinel-datasource-nacos 1.7.0 ``` 3. 在业务服务的application.yml添加sentinel的nacos配置,参考以下写法 ``` spring: application: # 应用名称 name: gateway cloud: # 使用 Naoos 作为服务注册发现 nacos: discovery: server-addr: 127.0.0.1:8848 # 使用 Sentinel 作为熔断器 sentinel: transport: port: 8721 dashboard: 127.0.0.1:8080 datasource: #1,sentinel数据源连接nacos ds1为数据源的名称,可以随便写 , 限流配置 ds1: nacos: #nacos地址 server-addr: ${spring.cloud.nacos.discovery.server-addr} rule-type: flow dataId: ${spring.application.name}-sentinel-flow groupId: DEFAULT_GROUP data-type: json #2,sentinel ,熔断降级配置 ds2: nacos: #nacos地址 server-addr: ${spring.cloud.nacos.discovery.server-addr} #规则 rule-type: degrade #nacos中对应dataid名字 dataId: ${spring.application.name}-sentinel-degrade #组 groupId: DEFAULT_GROUP data-type: json ```