Dragonfly
Dragonfly
介绍
用于类似于cdn分发的一个阿里云开源组件,可以分发镜像或者较大文件,利用 内网带宽。官网https://d7y.io/zh/。 感兴趣可以看看这个视频
install
|
|
访问IP:8090即可,默认是8080
username is root and password is dragonfly.
点击next, create seed
The created seed peer cluster id is 1. When deploying a seed peer instance, you need to report the seed peer cluster id associated with the seed peer instance, and the manager service address.
For details, refer to the two fields manager.addr and manager.seedPeerClusterID in the seed peer configuration.
这里提示是seed peer(用于各个客户端初始下载的)需要在绑定的时候需要设 置seed cluster集群id为1 主要改manager.addr和manager.seedPeerClusterID
继续点击next,开始创建scheduler
Create Scheduler Cluster
A scheduler cluster needs to be created in a P2P network.
Seed peer instances in the seed peer cluster associated with the scheduler cluster will become the download root node in the P2P network. The seed peer cluster field in the scheduler cluster form is the seed peer cluster associated with the scheduler clsuter in the P2P network.
The created scheduler cluster id is 1. When deploying a scheduler instance, you need to report the scheduler cluster id associated with the scheduler instance, and the manager service address. For details, refer to the two fields manager.addr andmanager.schedulerClusterID in thescheduler configuration.
也就相当于cluster需要一个scheduler,这个负责告诉各个客户端从哪下载。设 置字段manager.addr和manager.schedulerClusterID。
继续点击下一步发现提示创建好了,如图
可以发现daemon相当于客户端安装的,从对应的seed peer去获取资源,seed peer如果没有会去远程拉,比如一个镜像或者一个包或者共享存储等等。
用户可以调用daemon dfget去下载,下载可能是其他peer或者seed peer或者代理 下载或者调用三方sdk,最终注册上去
下载文件
https://github.com/dragonflyoss/Dragonfly/blob/master/docs/user_guide/download_files.md
https://github.com/dragonflyoss/Dragonfly/blob/master/docs/design/design.md
去docker的peer节点执行dfget -u=xxx
dfget is the client of dragonfly which takes a role of peer in a P2P network. When user triggers a file downloading task, dfget will download the pieces of file from other peers. Meanwhile, it will act as an uploader to support other peers to download pieces from it if it owns them. In addition, dfget has the abilities to provide more advanced functionality, such as network bandwidth limit, transmission encryption and so on.
|
|
关于dfget更多请参考dfget git
|
|
主要指定了scheduler地址
可以发现服务器上使用dfget会触发下载任务,任务触发以后再次下载就是从内 网了,这个办法理论上可以应用于包集群或者linux服务器。