登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 计算机类 > 计算机科学与技术 > 正文

基于P2P技术的虚拟机镜像分发系统的设计与实现毕业论文

 2021-03-14 09:03  

摘 要

伴随着网络的发展,现在的用户对形式多样的网络资源依赖程度加深,在网络带宽等资源的限制下,如何快速为用户传输这些资源成了开发人员的思考问题。

传统的文件分发系统是一种基于C/S(服务端/客户端)的计算模式,性能会随着客户端的数量急剧增加而出现瓶颈。为了解决这类问题,提高系统服务质量,只能陷入不断利用高昂的成本来部署新的分布节点的恶性循环中。

利用P2P技术,可以开发出B/S模式的文件分发系统。各个节点在P2P网络中拥有对等的地位,既扮演者服务器,又扮演着客户端的角色。这样可以利用有限的带宽,为用户提供更高传输速度的体验。

本文主要论述了一个基于P2P技术的虚拟机镜像分发系统的设计与实现,致力于开发出更高效的文件分发综合系统。本系统涉及到的技术主要有以下关键点:

第一点,采用集中式的P2P传输模式,Tracker服务器采用高效快速的Peertracker作为BitTorrent Tracker,记录每个数据中心节点的信息。与此同时,还可以搭建多个Tracker作为冗余,防止一个Tracker宕机导致集群不可用。

第二点,中心控制节点上部署了基于Django和Celery开发的综合项目程序,可以实现监控整个分发网络运行情况,分发任务的执行情况,动态扩展分发节点,下发给数据中心节点任务等功能。

第三点,在数据中心节点安装配置了Trasmission客户端,该开源软件自带网页管理界面,而且还支持API调用,有很好的可编程性。同时,在每个节点上利用Docker部署利用Flask框架编写的项目代码,使节点能够根据中心节点的调度来执行相关任务。

以上三点形成了三大个主要模块:Tracker服务器,中心控制节点,数据中心节点。本文主要讨论中心控制节点和数据中心节点的设计与实现,并着重探讨了如何结合Docker,Peertracker,Django等开源程序以及框架技术,研究出来一个搭建功能完善的综合系统的方案,并在最后分析总结了未来的工作和展望。

关键词:P2P,文件分发,虚拟机镜像,带宽

ABSTRACT

With the development of the network, the current users of various forms of network resources to rely on the degree of deepening. In the network bandwidth and other resources under the restrictions, how to quickly transfer these resources for the user has become a developer thinking.

The traditional file distribution system is based on the C / S (server / client) computing model, the performance will be a sharp increase in the number of clients and bottlenecks. In order to solve such problems, improve the quality of system services, can only be caught in the use of high cost to deploy a new distribution node in the vicious cycle.

Using P2P technology, you can develop a B / S mode file distribution system. Each node in the P2P network has a peer status, both play the server, but also play the role of the client. This can take advantage of limited bandwidth to provide users with a higher transmission speed experience.

This paper mainly discusses the design and implementation of a virtual machine based on P2P technology, and develops a more efficient document distribution system. This prototype system technology has the following key points:

The first point, the use of centralized P2P transmission mode, Tracker server using efficient and efficient Peertracker as BitTorrent Tracker, record each data center node information. At the same time, you can also build multiple Tracker as a redundant, to prevent a Tracker downtime caused the cluster is not available.

In the second step, a comprehensive project program based on Django and Celery is deployed on the central control node to monitor the operation of the entire distribution network, distribute the execution of the tasks, dynamically extend the distribution nodes, and send them to the data center node tasks.

The third point, in the data center node installation configuration Trasmission client, the open source software comes with web management interface, but also supports API calls, there is a good programmability. At the same time, using Docker on each node to deploy the project code written using the Flask framework, so that the node can be based on the central node scheduling to perform related tasks.

The above three points form three major modules: Tracker server, central control node, data center node. This paper mainly discusses the design and implementation of the nodes and data center nodes in the center, and discusses how to combine Docker, Peerracker, Django and other open source programs and framework technology to study a comprehensive system of integrated systems, and in the final analysis The future work and outlook.

KEY WORDS:P2P,file distribution,virtual machine image,bandwidth

