> 作者:戚文博-蚂蚁集团
Dragonfly 最新正式版本 v2.0.9 已经发布!感谢 Dragonfly 的贡献者们,同时也感谢默默支持 Dragonfly 项目的各个公有云团队。欢迎访问 **d7y.io** **[** **1]** 网站来了解详情,下面具体介绍 v2.0.9 版本带来了那些更新。

## 功能
- 下载任务可以根据优先级(Priority)进行下载。优先级可以在下载任务时 cli 中作为参数传入,也可以在 Manager Console 设置对应应用关联的优先级。具体不同优先级的功能可以参考文档 **priority protoc definition** **[** **2]** 。
- Scheduler 配置新增 PieceDownloadTimeout 字段,做用是当某个 Piece 下载超过 Timeout 时,设置对应的 Task 状态变更为失败。防止异常 Task 元信息残留在 Scheduler 中。
- GRPC 服务新增 Health Service 和 Reflection 服务。
- Manager 支持 Redis 哨兵模式(sentinal model)。
- 重构 Dynconfig 模块移除 json.Unmarshal 操作,提高 Dynconfig 模块运行时效率。并且支持通过健康检查的方式过滤异常地址服务。
- 修复当无可用服务时,GRPC 未构建哈希环所造成的异常。
- 早期版本当同一个 Task 的多个 Piece 并发下载时,Scheduler 会调度多个 Parent 给当前 Peer 进行下载,但多个 Piece 基本都会从单个 Parent 进行下载。当前版本更改多个 Piece 可以从不同的 Parent 并发下载,可以防止流量集中在部分热点 Parent,提高下载效率同时也提高了带宽平均利用率。
- Peer 调用 Manager 获取匹配的 Scheduler Cluster 的时候,如果没有匹配到任何 Scheduler Cluster,那么 Manager 会返回所有的 Scheduler Cluster 提供给 Peer。Peer 会使用 Health Check 通过的 Scheduler Cluster 地址供后续下载调度使用。
- 支持 **ORAS** **[** **3]** 客户端的回源下载协议,扩展容器镜像生态支持。
- 增加 UDP Ping 包的支持和虚拟网络拓扑的 GRPC Protoc 定义。未来会新增基于网络探测构建虚拟网络拓扑结构,提高调度算法的精 确度。
- 完成 **V2 版本的 P2P 协议** **[** **4]** 的定义。Scheduler 和 Manager 对应实现了 V2 版本的 P2P 协议的功能。未来会基于 V2 版本的 P2P 协议和 Rust 语言重写 Dfdaemon,提高客户端性能的同时能够依赖更加标准且扩展性更强的 V2 版本的 P2P 协议。
- OSS 客户端回源协议新增基于 STS 临时访问凭证来访问 OSS 源站。
- Scheduler 新增 hostTTL and hostGCInterval 配置,主要作用于 Host 元数据的释放。可以保证在 Peer 主机异常退出的情况下,仍然可以释放掉异常的 Host 元数据,防止脏数据残留。
- Manager 的 Searcher 模块新增根据 **CIDR** **[** **5]** 条件去筛选当前 Peer 匹配的 Scheduler Cluster,提供更精 确的匹配计算方式。
- 重构 V1 版本 P2P 协议的 Metric,并且新增 V2 版本 P2P 协议的 Metric,并且根据新的 Metrics 更新 **Helm Charts** **[** **6]** 的 PrometheusRule 对应的告警规则。并且重新整理 **Dragonfly Grafana Dashboards** **[** **7]** 方便用户可以一键导入 Dashboards 观测 P2P 网络流量以及服务相关数据。具体文档可以参考 **Monitoring** **[** **8]** , Grafana Dashboard 维护在项目 **dragonflyoss/monitoring** **[** **9]** 中。
版本更新包含的更多细节可以参考 **CHANGELOG** **[** **10]** 。
## 破坏性变更
老版本 Manager 由于使用了默认的 JWT Key 生成 JWT Token 会引起安全性问题,具体可以参考 **security issues** **[** **11]** 。所以 Manager 服务配置文件新增了 **JWT 配置** **[** **12]** 。所以当老版本 Manager 升级过程中需要在新版本 Manager 的配置文件中新增 JWT Key 配置,并且 JWT Key 是需要用户自己生成,具体 JWT Key 如何配置可以参考 **setting it in the Manager configuration** **[** **13]** 。
## 公有云厂商支持
- Alibaba Cloud(阿里云) - 阿里云提供安装 Dragonfly 1.x 在**容器镜像仓库 Container Registry** **[** **14]** ,使用文档可以参考 **Use P2P Acceleration in ASK** **[** **15]** 。推荐使用更加高效且稳定的 **Dragonfly 2.0** **[** **16]** ,部署文档参考 **Setup Dragonfly in Kubernetes** **[** **17]** 。
- Google Cloud Platform(GCP) - GCP 提供一键点击部署 Dragonfly 在 **Google Kubernetes Engine(GKE)** **[** **18]** 的 **Marketplace** **[** **19]** ,具体文档可以参考 **Click to Deploy Dragonfly** **[** **20]** 。
- Volcano Engine(火山引擎) - 火山引擎在容器服务(VKE) and 和镜像仓库(CR)中集成了 CNCF 孵化项目 Dragonfly,欢迎访问 **VKE** **[21** **]** & **CR** **[** **22]** 了解更多。
- Baidu AI Cloud(百度智能云) - 百度智能云提供在 **Cloud Container Engine(CCE)** **[2****3]** 一键部署 P2P 加速服务,其能力来自于 Dragonfly。
## 参考链接
- Dragonfly 官网
*<https://d7y.io/>*
- Dragonfly 仓库
*<https://github.com/dragonflyoss/Dragonfly2>*
- Dragonfly Charts 仓库
*<https://github.com/dragonflyoss/helm-charts>*
- Dragonfly Monitor 仓库
*<https://github.com/dragonflyoss/monitoring>*
- 阿里云容器仓库
*<https://www.alibabacloud.com/product/container-registry>*
- 阿里云容器服务(ACK)
*<https://www.alibabacloud.com/product/kubernetes>*
- Google Kubernetes Engine(GKE)
*<https://cloud.google.com/kubernetes-engine>*
- Google Cloud Platform(GCP) Dragonfly Marketplace
*<https://console.cloud.google.com/marketplace/product/google/dragonfly>*
- 火山引擎容器服务(VKE)
*<https://www.volcengine.com/product/vke>*
- 火山引擎容器仓库(CR)
*<https://www.volcengine.com/product/cr>*
- 百度智能云容器服务(CCE)
*<https://intl.cloud.baidu.com/product/cce.html>*
**
**
**相关链接:**
[1] Dragonfly 官网
*<https://d7y.io/>*
[2] priority protoc definition
*<https://github.com/dragonflyoss/api/blob/main/pkg/apis/common/v2/common.proto#L74>*
[3] ORAS
*<https://github.com/oras-project/oras>*
[4] V2 版本的 P2P 协议
*<https://github.com/dragonflyoss/api/tree/main/proto>*
[5] CIDR
*<https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing>*
[6] Helm Charts
*<https://github.com/dragonflyoss/helm-charts>*
[7] Dragonfly Grafana Dashboards
*<https://grafana.com/grafana/dashboards/?search=dragonfly>*
[8] Monitoring
*<https://d7y.io/docs/concepts/observability/monitoring>*
[9] Dragonfly Monitor
*<https://github.com/dragonflyoss/monitoring>*
[10] CHANGELOG
*<https://github.com/dragonflyoss/Dragonfly2/blob/main/CHANGELOG.md>*
[11] security issues
*<https://github.com/dragonflyoss/Dragonfly2/security/advisories/GHSA-hpc8-7wpm-889w>*
[12] JWT 配置
*<https://github.com/dragonflyoss/Dragonfly2/pull/2161>*
[13] setting it in the Manager configuration
*<https://github.com/dragonflyoss/d7y.io/blob/main/docs/reference/configuration/manager.md?plain=1#L56>*
[14] 阿里云镜像仓库
*<https://www.alibabacloud.com/product/container-registry>*
[15] Use P2P Acceleration in ASK
*<https://www.alibabacloud.com/help/en/container-registry/latest/use-the-p2p-acceleration-feature-in-ask-and-ack-clusters>*
[16] Dragonfly 仓库
*<https://github.com/dragonflyoss/Dragonfly2>*
[17] Setup Dragonfly in Kubernetes
*<https://d7y.io/docs/getting-started/quick-start/kubernetes/>*
[18] Google Kubernetes Engine(GKE)
*<https://cloud.google.com/kubernetes-engine>*
[19] Google Cloud Platform(GCP) Marketplace
*<https://console.cloud.google.com/marketplace/product/google/dragonfly>*
[20] Google Cloud Platform(GCP) Dragonfly Marketplace*<https://console.cloud.google.com/marketplace/product/google/dragonfly>*
[21] 火山引擎容器服务(VKE)
*<https://www.volcengine.com/product/vke>*
[22] 火山引擎镜像仓库(CR)
*<https://www.volcengine.com/product/cr>*
[23] 百度智能云容器服务(CCE)
*[https://intl.cloud.baidu.com/product/cce.html](https://intl.cloud.baidu.com/product/cce.html?spm=a2c6h.13046898.0.0.23346ffa3F2Yaa)*
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69953029/viewspace-2942478/ ,如需转载,请注明出处,否则将追究法律责任。