当前位置: 首页 > news >正文

电子商务网站开发基础专业购物网站建设哪家好

电子商务网站开发基础,专业购物网站建设哪家好,电子商务网站建设哪家好,wordpress学习pdf文章目录 1. RuoYi 实现了对服务的限流2. 网关与普通服务的限流区别2.1. 引入的组件有差别2.2. 配置文件有差别 3. 注意事项 备注#xff1a; 1、RuoYi 网关默认只在 nacos 配置中心的 Sentinel 限流配置中配置了对“服务限流”#xff0c;而没有详细控制到限流的 URL。 2、各… 文章目录 1. RuoYi 实现了对服务的限流2. 网关与普通服务的限流区别2.1. 引入的组件有差别2.2. 配置文件有差别 3. 注意事项 备注 1、RuoYi 网关默认只在 nacos 配置中心的 Sentinel 限流配置中配置了对“服务限流”而没有详细控制到限流的 URL。 2、各个服务虽然引入了 Sentinel 相关组件但是并没有对各个具体服务做具体的 URL 限流配置 3、如果用户需要对 URL 限流请自行在服务中配置 Sentinel dashboard 连接即可。 本文主要介绍如何用Sentinel控制网关流控和网关服务与普通服务流控的不同点。 1. RuoYi 实现了对服务的限流 在 pom.xml 引入组件 !-- SpringCloud Alibaba Nacos -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-discovery/artifactId /dependency!-- SpringCloud Alibaba Nacos Config -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-config/artifactId /dependency!-- SpringCloud Alibaba Sentinel -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-sentinel/artifactId /dependency!-- SpringCloud Alibaba Sentinel Gateway -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-alibaba-sentinel-gateway/artifactId /dependency!-- 限流规则持久化到nacos -- dependencygroupIdcom.alibaba.csp/groupIdartifactIdsentinel-datasource-nacos/artifactId /dependency配置 bootstrap.yml 文件 spring:application:name: sentinel-servicecloud:nacos:discovery:server-addr: localhost:8848 #配置Nacos地址sentinel:transport:dashboard: localhost:8080 #配置sentinel dashboard地址port: 8719# 把流控规则nacos配置持久化datasource:ds1:nacos:server-addr: 127.0.0.1:8848dataId: sentinel-ruoyi-gatewaygroupId: DEFAULT_GROUPdata-type: json# 网关的流控类型才是gw-flow普通是flowrule-type: gw-flowsentinel-ruoyi-gateway 文件的详细内容 在 nacos 的 sentinel-ruoyi-gateway文件中配置如如下内容完成了对 4 个微服务的“总体流控”。 [{resource: ruoyi-auth,count: 500,grade: 1,limitApp: default,strategy: 0,controlBehavior: 0},{resource: ruoyi-system,count: 1000,grade: 1,limitApp: default,strategy: 0,controlBehavior: 0},{resource: ruoyi-gen,count: 200,grade: 1,limitApp: default,strategy: 0,controlBehavior: 0},{resource: ruoyi-job,count: 300,grade: 1,limitApp: default,strategy: 0,controlBehavior: 0} ]2. 网关与普通服务的限流区别 限流是网关的重要职责之一“对网关限流”跟“服务的URL限流”并不是完全一样主要体现在以下几个方面。 2.1. 引入的组件有差别 普通需要限流服务引入的组件 !-- SpringCloud Alibaba Nacos -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-discovery/artifactId /dependency!-- SpringCloud Alibaba Nacos Config -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-config/artifactId /dependency!-- SpringCloud Alibaba Sentinel -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-sentinel/artifactId /dependency!-- 限流规则持久化到nacos -- dependencygroupIdcom.alibaba.csp/groupIdartifactIdsentinel-datasource-nacos/artifactId /dependency在pom.xml中添加相关依赖这里我们使用Nacos作为注册中心所以需要同时添加Nacos的依赖 有 nacos-discovery、nacos-config、alibaba-sentinel3 个组件。 网关需要限流服务引入的组件 !-- SpringCloud Alibaba Nacos -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-discovery/artifactId /dependency!-- SpringCloud Alibaba Nacos Config -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-config/artifactId /dependency!-- SpringCloud Alibaba Sentinel -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-sentinel/artifactId /dependency!-- SpringCloud Alibaba Sentinel Gateway -- dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-alibaba-sentinel-gateway/artifactId /dependency!-- 限流规则持久化到nacos -- dependencygroupIdcom.alibaba.csp/groupIdartifactIdsentinel-datasource-nacos/artifactId /dependency比普通服务的限流多了一个 sentinel-gateway组件。 2.2. 配置文件有差别 下面的配置是连接 Sentinel dashboard 控制台这个配置是一样的。 spring:application:name: sentinel-servicecloud:nacos:discovery:server-addr: localhost:8848 #配置Nacos地址sentinel:transport:dashboard: localhost:8080 #配置sentinel dashboard地址port: 8719普通服务的 nacos 持久化配置 spring:cloud:sentinel:datasource:ds1:nacos:server-addr: localhost:8848dataId: ${spring.application.name}-sentinelgroupId: DEFAULT_GROUPdata-type: jsonrule-type: flow网关服务的 nacos 持久化配置 spring:cloud:sentinel: # 把流控规则nacos配置持久化datasource:ds1:nacos:server-addr: 127.0.0.1:8848dataId: sentinel-ruoyi-gatewaygroupId: DEFAULT_GROUPdata-type: json# 网关的流控类型才是gw-flow普通是flowrule-type: gw-flow注意点通过Spring Cloud Alibaba Sentinel 数据源模块网关流控规则数据源类型是 gw-flow 而不是 flow。 3. 注意事项 应该是各个服务管理自己 uri 的流控网关总体管理各个服务的流控。 资料参考只需三步实现Gateway结合Sentinel实现无侵入网关限流注意避坑! 避坑点1通过Spring Cloud Alibaba接入sentinel需要将spring.cloud.sentinel.filter.enabled 配置项置为 false网关流控默认粒度为route和自定义API分组维度不支持URL粒度 避坑点 2通过Spring Cloud Alibaba Sentinel 数据源模块网关流控规则数据源类型是 gw-flow 而不是flow
http://www.pierceye.com/news/99955/

