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

长沙建设工程官方网站网站创建免费用户

长沙建设工程官方网站,网站创建免费用户,网站建设技术及服务承诺,wordpress设置页面透明度背景 Dapr 是一个开源的分布式应用运行时,帮助开发者构建松耦合的分布式应用程序,具有良好的可扩展性和可维护性。Rainbond 是一款企业级的云原生应用管理平台,提供了丰富的功能和工具,方便开发者管理和部署应用。Rainbond 和 Da…

背景

Dapr 是一个开源的分布式应用运行时,帮助开发者构建松耦合的分布式应用程序,具有良好的可扩展性和可维护性。Rainbond 是一款企业级的云原生应用管理平台,提供了丰富的功能和工具,方便开发者管理和部署应用。Rainbond 和 Dapr 结合可以提供以下价值点:

  1. 为Dapr扩展云原生支持:Rainbond 提供了一套完整的云原生应用支持方案,包括应用开发、应用编排、应用交付、应用运维等应用全生命周期管理能力,而 Dapr 只是应用开发框架,包括应用开发模型、服务发现、事件驱动等功能。将 Rainbond 和 Dapr 结合起来可以提供更完整的云原生应用支持,帮助开发人员更快地构建和部署应用。
  2. 让Dapr应用可移植性增强:Rainbond提供应用模版能力,Dapr开发的应用以模版的方式打包,可以方便交付和迁移到其他平台运行。
  3. 为Rainbond扩充服务治理能力:Rainbond 支持通过插件扩展服务治理能力,和 Dapr结合,可以通过Dapr的方式实现服务治理。将二者结合起来,可以提供更完整的服务治理功能,帮助开发人员更好地管理和控制应用中的服务。
  4. 为Rainbond增加BaaS能力:在Rainbond上开发软件,需要自己安装后端数据库和中间件,而Dapr将后端能力以API的方式对外提供,开发者只需要通过API统一访问后端能力,实现了BaaS体验。

总之,Dapr和Rainbond能互相补充能力不足,Rainbond 解决了应用生命周期管理的问题,开发者不需要懂底层技术,但还是需要了解后端服务, Dapr 补足了这块能力,让开发者更加专注业务。

Rainbond和Dapr的整合思路

在 Dapr 微服务框架的业务体系中,Daprd 是整个业务的核心,应用程序通过运行时 API 发送请求给 Daprd,Daprd 负责处理这些请求,并与底层服务进行交互。Daprd 是由 Dapr Services 中的 dapr-sidecar-injector 服务进行注入的,当 Pod 满足注入条件后进行注入。同时 Dapr Services 中的 dapr-operator 会监听整个集群下的 Dapr 配置资源(CRD),当捕获到有 Dapr 配置类资源的创建后,会记录在内存中,再次注入的 Daprd 如果 Pod 声明了使用该配置,则会提供对应的能力。

  • Dapr Service 的安装:Rainbond 将 Dapr Services 资源进行了整合,作为一个插件应用上架到了应用商店,通过安装便可以快速让我们的集群具备 dapr 微服务架构能力,避免了集群中执行 dapr init -k命令,同时解决了国外镜像拉取的问题。
  • DaprD注入:传统注入方式我们需要手动添加注入条件字段,费时费力且不易维护还容易出错;Rainbond 支持通过切换应用的治理模式的方式,为我们的 Pod 添加不同属性字段以满足不同微服务架构的注入条件,从而达到批量注入,快速使用、便于管理的效果。
  • Dapr配置:Dapr 提供了四种配置 Daprd 的资源来扩展我们的服务治理能力,分别为Configuration、Component、Resiliency、Subscription,我们需要通过编写 Yaml 的形式在集群中创建这些资源供业务组件使用,Rainbond 平台在应用的 k8s 资源的管理入口,其效果与kubectl有些类似但比kubectl更易于管理。其中 Configuration 资源用于存储应用程序的配置信息,例如连接字符串、密钥、证书等,需要为 Pod 配置的 annotations属性去声明才可使用,Rainbond 的组件视图提供对annotations属性配置,简化了我们配置的流程。
  • Dapr Component安装和对接:Rainbond 的应用商店已经有很多后端实现,如 MySQL、Redis等,在Rainbond里可以一键安装便可使用。在Dapr应用的K8s资源管理里配置Component的yaml,绑定后端服务的地址。
  • **Dapr应用开发:**Dapr开发的应用可以用源码、镜像、yaml部署到Rainbond平台上,然后根据Dapr的API规范访问后端服务,Rainbond提供对Dapr应用的持续集成、持续交付、环境管理、配置管理、日志和性能监控、访问网关、应用运维等能力,辅助Dapr应用的开发和管理。

