基于OpenStack的IaaS云管理平台的设计与实现

更新时间:2023-11-18 21:40:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

火龙果?整理 uml.org.cn 编 号:

审定成绩:

重庆邮电大学 毕业设计(论文)

基于OpenStack的IaaS云管理平台的

设计(论文)题目: 设计与实现

学 院 名 称 : 学 生 姓 名 :

经济管理学院 蒋鹏

专 业 : 信息管理与信息系统 班 级 : 学 号 : 指 导 教 师 : 答辩组 负责人 :

填表时间: 年 月

重庆邮电大学教务处制

0311003 2010211547 刘进 刘进

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

毕业论文诚信声明

本人郑重声明:所呈交的毕业论文是本人在指导老师的指导下,独立研究、写作的成果。论文由本人独立完成,除文中已经明确注明引用的内容外,本论文不含任何其他个人或集体已经发表或撰写过的作品成果。

毕业论文作者签名:

年 月 日

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

摘 要

随着计算科学和商业计算的发展,使得软件模型和架构越来越快地发生变化,同时促进网格计算、并行计算、分布式计算迅速发展成为云计算。云计算主要包括基础设施即服务(IaaS),平台即服务(PaaS),软件即服务(SaaS),并通过这些技术将计算资源统一管理和调度。作为一种新的计算模型,云计算凭借其低成本、高效率得到了快速发展,也促进了近几年开源云计算架构的不断发展和完善。

OpenStack 是一个开放源的云计算项目和工具集,并且提供了关于基础设施即服务(IaaS)的解决方案。OpenStack 不仅可以快速部署全虚拟化环境,而且可以通过此环境来建立多个互联的虚拟服务器,并能够使用户快速部署应用在虚拟机上。本文旨在深入了解OpenStack的架构和其各种服务,并对各种服务深入了解,掌握各种服务的实现原理,最后亲自动手的搭建OpenStack云平台,掌握其安装的过程,并且可以对实际的部署予以指导。

【关键词】 云计算 OpenStack 云平台 Iaas

- I -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

ABSTRACT

With the development of computing scientific and commercial computing software model and architecture increasingly rapid change, while promoting grid computing, parallel computing,distributed computing has rapidly developed into cloud computing. Cloud computing, including Infrastructure as a Service (IaaS), Platform as a Service (PaaS),and Software as a Service (SaaS), provide unified management and scheduling through these technologies. As a new computing model, cloud computing has been rapidly development by virtue of its low cost, high efficiency, but also to promote the continuous development and improvement of open source cloud computing infrastructure in recent years. OpenStack is an open source cloud computing projects and tool set, and Infrastructure as a Service (IaaS) solution.The OpenStack not only can quickly deploy virtualization environment, and through this environment to create multiple interconnected virtual server, and enables users to quickly deploy applications on a virtual machine. The purpose of this paper is to a deep understanding of the architecture of it and its various services, and the various service understanding, to master the principle of various services and the final hands-on building it cloud platform, grasp its installation process, and it can give guidance for actual deployment.

【Key words】 cloud computing OpenStack cloud platform Iaas

- II -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

目 录

第一章 绪论................................................................................................................ 1

第一节 论文研究背景及意义 ............................................................................ 1 第二节 国内外研究现状 .................................................................................... 2 第三节 论文组织结构 ........................................................................................ 3 第二章 Iaas相关介绍 ................................................................................................ 4

第一节 IaaS概述 ................................................................................................. 4 第二节 IaaS服务特征及优势 ............................................................................. 4 第三节 IaaS整体架构 ......................................................................................... 5 第四节 本章小结 ................................................................................................ 6 第三章 关键技术介绍................................................................................................ 7

第一节 IaaS服务器虚拟化 ................................................................................. 7 第二节 IaaS存储虚拟化 ..................................................................................... 8 第三节 IaaS网络虚拟化 ..................................................................................... 8 第四节 本章小结 ................................................................................................ 9 第四章 OpenStack相关介绍 ................................................................................... 11

第一节OpenStack 介绍 ...................................................................................... 11

一、 OpenStack概念架构 ....................................................................... 11 二、 Openstack访问流程 ........................................................................ 12 第二节 Openstack认证服务-Keystone ............................................................ 13

一、 Keystone介绍 ................................................................................. 13 二、 Keystone概念 ................................................................................. 13 第三节 Opestack计算服务-nova ..................................................................... 14

一、 Nova简介 ........................................................................................ 14 二、 Nova 云架构 ................................................................................... 15 三、 Nova工作流程 ................................................................................ 16 第三节 OpenStack网络服务-Neutron ............................................................. 16

一、 Neutron简介 ................................................................................... 16 二、 Neutron实现原理 ........................................................................... 18 第四节 Neutron 网络创建过程 ....................................................................... 19 第五节 本章小结 .............................................................................................. 20 第五章 Openstack云平台搭建 ................................................................................ 21

- III -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

第一节 多节点安装部署 OpenStack ............................................................... 21

一、 实验环境及实验拓扑图.................................................................. 21 二、 构建过程.......................................................................................... 22 第二节 云平台搭建过程遇到的问题与解决方法 .......................................... 23

一、 Keystone的安装与问题分析 ......................................................... 23 二、 Glance 的安装与问题分析 ............................................................ 24 三、 Nova 的安装与问题分析 ............................................................... 25 第三节 本章小结 .............................................................................................. 28 第六章 Openstack云平台的测试 .................................................................... 29 第一节 对各项服务的启动测试 ...................................................................... 29 第二节 创建instance ........................................................................................ 29 第三节 本章小结 .............................................................................................. 31 第七章 结 论.......................................................................................................... 32 致 谢.......................................................................................................................... 33 参考文献...................................................................................................................... 34 附 录.......................................................................................................................... 35

一、英文原文 ............................................................................................. 35 二、英文翻译 ............................................................................................. 44

- IV -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

第一章 绪论

第一节 论文研究背景及意义

一般来讲,企业创建一套IT系统需要三个基本条件:硬件、软件以及专门的运维。而且为了满足公司不断扩大的需要,硬件等基础设施需要不断的换代升级及扩容。加上软件升级,维护人员成本支出,这是一笔不小的开支,这种管理模式不仅管理混乱,效率低下,而且信息安全的风险。因此,不断上升的硬件成本及相应能耗的增长,数据中心容量的珍贵以及用户对配置和管理网络的简化愿望,推动了现在云计算的蓬勃发展。在云计算服务下,云服务提供者可以在瞬间处理海量的信息,数量级可达到数千万计甚至数亿。此外,云计算服务下,可按需分配这些资源和服务,从而实现了让更多的普通用户享受到如超级计算机一样的高端服务;这些资源和服务也变的如公共设施一般,提升了自己的效率与价值。[1]

云计算的基本原理是,通过使数据处理运行在许多的分布式计算机之间,这些计算机可能不是单纯的本地计算机也可能不是完全的远程服务器,企业数据中心的计算处理流程更类似于互联网。如此企业能够将资源按照需要将计算机和存储系统切换到不同的应用上。云计算的“云”就是存在于互联网上的服务器集群的资源,而“计算”就是利用这些资源来提供服务。它包括硬件资源(服务器、存储器、CPU等)和软件资源(如应用软件、集成开发环境等),还有一个信息的接受、处理、返回机制。本地终端只要通过互联网发送一个需求信息,云服务就会利用上述资源为你提供的服务并将结果返回给你。[2]人们可以非常方便的通过网络来享受云计算为我们提供的服务,而像超级计算这样的服务也会变得非常便利。

云计算主要分为三种服务模式,SaaS(SofiwareasaServic,软件即服务),PaaS(PlatformasaService,平台即服务)以及IaaS(InfrastructureasaService,基础架构即服务)。SaaS:通过网络提供软件应用服务给用户。SaaS可提高企业信息化服务的使用率,让用户在本企业一个站点内享受更多更好的服务。PaaS:通过网络提供例如应用开发环境、数据库服务等的平台服务,这些服务可以按用户需求定制,也可以按用户自己想法修改,用户可更方便的享受此类服务。IaaS:通过网络给用户提供计算机基础设施服务,包括计算存储、网络资源出租、负载均衡以及容灾备份、网络加速、综合信息等服务[3]。

虚拟化是laas层的核心技术,该技术在底层物理设备与上层操作系统之间形成一个虚拟层从而将他们分离开,在这一层中,会有一个资源池,它是多个物理

- 1 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