相关文章:

  • 建设银行网站安全性分析网络推广服务平台
  • 大型购物网站建设福建微网站建设公司
  • 做网站软件j程序员找工作网站
  • 济南网站建设系统画册设计公司宣传册
  • 上海网站设计方案家纺网站建设
  • 衡水精品网站建设游戏广告推广平台
  • 响应式企业网站建设营销战略
  • wordpress离线浏览搜索引擎优化包括
  • 门户网站建设需要多少呼伦贝尔市住房和城乡建设局网站
  • 静海集团网站建设住房城乡建设网站
  • 个人备案挂企业网站网站开发公司照片
  • 网站建设课程体会国内最新新闻简短
  • 网站开发大概价格最常用的网页制作软件
  • 商务网站模块设计时前台基础设施建设免费网站建设空间
  • 青海省公路工程建设总公司网站饮料公司网站模板
  • 建设部网站刘赵云网页版邮箱
  • 免费扑克网站企业网站怎么搜索优化
  • 做网站导航的厦门网站建设制作多少钱
  • 怎样免费注册网站域名鹤城建设集团网站
  • 3合1网站建设价格网站建设论坛快速建站
  • 怎样做钓鱼网站上海网站关键词排名优化报价
  • 昆明专业网站设计公司电商类网站设计模板
  • 网站流量用完了重庆网站推广
  • 网站管理助手数据库网站在建设中无法访问
  • 网站标题格式建设网站南昌
  • wordpress作企业网站好吗沈阳短视频制作公司
  • 表格网站怎么做的作文网站大全
  • 比特币网站建设专业网站建设企业网站制作
  • 故宫博物院官网网站咋做的山东省济宁市最新消息
  • 天河营销型网站建设html网页设计代码作业正能量