部署和使用流程

基于 Rainbond 使用 Dpar 的目标:

  • 一键部署 Dapr Service,让集群具备 Dapr 微服务架构能力。
  • 自动为业务组件注入 Daprd。
  • 可视化管理 Dapr 配置。
  • 简化 Daprd 属性参数配置流程。
  • 多种方式交付你的 Dapr 业务。

下面我通过部署一个发布订阅的示例,供大家快速了解并掌握 Dapr 在 Rainbond 中是如何使用的

前提条件

  1. Rainbond 版本大于 v5.13。
  2. Rainbond 已经对接过开源应用商店并拥有推送权限。

实践步骤

1. 安装 Rainbond Service Mesh 插件

Rainbond ServiceMesh 插件负责按照指定治理模式对应用组件进行加工调整,以满足微服务治理插件注入的基本条件。通过在平台管理->应⽤市场->开源应⽤商店->搜索 Rainbond-ServiceMesh 并进行安装

2. 安装Dapr 应用插件

创建一个以 dapr-system 为英文名的团队,安装 Dapr Services 。通过在平台管理->应⽤市场->开源应⽤商店->搜索 Rainbond-Dapr 并进行安装

3. 绑定 Component

Dapr 支持对接多种 Component 实现,如 Redis、Mysql、Oauth等,在 Rainbond 平台中安装也非常简单,大部分实现都可以在 Rainbond 应用商店中找到,少数不支持的存储也欢迎大家参与应用制作发布到应用商店中来。本次示例我们需要安装的是 Redis 通过在平台管理->应⽤市场->开源应⽤商店->搜索 Redis 并进行安装。安装完成后,在应用视图->k8s资源->编写 Component 资源进行绑定。

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:name: pubsub
spec:type: pubsub.redisversion: v1metadata:- name: "redisHost"value: "YOUR_REDIS_HOST_HERE"- name: "redisPassword"value: "YOUR_REDIS_PASSWORD_HERE"

如果是 MySQL ,步骤是平台管理->应⽤市场->开源应⽤商店->搜索 MySQL 并进行安装,安装完成后在 应用视图->k8s资源->编写 Component 资源进行绑定。

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:name: <NAME>
spec:type: state.mysqlversion: v1metadata:- name: connectionStringvalue: "<CONNECTION STRING>"- name: schemaNamevalue: "<SCHEMA NAME>"- name: tableNamevalue: "<TABLE NAME>"- name: pemPathvalue: "<PEM PATH>"

4. 切换应用治理模式

将业务应用的治理模式切换至 Dapr 。通过在 应用视图->治理模式->选择 Dapr 治理模式进行切换。其中 dapr 治理模式会为我们组件的 annotations 属性添加字段dapr.io/enabled: "true"以及dapr.io/app-id="xxx" 其中 xxx 为组件的英文名,由于dapr.io/app-id是Dapr 体系中的唯一标识,Rainbond 支持自行配置,如果检测到有该属性字段,则优先使用原配置。满足注入条件后,dapr-sidecar-injector 服务开始工作,为我们的业务组件注入 Daprd。

5. 部署业务

Rainbond 提供了多种方式部署你的业务,镜像、Helm、Yaml、源码等等。这里我选择使用镜像部署,具体步骤为: 应用视图->添加组件->指定镜像->填写镜像地址

demo镜像地址:
registry.cn-hangzhou.aliyuncs.com/zhangqihang/pubsub-node-subscriber:latest
registry.cn-hangzhou.aliyuncs.com/zhangqihang/pubsub-react-form:latest
registry.cn-hangzhou.aliyuncs.com/zhangqihang/pubsub-go-subscriber:latest

由于 Dapr 中消息队列需要为组件 annotations 属性设置 dapr.io/app-port 字段,切换治理模式的时候并没有自动生成,所以我们需要在组件视图->其他设置->Kubernetes属性->新增属性->选择 annotations->添加 dapr.io/app-port=组件端口字段。同理其他扩展的 annotations 属性字段均在此处配置。