目 录

1 绪论 1

1.1 研究背景 1

1.2 国内外研究现状 1

1.3 相关概念 2

1.3.1 BitTorrent协议 2

1.3.2 P2P网络 2

1.3.3 种子文件 3

1.3.4 BitTorrent Tracker 3

1.4 本文研究内容 4

1.5 论文的组织结构 4

2 P2P虚拟机镜像分发系统需求分析与总体架构 6

2.1 运行环境限定 6

2.2 功能定义 6

2.3 系统交互 6

2.4 系统的逻辑结构 7

2.5 系统功能模块划分 8

2.5.1 中心控制节点 8

2.5.2 数据节点 9

2.6 本章小结 10

3 中心控制节点的设计与实现 11

3.1 代码结构图 11

3.2 动态管理数据节点模块 12

3.3 种子文件操作模块 14

3.3.1 获取种子文件信息 14

3.3.2 利用节点生成种子策略 15

3.4 传输进度监控模块 16

3.4.1 监控的内容 16

3.4.2 折线图的设计 17

3.5 控制文件下载模块 17

3.6 数据库设计 17

3.7 本章小结 20

4 数据节点的设计与实现 21

4.1 代码结构图 21

4.2 Transmission的部署 21

4.2.1 环境初始化 22

4.2.2 可编程性的命令 22

4.3 生成种子文件模块 22

4.3.1 引用Celery任务机制 22

4.3.2 种子生成策略 24

4.4 任务回调模块 24

4.5 本章小结 25

5 系统实现与测试 26

5.1 系统实现 26

5.1.1 开发环境 26

5.1.2 利用Docker在数据节点上部署Agent 26

5.1.3 系统初始化 27

5.1.4 功能实现 28

5.2 系统测试 31

5.2.1 测试环境 31

5.2.2 功能测试 32

5.3 本章小结 34

6 结论和展望 35

6.1 工作总结 35

6.2 未来展望 35

参考文献 36

致谢 37

第1章 绪论

1.1 研究背景

随着云计算和大数据时代的发展,无论是对于一个企业还是对于普通用户,在与互联网产品进行交互的过程中,都会涉及许多大文件的传输。比如一些ISO系统镜像文件,一些客户定制的产品模板,少则几个G,多则几十个G。如此庞大的文件在互联网环境中的多个数据节点之间传输,如何保证其能稳定、快速地实现,最重要的是文件的完整性要求,是开发人员客观面对的问题。

但是,传统的FTP、rsync之类的文件传输方法已经无法满足当今我们快速增长的大文件传输性能要求。用户迫切需要实现全球节点之间的大文件快速、可靠的分发以及同步。因此,建立一套稳定的P2P文件传输系统具有很强的现实意义。

1.2 国内外研究现状

众所周知,云计算平台主要是以虚拟化技术整合底层的物理资源,虚拟化技术是云计算的关键技术,通过虚拟化技术,用户可以在任意的位置、使用各种终端获得服务。虚拟化资源支持服务一般思路是基于虚拟机的,通过在虚拟机系统中安装服务应用程序后,通过虚拟机网络接口提供服务。现在的虚拟机部署策略多把操作系统和应用程序预装为虚拟机镜像模板,应用模板技术来部署虚拟机[1]。从而,导致一个完整的虚拟机镜像模板文件存储容量非常大,一些大规模科学计算的专业模板文件会有十几G,设置几十个G。因此,虚拟机模板的传输时间过长是整个虚拟机部署过程中的一个瓶颈。当前的虚拟机镜像文件的传输策略为,在源主机或数据中心内部保留虚拟机的镜像,当虚拟机想迁移出来的时候,再向目标主机分发即可[2]

与P2P[3-4]技术相关的应用已经成为互联网的主要应用之一,P2P的模式也成为许多新型业务的首选模式。P2P技术被广泛应用于共享、网络电话、网络视频等领域,以分布式并行传输和资源共享的特点,为用户提供了更好的服务质量。P2P节点基本不依赖中心节点,而是依靠网络边缘节点,实现自组织与对等协作的资源发现和共享,因此拥有自组织、可扩展性、鲁棒性以及负载均衡等优势。

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图