设备的集合,各个物理设备之间的相互协作,共同对外提供服务,由管理软件统一管理。IaaS层的虚拟化就是将一台服务器通过一定手段虚拟成多个对外看似独立的服务器,每台虚拟的服务器都具有一定计算能力且相互独立,它们所支持的服务也可以单独对外提供。这多台服务器同时运行,相互隔离,降低了能耗,资源利用率也比之前有很大提升。

基础框架层(laas)基于服务器企业集群构建来实现。服务器集群由若干台服务器组成,数量可达百万级,利用集群技术将它们组织起来就形成了虚拟服务器集群。虚拟服务器集群中的这些服务器具有独立的服务器硬件资源和操作系统。服务器集群可以是分成多个等级,以便支持多种不同等级的服务。服务器集群和层次化服务器系统主要是提供运算能力、网络能力、信息服务以及数据存储服务等功能。服务器集群的用来提供软件运行的实际物理资源,是软件应用计算的实际运行环境。可用户数量增多的时候,服务器集群也可以根据用户的增加而增长,满足更多的用户需求。层次化服务器系统可以提供业务组件分布的位置,提高分布和计算迁移功能的灵活性、可靠性和动态性。

第二节 国内外研究现状

云计算已经成为当今计算机界最热门的技术之一,许多大公司认识到云计算的重要性,在努力发展自己的云计算技术。Amazon、Google、Saleforee、IBM和微软等大公司都为推动云计算发展做出了很大的贡献。2006年,亚马逊推出AWS服务,包括简单存储服务(AmazonS3)和弹性计算云(EC2),[4]走在了云计算技术领域的前沿,目前亚马逊的Eucalyptus已经商业化;Google也向对外开放了他们的云服务Google App Engine[5],不过他们的形式多种多样,有应用托管、企业搜索等形式。Gloogle 的云GoogleAppEngine以GFS、MapReduee和Big table支撑,提供了一个允许用户在它的基础框架上部署和开发自己的应用程序的平台,是一个典型的PAAS平台;Foree。com是salesforee。com提供的随需应变平台,可以使构建、共享、运行业务应用程序的过程比以前更加简单,也使业务应用程序的功能更加强大;“蓝云”是IBM在充分利用现有资源的基础上,重点在于对产品和技术的整合的云计算平台[6]; 2008年,AsureServicesPlatform在微软开发者大会上发布了,这个平台是的基于Windows系列产品的开发、储存和服务代管等服务的云计算环境。目前云计算的发展在国内还属于初级阶段,还没有非常成熟的云计算服务平台,但各大通信运营商都非常重视。中国移动的“大云”(BigCloud),中国电信的“e云”,中国联通的“互联云”等相继出现,但是技术

- 2 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

也并不如国外做的那么成熟。目前云计算行业标准还并没有指定,为了促进国产软件的发展,在云计算这一技术领域占居一定的位置,对云计算的研究是非常有意义的[7]。

第三节 论文组织结构

本篇论文共分五章,主要内容概括如下:

第一章 绪论。简单介绍云计算的研究背景、意义以及论文的组织结构。 第二章Iaas相关介绍。这一章介绍了Iaas的概述、IaaS服务特征及优势、IaaS服务特征及优势。

第三章 关键技术介绍。这一章介绍了IaaS服务器虚拟化,IaaS存储虚拟化IaaS网络虚拟化这三大虚拟化的实现原理。

第四章openstack相关介绍。这一章首先介绍了openstack的概念架构和访问流程对openstack的整体运行原理有一个大致的了解,之后详细介绍了openstack的三大服务:openstack认证服务keystone、Opestack计算服务nova 、OpenStack网络服务Neutron。

第五章openstack云管理平台的搭建。这是部分是最艰难的也是最有挑战性的,从基础环境的配置开始,完成之后开始安装各种软件包,每安装一个软件包后都要进行详细的配置文件的修改,这章节对这个艰难的过程给出了详细的安装步骤和详细的指导说明。

第五章openstack云平台的测试。这章节主要是完成对第五章的所有安装的进行验证是否安装正确,每一个所需的服务是否都已启动,之后是启动一个instance的过程,并对实例的成功启动之后进行网络测试。

第六章 结束语。

- 3 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

第二章 Iaas相关介绍

第一节 IaaS概述

IaaS(Infrastructure as a Service,基础设施即服务)指将IT基础设施能力通过互联网提供给用户使用,并根据用户对资源的实际使用量或占用量进行计费的一种服务。[8]

IaaS通过互联网提供了数据中心、基础硬件和软件资源。IaaS可以提供服务器、操作系统、磁盘存储、数据库和/或信息资源。IaaS通常会按照“弹性云”的模式引入其他的使用和计价模式,也就是在任何一个特定的时间,都只使用你需要的服务,并且只为之付费。

通过IaaS这种模式,用户可以从供应商那里获得他所需要的计算或者存储等资源来装载相关的应用,并只需为其所租用的那部分资源进行付费,而同时这些基础设施繁琐的管理工作则交给IaaS供应商来负责[9]。

从商业模式方面来说,IaaS是根据用户的实际使用量来收费,而不是传统的包月形式;从技术上来说,IaaS应该向用户提供富有弹性的资源,用户需要则提供,不需要则立即自动收回[10]。

第二节 IaaS服务特征及优势

IaaS主要具有以下服务特征及优势: ①更低的门槛

用户可以以最低的成本租用所需的计算机资源,而不需要进行大量的硬件和软件资源的采购。

②更好的扩展性

用户可以根据需要,动态增加或减少服务资源,不用考虑资源来源或者资源是否够用。

③管理方便

资源可直接通过互联网管理,不需要到资源所在机房现场操作,降低管理成本。

④使用灵活

- 4 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

用户可获得完全独立的服务器,并拥有管理员权限,因此用户可以不受限制的进行任何操作。

⑤资费灵活

所需资源可以随时开始和停止,用户只需要为自己所使用的资源付费。

第三节 IaaS整体架构

虚拟化技术主要实现了对底层物力资源的抽象,使其成为一个个可以被灵活生成、调度、管理的基础资源单位。而要将这些资源进行有效的整合,从而生成一个可统一管理、灵活分配调度、动态迁移、计费度量的基础服务设施资源池,并向用户提供自动化的基础设施服务,就需要IaaS管理平台[11]。

该管理平台主要是对资源管理平台的实现:

。。。 终端设备n 。。。 用户管 资源调网络管逻辑资源池 存储管理 系统管理 (计算资源、存储资源,网络资源) 全面虚拟化 硬件设备 (计算设备,存储设备,网络设备) 图2.1IaaS整体架构

①资源管理平台

资源管理平台负责对物理资源和虚拟化资源进行统一的管理和调度,形成统一的资源池,实现IaaS服务的可管、可控,其核心是对每个基础资源单位的生命周期管理能力和对资源的管理调度能力[12]。

- 5 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

第四节 本章小结

本章主要是Iaas的内容相关介绍,其中包括了Iaas的定义、特点和优势以及Iaas的实现的整体架构,充分说明Iaas在云平台中的地位与作用。本章对Iaas的定义做出了详细的解释,并且说明这一模式在云计算中的优势,此外,本章还对它的整体架构做了详细介绍,主要是对它的资源管理平台的实现做了详细的介绍。

- 6 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

第三章 关键技术介绍

第一节 IaaS服务器虚拟化

服务器虚拟化是指能够在一台物理服务器上运行多台虚拟服务器的技术,并且上述虚拟服务器在用户、应用软件甚至操作系统看来,几乎与物理服务器没有区别,用户可以在虚拟服务器上灵活的安装任何软件。同时服务器虚拟化技术还应该确保上述多个虚拟服务器之间的数据时隔离的,虚拟服务器对资源的使用是可控的[13]。

服务器虚拟化通常有两种架构,包括寄生架构和裸金属架构。 ①寄生架构

操作系统1 操作系统2 虚拟化软件 主操作系统 硬件 图3.1寄生架构

在寄生架构中,虚拟化软件需要依赖于已经安装好的操作系统,在操作系统上安装虚拟化软件后,用虚拟化软件创建虚拟机,对虚拟机进行管理和维护。

②裸金属架构

操作系统1 操作系统2 虚拟化软件 硬件 图3.2裸金属架构

- 7 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

裸金属架构中,虚拟化软件不依赖于传统的操作系统,而是集成了操作系统中处理CPU和进程调度等功能之外的所有操作系统功能,然后直接在硬件上建立虚拟化环境,用来管理和维护虚拟机。