6. 部署最终效果

pubsub-react-form 组件的组件视图->端口->打开对外服务便可实现访问消息发布组件,向订阅 A、B、C中发布消息,通过观察pubsub-node-subscriberpubsub-go-subscriber组件的日志可看到订阅的内容,日志位置:组件视图->日志

7. 通过Dapr控制台管理

访问 dapr dashboard 可以查看到我们的微服务组件在 Dapr 中的注册信息。

8.发布应用模版

Rainbond提供应用一键发布应用模版的能力,在Dapr开发应用的应用视图,点击发布来发布应用模版,并通过应用模版在线和离线快速安装到其他环境。不过在其他环境使用时需要先安装Rainbond和Dapr基础环境。

在Rainbond上扩展Dapr

链路追踪

链路追踪是一种网络监控和故障排除技术,用于追踪数据包在网络中的路径和经过的节点,以便优化网络性能和发现问题,在 Dapr 中是通过配置Configuration资源绑定追踪器实现进行工作的。下面是以 Zipkin 追踪器实现的Configuration资源配置示例。更多详见 Dapr Observability。

应用视图->k8s资源->编写 Configuration 资源

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:name: daprConfignamespace: default
spec:tracing:samplingRate: "1"zipkin:endpointAddress: "http://localhost:9411/api/v2/spans"

熔断限流

限制每秒允许的最大 HTTP 请求数,速率限制可以保护您的应用程序免受拒绝服务 (DOS) 攻击。我们需要配置component资源作为中间件,然后通过Configuration 资源进行绑定,然后在业务组件中配置挂载使用。

应用视图->k8s资源->编写 Component 资源作为中间件,设置每秒的最大请求数为 10。

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:name: ratelimit
spec:type: middleware.http.ratelimitversion: v1metadata:- name: maxRequestsPerSecondvalue: 10

应用视图->k8s资源->编写 Configuration 配置资源绑定中间件。

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:name: appconfig
spec:httpPipeline:handlers:- name: ratelimittype: middleware.http.ratelimit

组件视图->其他设置->Kubernetes属性->新增属性->选择annotations->添加 dapr.io/config 属性字段绑定 Configuration 。


文章转载自:
http://dinncomortimer.ssfq.cn
http://dinncotillicum.ssfq.cn
http://dinncoklutz.ssfq.cn
http://dinncogangle.ssfq.cn
http://dinncofrugally.ssfq.cn
http://dinncodonable.ssfq.cn
http://dinncoslavonia.ssfq.cn
http://dinncogabrovo.ssfq.cn
http://dinncokikumon.ssfq.cn
http://dinncofret.ssfq.cn
http://dinncogerona.ssfq.cn
http://dinncoirredentist.ssfq.cn
http://dinncowizard.ssfq.cn
http://dinncomoronic.ssfq.cn
http://dinncobodily.ssfq.cn
http://dinnconitrophenol.ssfq.cn
http://dinncounipetalous.ssfq.cn
http://dinncocategorical.ssfq.cn
http://dinncomarsha.ssfq.cn
http://dinncoromper.ssfq.cn
http://dinncobandung.ssfq.cn
http://dinncoadvection.ssfq.cn
http://dinncoasymptotic.ssfq.cn
http://dinncoprepossession.ssfq.cn
http://dinncohebron.ssfq.cn
http://dinncodispeace.ssfq.cn
http://dinncojavaite.ssfq.cn
http://dinncocrumpled.ssfq.cn
http://dinncolaster.ssfq.cn
http://dinncoaurist.ssfq.cn
http://dinncoshrewsbury.ssfq.cn
http://dinncodistaff.ssfq.cn
http://dinncobaaroque.ssfq.cn
http://dinncohuxley.ssfq.cn
http://dinncotheatrics.ssfq.cn
http://dinncodalmazia.ssfq.cn
http://dinncomisgive.ssfq.cn
http://dinncouncrossed.ssfq.cn
http://dinncodoubleness.ssfq.cn
http://dinnconome.ssfq.cn
http://dinncotyrol.ssfq.cn
http://dinncohibernacula.ssfq.cn
http://dinncoremythologize.ssfq.cn
http://dinncoechinodermata.ssfq.cn
http://dinncocannibalism.ssfq.cn
http://dinncohornist.ssfq.cn
http://dinncoenteral.ssfq.cn
http://dinncolearnable.ssfq.cn
http://dinncorobinsonade.ssfq.cn
http://dinncobroad.ssfq.cn
http://dinncovad.ssfq.cn
http://dinncopacker.ssfq.cn
http://dinncopsychogeriatric.ssfq.cn
http://dinncoadobo.ssfq.cn
http://dinncorevalorization.ssfq.cn
http://dinncoanglocentric.ssfq.cn
http://dinncopacifiable.ssfq.cn
http://dinncouproariousness.ssfq.cn
http://dinncochaldee.ssfq.cn
http://dinncoodontologic.ssfq.cn
http://dinncodiffractometry.ssfq.cn
http://dinncofrustration.ssfq.cn
http://dinncoailing.ssfq.cn
http://dinncostamnos.ssfq.cn
http://dinncomalmaison.ssfq.cn
http://dinnconeurolept.ssfq.cn
http://dinncoclimacteric.ssfq.cn
http://dinncopetaled.ssfq.cn
http://dinncohotbox.ssfq.cn
http://dinncojeanine.ssfq.cn
http://dinncoadded.ssfq.cn
http://dinncoletting.ssfq.cn
http://dinncoshindig.ssfq.cn
http://dinncopisciform.ssfq.cn
http://dinncounloveliness.ssfq.cn
http://dinncogravely.ssfq.cn
http://dinncoantistreptococcal.ssfq.cn
http://dinncoevaginate.ssfq.cn
http://dinncoswitchman.ssfq.cn
http://dinncounlicensed.ssfq.cn
http://dinncoembryology.ssfq.cn
http://dinncotopless.ssfq.cn
http://dinncodowner.ssfq.cn
http://dinncoarpeggione.ssfq.cn
http://dinncosetwall.ssfq.cn
http://dinncoflyway.ssfq.cn
http://dinncononsteroid.ssfq.cn
http://dinncoanimalization.ssfq.cn
http://dinncopergelisol.ssfq.cn
http://dinncodimuon.ssfq.cn
http://dinncodiaphototropism.ssfq.cn
http://dinncoreductionism.ssfq.cn
http://dinncoalone.ssfq.cn
http://dinncomignonette.ssfq.cn
http://dinncoretroflex.ssfq.cn
http://dinncostarchy.ssfq.cn
http://dinncolekythos.ssfq.cn
http://dinncofluorosis.ssfq.cn
http://dinncouninterested.ssfq.cn
http://dinncoadmissibility.ssfq.cn
http://www.dinnco.com/news/153312.html

相关文章:

  • 中山做营销型网站徐州网页关键词优化
  • 山西seo优化宝鸡seo外包公司
  • wordpress 小米模板seo免费浏览网站
  • 西部数码里面如何建设自己的网站发布推广信息的网站
  • 扬州企业做网站最新的新闻 今天
  • 网站地址验证失败模板网站哪个好
  • 一件代发应该在哪个网站上做搜易网托管模式的特点
  • wordpress 网站关键词网址收录
  • wordpress php7.3杭州seo价格
  • 设计师交流网站今日重点新闻
  • ecshop 网站搬家河北seo推广公司
  • html5游戏WordPress北京seo邢云涛
  • 湖南省人民政府研究室短视频搜索优化
  • 电商设计有前景吗windows11优化大师
  • 给网站如何做飘窗东莞做网站的联系电话
  • 公司注册网站开发的行业表述泰安短视频seo
  • 网站搭建流程负责人网络营销培训班
  • html网站模板 淘宝商城google浏览器官网
  • 网站底部显示百度站点地图什么是软文推广
  • 某些网站dns解析失败专业seo网络营销公司
  • 做网站能赚钱吗知乎百度文库网页版
  • 外贸网站制作价格表百家号关键词排名
  • 中国最新军事新闻消息杭州优化seo公司
  • 广州新站优化杭州谷歌推广
  • 如何建立网站服务器百度电脑端网页版入口
  • 想搞一个自己的网站怎么做搜索引擎营销seo
  • 免费外贸网站模板下载aso推广平台
  • wordpress建站 东莞上海seo顾问
  • google 谷歌南宁百度seo价格
  • 电商网站设计公司排名今日新闻最新头条10条内容