第二节 IaaS存储虚拟化

存储虚拟化是一种将存储系统的内部功能从应用、主机或者网络资源中抽象、隐藏或者隔离的技术,其目的是进行与应用和网络无关的存储或数据管理。虚拟化技术为底层资源的访问提供了简单、统一的接口,使用户不必关心底层系统的复杂实现。[14]

对存储虚拟化而言,不同层次的虚拟化实现具有不同的目标:

用户层 文件/记录层 聚合块层 数据库 (主机)聚合块 存储设备 图3.3存储虚拟化

文件 (网络)聚合块 存储设备层 存储设备 ①存储设备层:存储设备层的存储资源是最底层的物理设备,通过数据块存储地址的虚拟化,实现对存储内容的快速寻址。

②块聚合层:将存储设备层的物理存储设备虚拟化,通过合理的组织,将其构建为能被统一访问的物理资源池。

③文件/记录层:进一步对物理资源进行抽象,将其虚拟化为逻辑资源,并为上层应用使用。

第三节 IaaS网络虚拟化

网络虚拟化一般分为两类,一类是对外部网络环境的虚拟化;另外一类是对服务器主机内部的网络虚拟化,如网卡等设备的虚拟化。

- 8 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

网络虚拟化是将多个硬件或软件网络资源及相关的网络功能集成到一个可用的软件中统一管理和控制的过程,并且对于网络应用而言,该虚拟网络环境的实现方式是透明的[14]。

网络虚拟化主要包括两个方面,一是物理主机内部网络虚拟化;二是对网络虚拟化的统一管理。

①主机内部网路虚拟化 主机内部网络虚拟化技术是面向云计算的网络虚拟化技术的核心,它通过与传统网络虚拟化技术的配合,在现实虚拟网络的动态性、安全性等方面发挥了重要的作用。

物理机 物理网卡 网桥 虚拟网桥 虚拟网桥 虚拟机 虚拟机 图3.4主机内部网路虚拟化

②网络虚拟化统一管理 网络虚拟化的重要价值在于它配置的灵活性,为了达到灵活配置的目的,需要对虚拟化网络做统一的管理。

资源分配:为虚拟网卡分配IP地址、MAC地址。 流量监控:对虚拟网卡设定流量上限。

实时迁移:当虚拟机从一台物理机迁移到另一台物理机时,实时迁移其网络配置。

状态监控:包括对虚拟网卡的状态及流量等的监控。

第四节 本章小结

本章主要是对云计算平台实现的关键技术的介绍,虚拟化技术对于云计算平台来说是最重要的,本章就对最重要的三大虚拟化技术分别是服务器虚拟化、存

- 9 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

储虚拟化、网络虚拟化做出了详细的介绍,其中包括虚拟化的实现原理,虚拟的架构的介绍等。

- 10 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

第四章 OpenStack相关介绍

第一节OpenStack 介绍

OpenStack 是一套开源的软件架构,也是一款工具集。它刚问世不久就得到学术领域的普遍关注,并很快渗透到各个研究领域。 OpenStack 可以构建自己的 IaaS 云计算环境,并且提供给用户使用。OpenStack 部署云环境的优点就是灵活,可以根据自己的需要来搭建基础设施,同时可以自由地扩充集群规模。 OpenStack 允许客户通过部署虚拟机来创建资源,在节点上通过使用 Xen 或KVM 等来对虚拟机进行一系列配置。客户端用户只需要申请自己需要的虚拟资源[15]。

一、 OpenStack概念架构

启动一个实例或者一个虚拟机涉及多个服务之间交互,下面这张图表提供了一个概念架构。

图4.1概念架构

- 11 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

Horizon 是图形用户界面,管理员可以很容易地使用它来管理所有项目。 Keystone 处理授权用户的管理.

Neutron 定义提供组件之间连接的网络。

Nova 被认为是 OpenStack 的核心,负责处理工作负载的流程。它的计算实例通常需要进行某种形式的持久存储,它可以是基于块的(Cinder)或基于对象的(Swift)。Nova 还需要一个镜像来启动一个实例。Glance 将会处理这个请求,它可以有选择地使用 Swift 作为其存储后端[16]。

二、 Openstack访问流程

userkeystonecredentialstokennovaglanceneutronToken+request for VMVerify tokenToken+request for imageVerify tokenimageToken+request for ipVerify tokenipsuceess图4.2 Openstack访问流程

① User通过自己的身份凭证(credentials)向keystone服务发起认证,keystone如果通过认证则给user颁发密钥(token),之后执行②步

② User把密钥(token)和虚拟机的创建请求发送给nova服务,nova通过keystone服务验证密钥(token)如果通过认证则执行③步

③ Nova把密钥(token)和创建虚拟机所需要的镜像请求发送给glance服务,glance 通过keystone服务验证密钥(token),如果通过glance向nova返回镜像执行④步

- 12 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

④ Nova把密钥(token)创建虚拟机所需要的网络资源请求发送给Neutron服务过keystone服务验证密钥(token),如果通过Neutron向nova返回网络资源(ip)执行⑤步

⑤ Nova得到创建虚拟机所需要的资源了,之后向用户返回请求成功。

第二节 Openstack认证服务-Keystone

一、 Keystone介绍

Keystone(OpenStack Identity Service)是OpenStack框架中,负责身份验证、服务规则和服务令牌的功能, 它实现了OpenStack的Identity API。Keystone类似一个服务总线, 或者说是整个Openstack框架的注册表, 其他服务通过keystone来注册其服务的Endpoint(服务访问的URL),任何服务之间相互的调用, 需要经过Keystone的身份验证, 来获得目标服务的Endpoint来找到目标服务[17]。

二、 Keystone概念

User即用户,他们代表可以通过keystone进行访问的人或程序。Users通过认证信息(credentials,如密码、API Keys等)进行验证,如:住宾馆的人。

Tenant即租户,它是各个服务中的一些可以访问的资源集合。例如,在Nova中一个tenant可以是一些机器,在Swift和Glance中一个tenant可以是一些镜像存储,在Neutron中一个tenant可以是一些网络资源。Users默认的总是绑定到某些tenant上,如:宾馆。

Role即角色,Roles代表一组用户可以访问的资源权限,例如Nova中的虚拟机、Glance中的镜像。Users可以被添加到任意一个全局的或租户内的角色中。在全局的role中,用户的role权限作用于所有的租户,即可以对所有的租户执行role规定的权限;在租户内的role中,用户仅能在当前租户内执行role规定的权限,如:VIP 等级,VIP越高,享有越高的权限。

Service即服务,如Nova、Glance、Cinder。根据前三个概念(User,Tenant和Role)一个服务可以确认当前用户是否具有访问其资源的权限。但是当一个user尝试着访问其租户内的service时,他必须知道这个service是否存在以及如何访问这个service,这里通常使用一些不同的名称表示不同的服务。在上文中谈到的Role,实际上也是可以绑定到某个service的。例如,当swift需要一个管理

- 13 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

员权限的访问进行对象创建时,对于相同的role我们并不一定也需要对nova进行管理员权限的访问。为了实现这个目标,我们应该创建两个独立的管理员role,一个绑定到swift,另一个绑定到nova,从而实现对swift进行管理员权限访问不会影响到Nova或其他服务,如:宾馆可以提供的服务类别,比如,饮食类,娱乐类。

Endpoint,翻译为“端点”,我们可以理解它是一个服务暴露出来的访问点,如果需要访问一个服务,则必须知道他的endpoint。因此,在keystone中包含一个endpoint模板(endpoint template,在安装keystone的时候我们可以在conf文件夹下看到这个文件),这个模板提供了所有存在的服务endpoints信息。一个endpoint template包含一个URLs列表,列表中的每个URL都对应一个服务实例的访问地址,并且具有public、private和admin这三种权限。public url可以被全局访问,admin url被从常规的访问中分离,如:具体的一种服务,比如吃烧烤,打羽毛球。

第三节 Opestack计算服务-nova

一、 Nova简介

Nova是OpenStack云中的计算组织控制器。支持OpenStack云中实例(instances)生命周期的所有活动都由Nova处理。这样使得Nova成为一个负责管理计算资源、网络、认证、所需可扩展性的平台。但是,Nova自身并没有提供任何虚拟化能力,相反它使用libvirt API来与被支持的Hypervisors交互。Nova 通过一个nova API来对外提供服务[18]。

Nova的功能和特点有:实例生命周期管理,管理计算资源,网络和认证管理,REST风格的API,异步的一致性通信,Hypervisor透明:支持Xen,XenServer/XCP, KVM, UML, VMware vSphere and Hyper-V。

- 14 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

Young adults moving to college need to create new networks at college. However, they often leave friends from high school with whom they may have established rich networks; completely abandoning these high school networks would mean a loss of social capital. Granovetter (1973, 1982) has suggested that weak ties provide more benefit when the weak tie is not associated with stronger ties, as may be the case for maintained high school relationships. To test the role of maintained high school relationships as weak, bridging ties, we adapted questions about general bridging relationships, such as those in Williams (2006), to be specific to maintained relationships with high school acquaintances as opposed to close friends. We call this concept “maintained social capital.” In keeping with the thrust of our prior hypotheses about the role of Facebook and bridging social capital, we propose the following:

H5: Intensity of Facebook use will be positively associated with individuals’ perceived maintained social capital.

Method

A random sample of 800 Michigan State University (MSU) undergraduate students was retrieved from the MSU registrar’s office. All 800 students were sent an email invitation from one of the authors, with a short description of the study, information about confidentiality and incentives, and a link to the survey. Two reminder emails were sent to those who had not responded. Participants were compensated with a $5 credit to their on-campus spending accounts. The survey was hosted on Zoomerang (http://www.zoomerang.com), an online survey hosting site, and was fielded in April 2006. Only undergraduate users were included in our sampling frame. A total of 286 students completed the online survey, yielding a response rate of 35.8%. Demographic information about non-responders was not available; therefore we do not know whether a bias existed in regards to survey participation. However, when we compare the demographics of our sample to information we have about the MSU undergraduate population as a whole, our sample appears to be representative with a few exceptions. Female, younger, in-state, and on-campus students were slightly overrepresented in our sample.

Measures

Our instrument included four broad types of measures, which are discussed in more detail below. We collected information about demographic and other descriptive variables, including gender, age, year in school, local vs. home residence, ethnicity, a measure of Internet use adapted from LaRose, Lai, Lange, Love, and Wu (2005), and

- 40 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

whether respondents were Facebook members or not. We also included Facebook usage measures, such as time spent using Facebook and items designed to assess whether Facebook was used to meet new people or to establish an online connection to pre-existing connections. Our instrument also included measures of subjective well-being and as well as three social capital measures, which served as our dependent variables.

Measures of Facebook Usage Facebook Intensity

The Facebook intensity scale (Cronbach’s alpha = .83) was created in order to obtain a better measure of Facebook usage than frequency or duration indices. This measure includes two self-reported assessments of Facebook behavior, designed to measure the extent to which the participant was actively engaged in Facebook activities: the number of Facebook “friends” and the amount of time spent on Facebook on a typical day. This measure also includes a series of Likert-scale attitudinal questions designed to tap the extent to which the participant was emotionally connected to Facebook and the extent to which Facebook was integrated into her daily activities.

Facebook Usage: Elements in Profile and Perceptions of Who Has Viewed Profiles

We asked respondents to indicate which of several salient aspects of the profile (such as relationship status, high school, and mobile phone number) they included when constructing their profile. The instrument asked respondents to indicate who they thought had viewed their profile, such as high school friends, classmates, or family members. These items offer insight into the degree to which respondents used Facebook to maintain existing connections or meet new people.

Use of Facebook to Meet New People vs. Connect with Existing Offline Contacts

In order to further investigate whether usage was more motivated by prior offline contacts or the potential to form new online contacts, we developed several items reflecting each of these paths. In the former case, the items measured whether respondents used Facebook to look up someone with whom they shared some offline connection, such as a classmate or a friend (Cronbach’s alpha = .70). In the latter case, our instrument included several items that tapped the use of Facebook to make new friends without any reference to an offline connection, but these did not correlate

- 41 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

highly, and our final analysis incorporated only a single item measure: using Facebook to meet new people.

Satisfaction with Life at MSU

The scale of satisfaction with life at MSU was adapted from the Satisfaction with Life Scale (SWLS) (Diener, Suh, & Oishi, 1997; Pavot & Diener, 1993), a five-item instrument designed to measure global cognitive judgments of one’s life. We amended each item slightly to refer specifically to the MSU context, on the assumption that restricting participants was more appropriate given our hypotheses and more likely to elicit accurate answers. The reliability test for this 5-point Likert scale showed a relatively high reliability.

Measures of Social Capital

Our three measures of social capital-bridging, bonding, and maintained social capital-were created by adapting existing scales, with wording changed to reflect the context of the study, and creating new items designed to capture Internet-specific social capital (Quan-Haase and Wellman, 2004). The full set of social capital items was factor analyzed to ensure that the items reflected three distinct dimensions.

Bridging Social Capital

This measure assessed the extent to which participants experienced bridging social capital, which is believed to be better-suited for linking to external assets and for information diffusion (Putnam, 2000). According to Williams (2006), “members of weak-tie networks are thought to be outward looking and to include people from a broad range of backgrounds. The social capital created by these networks generates broader identities and generalized reciprocity” (n.p.). We therefore adapted five items from Williams’ (2006) bridging social capital subscale and created three additional items intended to measure bridging social capital in the MSU context to create our bridging social capital scale (Cronbach’s alpha = .87). One item, “MSU is a good place to be,” was included because it loaded on the same factor and tapped into an outcome of bridging social capital.

Bonding Social Capital

Bonding was assessed using five items from the bonding subscale of the Internet social capital scales developed and validated by Williams (2006). Responses were reported on a five-point Likert scale. These items were adapted to the MSU context (Cronbach’s alpha = .75.)

Maintained Social Capital

- 42 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

This original scale was inspired by our pilot interviews,3 media coverage of Facebook, and anecdotal evidence that suggested that keeping in touch with high school friends was a primary use of Facebook. These items were adapted from traditional measures of social capital which assess an individual’s ability to mobilize support or action (Cronbach’s alpha = .81) but focus on the ability to get assistance from a previously inhabited community.

- 43 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

二、英文翻译:

Facebook“朋友”的优势:在线社交网站的社会资本和

大学生的使用

Facebook的概述

据报道, Facebook创建于2004年,截止到2007年,已经有超过2100万的注册会员每天产生16亿的页面浏览量。这个网站是紧密集成到用户的日常媒体实践:典型的用户每天在网站上花大约20分钟的时间,三分之二的用户每天至少登录一次。Facebook利用它在大学生中的成功应用,在2005年9月初又推出了一个高中版本。2006年,该公司推出了社区商业组织;到2006年11月,近22000的组织拥有Facebook目录。在2006年,Facebook被超过2000美国院校使用,是提供有关总页面访问量的万维网上的第七个最流行的网站。

在Facebook上现有的学术研究主要集中在身份表示和隐私问题。查看Facebook参与者对自己提供的信息量,信息的相对开放的性质,以及缺乏隐私控制制定的用户,Gross 和Acquisti 认为,用户可能同时将自己置于危险之中(如跟踪)和网络(如识别盗窃)。最近其他Facebook研究考察了学生对老师的看法存在和自我表露,时态的使用模式,和剖面结构之间的关系和友谊清晰度。

与流行的新闻报道相比,主要集中在使用Facebook的消极结果,源于用户误解他们在线观众的本质,我们在这种情况下感兴趣,简要的观众(如善意的同行和朋友)和实际观众是一致的。我们把Facebook作为研究背景使用,以确定是否离线社会资本可以通过在线工具生成。我们研究的结果显示,Facebook在大学生的使用和社会资本的措施有着显著的联系。

文献综述

社会资本:在线和离线

社会资本广泛指的是通过人们之间的关系进行资源积累。社会资本在多个领域都是一个弹性术语的定义,包含着原因和结果。Bourdieu 和 Wacquant 将社会资本定义为“实际或虚拟的资源的总和,这个凭借拥有持久的网络或多或少的制度化关系相互认识和识别获得个人或集团”。来自这些关系的资源能够基于关系自身在形式和作用上进行转换。

社会资本与各种积极的社会效果有着密切的联系,比如更好的公共卫生,更低的犯罪率,更高效的金融市场。根据社会资本的若干措施, 在过去的几年里,这个重要的资源在美国一直在下降 (。当社会资本下降,社会经验提高社会障碍,

- 44 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

二、 Nova 云架构

图4.3Nova 云架构

Nova 云架构的各个组件是以数据库和队列为中心进行通信的,下面对其中的几个组件做一个简单的介绍:

① Queue,也就是消息队列,它就像是网络上的一个hub,nova各个组件之间的通信几乎都是靠它进行的,当前的Queue是用RabbitMQ实现的,它和database一起为各个守护进程之间传递消息。

② database存储云基础架构中的绝大多数状态。这包括了可用的实例类型,在用的实例,可用的网络和项目。当前广泛使用的数据库是sqlite③(仅适合测试和开发工作)、MySQL和PostgreSQL。

③ nova-compute负责决定创造虚拟机和撤销虚拟机,通过运行一系列系统命令(例如发起一个KVM实例,)并把这些状态更新到nova-database中去,其过程相当复杂,但是基本原理很简单。

④ nova-schedule负责从queue里取得虚拟机请求并决定把虚拟机分配到哪个服务器上去。schedule的算法可以自己定义,目前有Simple (最少加载主机),chancd(随机主机分配) ,zone(可用区域内的随机节点)等算法。

⑤ nova-volume负责记录每一个计算实例,相当于一个计算请求吧,并负责创建,分配或撤销持久层容器(Amazon的,iSCSI,AoE等等)给这些compute instances。

⑥ nova -netwok负责处理队列里的网络任务。、

⑦ nova-api守护进程是OpenStack Compute的中心。它为所有API查询提供一个入口。

- 15 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

三、 Nova工作流程

为了看看nova是如何工作的,我们可以以启动一个实例为例来进行说明,因为启动一个新的instance涉及到很多openstack nova里面的组件共同协作。

Scheduler Api Queue&Database Nova-network Nova-compute 图4.4Nova工作流程

① API:处理客户端的请求,并且转发到 Queue和Database中。如:我们输入一个启动instance的命令api就会查看这种类型的instance是否达到最大值并给scheduler发送一个消息(实际上是发送到Queue中)去运行这个实例。 ② Scheduler:选择一个host去执行命令。如:Schedule:调度器接收到了消息队列Queue中API发来的消息,然后根据事先设定好的调度规则,选择好一个host,之后,这个instance会在这个host上创建。

③ nova-compute :启动和停止实例,附加和删除卷等操作。如:创建一个instance的操作是由Compute完成的,而这个过程中computer组件与Glance-api交互得到所需的instance镜像。

④ nova-network:管理网络资源,分配固定IP。

第三节 OpenStack网络服务-Neutron

一、 Neutron简介

OpenStack网络的核心理念就是通过多个其他元素(如虚拟机、系统管理模块以及其他连接的网络)为用户提供一组一致性的网络服务。从本质上讲,OpenStack网络创建了一个一致的逻辑通讯层,而其他元素可以有效地、大规模地使用这个逻辑层。

- 16 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

这一模式是在OpenStack Neutron服务器中实现的,它与OpenStack Nova软件管理的虚拟机(即计算服务)以及上述提及的其他元素进行交互。用户通过OpenStack的Horizon GUI与网络功能进行交互,而其他的管理系统和网络则通过使用Neutron API与网络服务进行交互。

Neutron使用RESTful网络服务和HTTP与其客户端进行通讯。它使用JavaScript对象表示(JSON)和XML对其运行进行建模。它是专为随时间推移而实现灵活增加功能的目标而设计的,它可扩展至一系列的部署并使用易于理解的开放式软件以便于能够更高效地把多方功能整合至OpenStack网络环境。请求、响应以及其他的逻辑步骤都有明确的定义,并且这些逻辑步骤都可用于一些必要功能的创建与管理,进而支持网络服务实施。

在其目前的分布中,OpenStack Neutron混合实施了第二层的VLAN和第三层的路由服务, 它可为所支持的网络提供防火墙、负载平衡等扩展功能。网络中的虚拟机来自于虚拟机管理程序。[19]

此外,通过使用支持IPv4和IPv6的强大地址管理功能,Neutron可在一个站点内实现虚拟机的灵活部署。它采用了一个逻辑的子网架构,IP块表示可以寻址虚拟位置和到达其部署结构中任何的位置。这种结构类似于在众多Neutron IP组网中所使用的子网技术,它通常是从与子网相关的物理端口抽取出来的。在覆盖网络中,它可被用作逻辑关联机制,以便于为不同用户和应用程序分离网络流量。通过使用这种方法,云计算供应商可以分别实现多个租户的通讯并为不同应用程序部署拓扑,例如多层服务器组合以处理一个整体应用程序的不同部分

Software-define Networking service L3-agent Plugin-agent Neutron-server Dhcp-agent Message queue 图4.5 Neutron架构

① neutron-server 是 OpenStack Networking 服务器的主要流程。它是一个 Python 后台进程,将用户请求从 OpenStack Networking API 中继到配置的插件。

- 17 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

② neutron-dhcp-agent 向所有租户网络提供动态主机配置协议 (Dynamic Host Configuration Protocol, DHCP) 服务。

③ neutron-l3-agent 执行 L3/网络地址转换 (Network Address Translation) 转发,以支持网络网络访问租户网络上的 VM。

一个特定于插件的可选代理 (neutron-*-agent) 在每个虚拟机管理程序上执行本地虚拟交换机配置。

二、 Neutron实现原理

①用ifconfig命令查看计算节点的网卡情况如下图4.6

图4.6 计算节点网卡状况

②根据网卡状况可知计算节点的内部网络拓扑结构如下图4.7

- 18 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

图4.7计算节点内部拓扑结构

root@network:~# ovs-vsctl show dbf08d07-90e5-4af8-8a9d-4ba659e8f56a Bridge br-int

Port \ tag: 1

Interface \ type: internal Port patch-tun Interface patch-tun type: patch

options: {peer=patch-int} Port br-int Interface br-int type: internal

从上面的代码看出br-int上有三个端口Port \、Port patch-tun Port br-int正好与br-tun上的接口相连。

图中br-tun、br-int都是虚拟的网桥,都是有软件所定义的而非硬件并且和硬件有相同的作用可以实现连接多个虚拟机。这样大大增加可扩展性,灵活性降低了成本。

第四节 Neutron 网络创建过程

Neutron 网络目的是为 OpenStack 云更灵活地划分物理网络,在多租户环境下提供给每个租户独立的网络环境。另外,Neutron 提供 API 来实现这种目标。Neutron 中用户可以创建自己的网络对象,如果要和物理环境下的概念映射的话,这个网络对象相当于一个巨大的交换机,可以拥有无限多个动态可创建和销毁的虚拟端口。[20]

在 Horizon 上创建 Neutron 网络过程如下:

首先管理员拿到一组可以在互联网上寻址的 IP 地址,并且创建一个外部网络和子网。

租户创建一个网络和子网。

租户创建一个路由器并且连接租户子网和外部网络。

- 19 -

火龙果?整理 uml.org.cn 租户创建虚拟机。

重庆邮电大学本科毕业设计(论文)

第五节 本章小结

本章首先介绍了openstack的概念架构和访问流程对openstack的整体运行原理有一个大致的了解,之后详细介绍了openstack的三大服务:openstack认证服务keystone、Opestack计算服务nova 、OpenStack网络服务Neutron,对每一种服务的架构、访问流程以及实现原理都做出了详细的介绍。

- 20 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

第五章 Openstack云平台搭建

第一节 多节点安装部署 OpenStack

一、 实验环境及实验拓扑图

本次实验采用一台ACER PC主操作系统win8.1安装vmware station10之后虚拟出三台Ubuntu12.0.4(LTS)虚拟机分别作为控制节点、网络节点和计算节点,安装部署的 OpenStack 版本为Icehouse。实验拓扑图如图 5.1 所示。

Controller node Network node Networking ML2 plug-in Indentityservice-Keystone Image service-Glance Compute service - nova management Networking - Neutron plug-in Dashboard- horizon 2.instance tunnels Network interfaces 1. management 10.0.0.11/24 10.0.1.21/24 3.External server ML2 Networking Network interfaces 1.management 10.0.0.21ML2 plug-in Openvswitch(ovs) Network interfaces 1.management 10.0.0.31/24 2.instancetunnel 10.0.1.31/24 Openvswitch(ovs) Layer3agent DhcpAgent Compute Novahypervisor Kvm/Qemu compute node Mysql RabbitM图5.1实验拓扑图

本文设计的云计算平台的实验拓扑图如图5.1 所示,在图可以看到每个节点安装的服务和每个节点的网络配置情况, 计算平台验拓扑图中主要由:控制节

- 21 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

点(Controller Node)、计算节点(Compute Nodes)、网络节点(NetWork Node )组成的。在本文模型中计算节点可以继续添加。控制节点是整个云计算平台的核心,起着调度任务、管理监控整个系统作用。用户通过在控制节点部署的各种服务和管理操作界面来对整个云计算平台进行各种命令操作。云平台的其他计算节点和网络节点的信息都必须向控制节点进行注册,由控制节点对资源进行统一调度。计算平台中虚拟网络的管理和配置由网络节点提供的服务来完成的。计算节点是云计算平台具体的计算运行工作执行者,包括提供给客户使用的各种虚拟机和存储空间等。

二、 构建过程

目前OpenStack可以采用多种方法进行构建,如源码安装、使用DevStack脚本安装、使用 Puppet 安装等,为了进一步熟悉 OpenStack 的框架,本文采用通过openstack官方网站提供的指导手册进行一步步的安装。

1. 控制节点的安装和配置

控制节点部署流程如图5.2 所示:

Keystone 认证服务系统的安装和配置 Cinder块存储服务系统的安装和配置 Glance 镜像服务系统的安装和配置 Nova 计算服务系统的安装和配置 Dashboard 网络应用程序的安装和配置 图5.2实验流程图

2. 计算节点的安装和配置

计算节点只需安装 NOVA 组件即可。

- 22 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

第二节 云平台搭建过程遇到的问题与解决方法

一、 Keystone的安装与问题分析

以下是其安装和配置过程。

1. 安装 Keystone

安装 Keystone 依赖项,并将 Keystone 安装到 python 的 package 中: cd ~/keystone

sudo pip install -r tools/pip-requires sudo python setup.py install

2. 配置 Keystone

(1) 创建配置文件

自己创建 Keystone 的配置文件路径和文件。 sudo mkdir -p /etc/keystone

sudo cp ~/keystone/etc/* /etc/keystone/

(2) 配置 keystone 的数据库

①本实验使用 mysql,修改配置文件 /etc/keystone/keystone.conf, 将 connection = sqlite:///keystone.db

修改为: connection = mysql://keystone:openstack@localhost/keystone ②同步数据库 schema 并运行 keystone sudo keystone-manage db_sync sudo keystone-all -d &

3. 问题分析

①没办法通过客户端的命令来验证安装的 Keystone 服务。这是因为通过 git 签出代码来安装 kestone 之前,忘记安装 keystone client。应注意 gitkeystone 的代码时,要:

git clone git://github.com/openstack/keystone.git

git clone git://github.com/openstack/python-keystoneclient.git client

②keystone 使用期间,有时会出错,可能是因为环境变量问题。我们需要用到keystone.conf 里的 admin_token 来访问 keystone 的服务,后面也可以通过

- 23 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

keystone-client 来注册新的 token。 默认的 admin_token 是 ADMIN,要把它添加到系统环境里去 :

export SERVICE_TOKEN=ADMIN

export SERVICE_ENDPOINT=http://10.0.0.11:35357/v2.0

二、 Glance 的安装与问题分析

1. 安装 Glance

进入 Glance 源代码文件夹,执行: cd glance

sudo pip install -r tools/pip-requires sudo python setup.py install

2. 配置 Glance

(1) 配置数据库:

在 mysql 里为 Glance 创建一个数据库来保存镜像的 matadata。操作如下: mysql -u root -p create database glance;

grant all on glance.* to 'glance'@'%' identified by 'openstack' grant all on glance.* to 'glance'@localhost identified by 'openstack'

(2) 设置 Glance 配置文件

sudo mkdir /etc/glance

sudo cp ~/glance/etc/* /etc/glance

①/etc/glance/glance-api.conf,默认使用 file 来做 glance 的存储,不修改。 ②/etc/glance/glance-reigstry.conf,修改内容:

ql_connection = mysql://glance:openstack@10.0.0.11/glance #这里指向到 mysql 服务器,我这里是使用 keystone 那台服务器的 mysql

#在文件末尾加上 [paste_deploy] flavor = keystone

③ /etc/glance/glance-api-paste.ini 和 /etc/glance/glance-registry-paste.ini,找到文件末尾, 修改为下面这样,注意把ip 地址改成 keystone 服务器地址,并且设置正确 tenantName user 和 password。

- 24 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

(3) 建立镜像文件夹

sudo mkdir -p /var/lib/glance/images

(4) 初始化数据库结构

sudo glance-manage db_sync

3. 注册 Glance 到 Keystone

keystone

service-create

--name=Glance

--type=image

--description=\返回 service 的 id,然后,利用这个 id 注册,以下是一个例子:

keystone endpoint-create --service_id= \\ --region RegionOne \\

--publicurl http://10.0.0.11:9292/v1 \\ --adminurl http://10.0.0.11:9292/v1 \\ --internalurl http://10.0.0.11:9292/v1

4. 问题分析

做 Glance 的存储,其实既可以用 file,也可以用 Swift。选择用 file,好处是当Swift 崩溃时,glance 的镜像不会受影响。

三、 Nova 的安装与问题分析

1. 安装 Nova

(1) 安装必要的软件和 Python 依赖项

sudo apt-get install build-essential git python-dev python-setuptools python-pip python-mysqldb libxml2-dev libxslt-dev sudo apt-get install rabbitmq-server bridge-utils sudo rabbitmqctl change_password guest openstack

sudo apt-get install lvm2 iscsitarget open-iscsi iscsitarget-source iscsitarget-dkms 配置 nova-volume

sudo apt-get install libhivex0 btrfs-tools cryptsetup diff libaugeas0 reiserfsprogs zfs-fuse

jfsutils scrub xfsprogs zerofree libfuse2 sudo /etc/init.d/tgt start

- 25 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

(2) 签出代码后,直接安装

cd ~/nova

sudo pip install -r tools/pip-requires sudo python setup.py install

2. 安装虚拟机 Hypervisor

现在,有了一个桥接设备,桥接在物理网卡 eth1 上, 那么接下来需要设置一下虚拟机的运行环境和Libvirt,这样nova就可以通过Libvirt连接到虚拟机Hypervisor。执行:

sudo apt-get install qemu libvirt-bin libvirt-dev python-libvirt kvm ebtables nbd-server

nbd-client qemu-kvm

3. 配置数据库

Nova 需要使用数据库来存放实例数据和一些配置数据,所以需要配置一下数据库。

执行: mysql -u root -p create database nova;

grant all on nova.* to 'nova'@'%' identified by 'openstack'; grant all on nova.* to 'nova'@localhost identified by 'openstack';

4. 配置 volume

Openstack Volume 来作为镜像启动,这里配置正常了,后面的DashBoard(Horizon)里可以通过 Web 界面管理 Volume, Nova-Volume 需要一个单独的分区来做 LVM。假设使用 sda7:

sudo sed -i 's/false/true/g' /etc/default/iscsitarget sudo service iscsitarget restart sudo pvcreate /dev/sda7

sudo vgcreate nova-volumes /dev/sda7 初始化数据库表结构: sudo nova-manage db sync

5. 启动服务

经过刚才的设置,现在可以启动 Nova: sudo nova-api &

- 26 -

火龙果?整理 uml.org.cn sudo nova-compute & sudo nova-scheduler & sudo nova-network & sudo nova-volume & 确认服务是否正常:

重庆邮电大学本科毕业设计(论文)

6. 注册 nova 到 Keystone

现在如果让 OpenStack 的其他服务使用 Nova,要像其他服务一样,为 Nova 创建一个 Service Endpoint。登录到 Keystone 所在服务器,使用 Keystone Client 来为 Nova注册 Service 和 Service Endpoint。Nova 我们为其安装了 Compute 和 Volume,这是DashBoard 控制 Nova 的两个服务。执行:

keystone service-create --name=Nova --type=compute --description=\Compute Service\

keystone service-create --name=Volume --type=volume --description=\VolumeService\

然后,利用:keystone service-list返回 service id,在通过这个 id 来创建 endpoint

7. 问题分析

① nova-volume 无法正常访问:此时需要检查是否正常创建了 lvm 卷,然后检查nova.conf 是否指定了volume-name。本次实验创建的卷名为 nova-volumes,这也是系统默认的命名, 如果修改了这个名称,则需要在 nova.conf 里指定。

② 虚拟机无法正常启动:需要检查 libvirt-type 是什么,镜像是否有问题,以及libvirt 是否有权限访问你的 instance 目录。

③ 网络无法访问:可以尝试创建一个 floating ip range 来解决这个问题。 ④ 无法获得镜像文件:这个问题是由于 glance 访问 swift 的一个 bug。先使用 glance index 来确认是否能列出镜像,如果 nova-compute 里报 Image Not Found 这样的错误,那 么 就 要 去 跟 踪 当 验 证 swift 的 时 候 , 给 出 的 auth_url 是 否 是http://[ yourip]:5000/v2.0,如果是,那么需要对这个 url 后面加上一个/,否则会拿不到 swift proxy-server 的 endpoint。

⑤ Nova 安装完后,nova-network 服务已经运行,但是用 nova-manage service list指令却查看不到 nova-network 服务。后来通过修改 nova.conf 文件解决,添加了以下项目:

dhcpbridge_flagfile=/etc/nova/nova.conf

- 27 -

火龙果?整理 uml.org.cn logdir=/var/log/nova state_path=/var/lib/nova

重庆邮电大学本科毕业设计(论文)

lock_path=/var/lock/nova use_deprecated_auth=false

resume_guests_state_on_host_boot=true root_helper=sudo nova-rootwrap

第三节 本章小结

本章是最艰难的也是最有挑战性的,从基础环境的配置开始,完成之后开始安装各种软件包,每安装一个软件包后都要进行详细的配置文件的修改,这章节对这个艰难的过程给出了详细的安装步骤和详细的指导说明。本章将会花费很长得时间和尽力会有很多此的重来,通过解决安装中的各种问题,将会对openstack云平台的实现有更深入的理解。

- 28 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

第六章 Openstack云平台的测试

第一节 对各项服务的启动测试

① instance的成功创建必须先启动openstack的各项服务,如图6.1对openstack的keystone认证服务、glance镜像服务以及nova计算服务和网络服务成功的启动

图6.1对各项服务成功启动

第二节 创建instance

① 首先检查nova所支持的类型,因为我是在虚拟机里创建的所以选择最小的类型,选择的网络为ext-net外部网络,并且给予ssh访问权限,最终如下图6.2实例启动成功,在浏览器中和securecrt中可以访问实例并获得IP地址且可以访问外网218.201.22.9。证明实例创建成功。

- 29 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

图6.2创建instance

- 30 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

第三节 本章小结

这章节主要是完成对第五章的所有安装的进行验证是否安装正确,每一个所需的服务是否都已启动,之后是启动一个instance的过程,并对实例的成功启动之后进行网络测试。通过测试可以检测是否安装成功,并且从命令行的操作转换的web界面,这样既方便有直观更可以加强对openstack云平台的理解。

- 31 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

第七章 结 论

作为一种新兴的资源使用和交付模式,云计算已为学术界和产业界所认知,形成了比较成熟的服务模式,使得计算资源成为向大众提供服务的社会基础设施。开源云计算平台被认为是 IT 的趋势。OpenStack 作为一种开源的云操作系统,自推出以来受到业界的普遍关注。

本文基于OpenStack云计算平台安装部署了云平台。并将实验中出现的问题加以汇总,可作为安装部署 OpenStack 云计算平台的参考。

针对本文所完成的主要工作,总结如下:

①从国内的不同角度出发,详细介绍了云计算目前的发展情况。通过与国外云计算发展情况的对比,可以看到我国云计算发展上存在诸多不足。对我国云计算的发展进行了展望。

②介绍了Iaas相关内容,从Iaas的概述、服务特征优势以及Iaas的整体架构通过这些介绍对云平台的搭建有很好的帮助。

③介绍了 OpenStack 的发展历史、项目组成、概念架构和逻辑架构,并依托现有条件,基于开源云计算平台 OpenStack 安装部署了一个云平台,并将安装部署中的问题作了总结,

针对构建出的云计算平台,指出存在的不足,以及下一步工作的展望: ①目前 OpenStack 存在着诸如因版本更新过快而导致的问题,使得新老版本之间不能很好地兼容。

②由于 OpenStack 的开源特性,有时会出现比较难以维护自己的代码,以及难以使用自己代码更新版本的问题,并且由于国内研究和开发 OpenStack 的人员还属少数,在一定程度上增加了安装部署 OpenStack 的难度。

- 32 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

致 谢

三年的学习生活,工作室是我最熟悉的地方,这里的每个桌椅都有我留下的印记,每个角落都有我走过的脚步,这是成长的地方,这里的每个人伴同我一起成长一起学习,大家的相互鼓励和支持,也给了我精神上前进的力量,让我学会坚强。尤其在毕业设计和论文写作过程中,大家也给了我不少帮助。

还要感谢班上的所有同学和我宿舍的同窗好友,大家的相互帮助和鼓励,彼此之间也给了我莫大的支持。

同时感谢将参加答辩和评审的各位老师,谢谢您们能在百忙之中审阅我的论文。

最后感谢本文所引用参考文献的作者,对你们的成果和学术表示诚挚的谢意。

- 33 -

火龙果?整理 uml.org.cn

重庆邮电大学本科毕业设计(论文)

参考文献

[1] 戴元顺. 云计算技术简述[J]. 信息通信技术, 2010(2). [2] Amazon AmazonEC2 http://aws.amazon.com/ec2/ [3] Google Google App Engine http://appengine.google.com/

[4] 韩星晔,李新明. 云计算军事应用研究[M]. 北京:人民邮电出版社2009 [5] Mierosoft Windows Asure http://www.mierosoft.eom/windowsazure/

[6] 王鹏,黄华峰,曹珂著. 云计算:中国未来的 IT战略[M]. 北京:人民邮电出版社,2010.

[7] 崔倩楠. 基于云计算环境的虚拟化资源平台研究与评价[D].北京:北京邮电大学,2011.

[8] 郑绍辉. 硬件虚拟机的设计与实现[D]. 成都:电子科技大学,2008 [9] OpenStack stater guide. OpenStack homepage.http://www.OpenStack.org/ [10] Flatnetwork.Wikipedia.http://en.wikipedia.org/wiki/Flat_network [11] George Reese 著. 云计算应用架构[M]. 北京:电子工业出版社,2010. [12] 陈全,邓倩妮. 云计算及其关键技术[J]. 计算机应用,2009. [13] 王鹏著. 走进云计算[M]. 北京:人民邮电出版社,2009.

[14] Katsaros, D.;Pallis, G.;Sivasubramanian, S.;Vakali, A. Cloud computing [Guest Editorial][J]. Network, IEEE,2011,Vol.25(No.4): 4-5.

[15] 马克·贝尼奥夫,卡莱尔·阿德勒著. 云攻略:云计算革命先锋的创业秘籍[M]. 深圳:海天出版社,2010. [16] IBM

Blue

Cloud

.

http://www.zdnet.com.cn/wiki-IBM_BlueCloud [17] http://zh.wikipedia.org/wiki/Windows_Azure [18] http://www.server110.com/openstack/201403/6926.html

[19] M.Armbrust, A.Fox, R.Griffith, et al. Above the clouds: a Berkeley view of cloud computing. Techinical Report [R]. 2009.

[20] 杨正洪,郑齐心,吴寒著 企业云计算架构与实施指南[M] 北京:清华大学出版社,2010.

- 34 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

附 录

一、英文原文:

The Benefits of Facebook “Friends:”

Social Capital and College Students’ Use of Online

Social Network Sites

An Overview of Facebook

Created in 2004, by 2007 Facebook was reported to have more than 21 million registered members generating 1.6 billion page views each day (Needham &Company, 2007). The site is tightly integrated into the daily media practices of its users: The typical user spends about 20 minutes a day on the site, and two-thirds of users log in at least once a day (Cassidy, 2006; Needham & Company, 2007). Capitalizing on its success among college students, Facebook launched a high school version in early September 2005. In 2006, the company introduced communities for commercial organizations; as of November 2006, almost 22,000 organizations had Facebook directories (Smith, 2006). In 2006, Facebook was used at over 2,000 United States colleges and was the seventh most popular site on the World Wide Web with respect to total page views (Cassidy, 2006).

Much of the existing academic research on Facebook has focused on identity presentation and privacy concerns (e.g., Gross & Acquisti, 2005; Stutzman, 2006). Looking at the amount of information Facebook participants provide about themselves, the relatively open nature of the information, and the lack of privacy controls enacted by the users, Gross and Acquisti (2005) argue that users may be putting themselves at risk both offline (e.g., stalking) and online (e.g., identify theft). Other recent Facebook research examines student perceptions of instructor presence and self-disclosure (Hewitt & Forte, 2006; Mazer, Murphy, & Simonds, 2007), temporal patterns of use (Golder, Wilkinson, & Huberman, 2007), and the relationship between profile structure and friendship articulation (Lampe, Ellison, & Steinfield, 2007).

In contrast to popular press coverage which has primarily focused on negative outcomes of Facebook use stemming from users’ misconceptions about the nature of

- 35 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

their online audience, we are interested in situations in which the intended audience for the profile (such as well-meaning peers and friends) and the actual audience are aligned. We use Facebook as a research context in order to determine whether offline social capital can be generated by online tools. The results of our study show that Facebook use among college-age respondents was significantly associated with measures of social capital.

Literature Review

Social Capital: Online and Offline

Social capital broadly refers to the resources accumulated through the relationships among people (Coleman, 1988). Social capital is an elastic term with a variety of definitions in multiple fields (Adler & Kwon, 2002), conceived of as both a cause and an effect (Resnick, 2001; Williams, 2006). Bourdieu and Wacquant (1992) define social capital as “the sum of the resources, actual or virtual, that accrue to an individual or a group by virtue of possessing a durable network of more or less institutionalized relationships of mutual acquaintance and recognition” (p. 14). The resources from these relationships can differ in form and function based on the relationships themselves.

Social capital has been linked to a variety of positive social outcomes, such as better public health, lower crime rates, and more efficient financial markets (Adler & Kwon, 2002). According to several measures of social capital, this important resource has been declining in the U.S. for the past several years (Putnam, 2000). When social capital declines, a community experiences increased social disorder, reduced participation in civic activities, and potentially more distrust among community members. Greater social capital increases commitment to a community and the ability to mobilize collective actions, among other benefits. Social capital may also be used for negative purposes, but in general social capital is seen as a positive effect of interaction among participants in a social network (Helliwell & Putnam, 2004).

For individuals, social capital allows a person to draw on resources from other members of the networks to which he or she belongs. These resources can take the form of useful information, personal relationships, or the capacity to organize groups (Paxton, 1999). Access to individuals outside one’s close circle provides access to non-redundant information, resulting in benefits such as employment connections (Granovetter, 1973). Moreover, social capital researchers have found that various forms of social capital, including ties with friends and neighbors, are related to indices

- 36 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

of psychological well-being, such as self-esteem and satisfaction with life (Bargh & McKenna, 2004; Helliwell & Putnam, 2004).

Putnam (2000) distinguishes between bridging and bonding social capital. The former is linked to what network researchers refer to as “weak ties,” which are loose connections between individuals who may provide useful information or new perspectives for one another but typically not emotional support (Granovetter, 1982). Alternatively, bonding social capital is found between individuals in tightly-knit, emotionally close relationships, such as family and close friends. After briefly describing the extant literature on these two forms of social capital and the Internet, we introduce an additional dimension of social capital that speaks to the ability to maintain valuable connections as one progresses through life changes. This concept, “maintained social capital,” permits us to explore whether online network tools enable individuals to keep in touch with a social network after physically disconnecting from it.

Social Capital and the Internet

The Internet has been linked both to increases and decreases in social capital. Nie (2001), for example, argued that Internet use detracts from face-to-face time with others, which might diminish an individual’s social capital. However, this perspective has received strong criticism (Bargh & McKenna, 2004). Moreover, some researchers have claimed that online interactions may supplement or replace in-person interactions, mitigating any loss from time spent online (Wellman, Haase, Witte, & Hampton, 2001). Indeed, studies of physical (e.g., geographical) communities supported by online networks, such as the Netville community in Toronto or the Blacksburg Electronic Village, have concluded that computer-mediated interactions have had positive effects on community interaction, involvement, and social capital (Hampton & Wellman, 2003; Kavanaugh, Carroll, Rosson, Zin, & Reese, 2005).

Recently, researchers have emphasized the importance of Internet-based linkages for the formation of weak ties, which serve as the foundation of bridging social capital. Because online relationships may be supported by technologies like distribution lists, photo directories, and search capabilities (Resnick, 2001), it is possible that new forms of social capital and relationship building will occur in online social network sites. Bridging social capital might be augmented by such sites, which support loose social ties, allowing users to create and maintain larger, diffuse networks of relationships from which they could potentially draw resources (Donath & boyd,

- 37 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

2004; Resnick, 2001; Wellman et al., 2001). Donath and boyd (2004) hypothesize that SNSs could greatly increase the weak ties one could form and maintain, because the technology is well-suited to maintaining such ties cheaply and easily.

Based on this prior work, we propose the following hypothesis:

H1: Intensity of Facebook use will be positively associated with individuals’ perceived bridging social capital.

In Putnam’s (2000) view, bonding social capital reflects strong ties with family and close friends, who might be in a position to provide emotional support or access to scarce resources. Williams (2006) points out that little empirical work has explicitly examined the effects of the Internet on bonding social capital, although some studies have questioned whether the Internet supplements or supplants strong ties (see Bargh & McKenna, 2004, for a review). It is clear that the Internet facilitates new connections, in that it provides people with an alternative way to connect with others who share their interests or relational goals (Ellison, Heino, & Gibbs, 2006; Horrigan, 2002; Parks & Floyd, 1996). These new connections may result in an increase in social capital; for instance, a 2006 Pew Internet survey reports that online users are more likely to have a larger network of close ties than non-Internet users, and that Internet users are more likely than non-users to receive help from core network members (Boase, Horrigan, Wellman, & Rainie, 2006). However, it is unclear how social capital formation occurs when online and offline connections are closely coupled, as with Facebook. Williams (2006) argues that although researchers have examined potential losses of social capital in offline communities due to increased Internet use, they have not adequately explored online gains that might compensate for this. We thus propose a second hypothesis on the relationship between Facebook use and close ties:

H2: Intensity of Facebook use will be positively associated with individuals’ perceived bonding social capital.

Online social network tools may be of particular utility for individuals who otherwise have difficulties forming and maintaining both strong and weak ties. Some research has shown, for example, that the Internet might help individuals with low psychological well-being due to few ties to friends and neighbors (Bargh & McKenna, 2004). Some forms of computer-mediated communication can lower barriers to interaction and encourage more self-disclosure (Bargh, McKenna, & Fitzsimons, 2002; Tidwell & Walther, 2002); hence, these tools may enable connections and interactions

- 38 -

火龙果?整理 uml.org.cn 重庆邮电大学本科毕业设计(论文)

that would not otherwise occur. For this reason, we explore whether the relationship between Facebook use and social capital is different for individuals with varying degrees of self-esteem (Rosenberg, 1989) and satisfaction with life (Diener, Suh, & Oishi, 1997; Pavot & Diener, 1993), two well-known and validated measures of subjective well-being. This leads to the two following pairs of hypotheses:

H3a: The relationship between intensity of Facebook use and bridging social capital will vary depending on the degree of a person’s self-esteem.

H3b: The relationship between intensity of Facebook use and bridging social capital will vary depending on the degree of a person’s satisfaction with life.

H4a: The relationship between intensity of Facebook use and bonding social capital will vary depending on the degree of a person’s self-esteem.

H4b: The relationship between intensity of Facebook use and bonding social capital will vary depending on the degree of a person’s satisfaction with life.

Maintained Social Capital and Life Changes

Social networks change over time as relationships are formed or abandoned. Particularly significant changes in social networks may affect one’s social capital, as when a person moves from the geographic location in which their network was formed and thus loses access to those social resources. Putnam (2000) argues that one of the possible causes of decreased social capital in the U.S. is the increase in families moving for job reasons; other research has explored the role of the Internet in these transitions (Cummings, Lee, & Kraut, 2006; Wellman et al., 2001). Wellman et al. (2001), for example, find that heavy Internet users rely on email to maintain long distance relationships, rather than using it as a substitute for offline interactions with those living nearby.

Some researchers have coined the term “friendsickness” to refer to the distress caused by the loss of connection to old friends when a young person moves away to college (Paul & Brier, 2001). Internet technologies feature prominently in a study of communication technology use by this population by Cummings, Lee, and Kraut (2006), who found that services like email and instant messaging help college students remain close to their high school friends after they leave home for college. We therefore introduce a measure focusing specifically on the maintenance of existing social capital after this major life change experienced by college students, focusing on their ability to leverage and maintain social connections from high school.

- 39 -

本文来源:https://www.bwwdw.com/article/ki5v.html

Top