openstack安装图解.docx_第1页
openstack安装图解.docx_第2页
openstack安装图解.docx_第3页
openstack安装图解.docx_第4页
openstack安装图解.docx_第5页
已阅读5页,还剩48页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

本帖最后由 cryboy2001 于 2014-08-15 14:52 编辑目录1、云计算与openstack介绍传统的信息中心云计算介绍openstack介绍物理架构2、openstack架构3、安装openstack方法4、使用openstack5、openstack配置文件6、管理openstack7、详解openstack计算资源池存储资源池网络资源池Glance镜像资源池前端界面Keystone认证管理(不管会不会写完,象openstack一样,先把框架搞大点)一、云计算与openstack介绍1、传统的信息中心。当然下面画的很简单(自己画的),如果加上多个出口、设备冗余、线路冗余、服务器集群就会复杂。云计算就是用虚拟技术实现以下功能,如果理解了下面的网络功能,要理解openstack会很简单的,在openstack中都有与下面图中对应的模块。缺点:1、部署应用时间长,工作量大,至少几个月2、资源利用率,有的服务器资源不够用,有的服务器大量资源浪费。2、管理复杂 3、扩展麻烦,灵活性差。等等,这些也是云计算的优点。2、云计算介绍云计算( Cloud Computing )是网格计算( Grid Computing) 、分布式计算 ( DistributedComputing ) 、并行计算( ParallelComputing ) 、效用计算( UtilityComputing ) 、网络存储( Network Storage Technologies ) 、虚拟化( Virtualization ) 、负载均衡 ( Load Balance )等传统计算机技术(如以上图)和网络技术发展融合的产物。个人理解:把一堆功能小的设备,整合成一大个功能强大设备,再把这个强大的设备划分成小设备,然后按你的需要买给你。公用云(Public Cloud)、私有云(Private Cloud)、混合云(Hybrid Cloud)云计算解决方案:VMware vSphere、微软云计算解决方案、亚马逊AWS、OpenStack等等3、openstack介绍OpenStack是一个NASA和Rackspace2010年6月合作成立的,以Apache许可证授权,并且是一个自由软件和开放源代码项目。OpenStack是一个云平台管理的项目,它不是一个软件,主要参考亚马逊AWS,由很多其他开源软件整合而成的。 - 以Python编程语言编写 - 整合Tornado网页服务器、Nebula运算平台 - 使用Twisted软件框架 - 遵循Open Virtualization Format、AMQP、SQLAlchemy等标准 - 虚拟机器软件支援包括:KVM、Xen、VirtualBox、VMware、Hyper-V版本发布以ABC顺序,很好记。2010年10月发布Austin2011年2月 发布Bexar2011年4月 发布Cactus2011年7月 发布Diablo2012年4月 发布Essex2012年10月 发布Folsom2013年4月 发布Grizzly2013年10月发布Havana2014年4月发布Icehouse最新版得到了这么多公司的支持,能不成功吗?4、物理架构小到家里一台电脑(“家云”)、企业N多台(私有云)大到几千台信息中心(公有云)、openstack架构非常的大,可以包含VMware sphere、MS Hyper-V、SDN等。二、openstack架构openstack核心组成主要有对象存储(Swift):通过key/value的方式实现对文件的存储,现在的云盘就是这样的计算管理(Nova):提供虚拟主机,通过虚拟技术(kvm、Xen、VMware等)网络管理(Quantum):实现虚拟机的网络资源管理如网络连接、ip管理、公网映射块存储(Cinder):为虚拟机提供存储,目前支持ip-san、fc-san等镜像管理(Glance): 包含系统的存储空间身份认证(Keystone):统一的授权、认证管理界面(Horiaon):安装好后,用到的web网页的控制台DashBoard上图网上找的,可能是台湾大牛画的,叫法稍有不同,相信大家能看懂的。AMQP是整个openstack的核心,所有功能的实现,都是由AMQP与相应api接口交互。三、安装openstack方法现在openstack的安装方法非常的多,其中Devstack 、OneStack:、RDO都很简单,我这里是在一台服务器上Centos 6.5版下,用RDO allinone方式安装Icehouse最新版。官方文档也非常简单,就一页/Quickstart1)最小化安装centos6.52)配置好网络能上网3)设置主机名 要格式#hostname #vi /etc/sysconfig/networkHOSTNAME=4)关掉selinux#vi /etc/selinux/configSELINUX=disabled5)改/etc/hosts#vi /etc/6)加源epel,与rdo,最好加一下163源#yum -y installwget#wget/.help/CentOS6-Base-163.repomv CentOS6-Base-163.repo /etc/yum.rope/CentOS-Base.repoyum -y install/pub/ . ase-6-8.noarch.rplm#yum install -y/rdo-release.rpm#yum clean all#yum makecache7)更新#yum -y update更新好了后一定要重启电脑8)安装openstack#yum install -y openstack-packstack#packstack -allinone如果中断了,找到问题后,再安装用# packstack -answer-file /root/packstack-answers-20140807-131342.txt#这个文件时安装出错时产生的好了之后会出现如下:安装看起来好简单哦,不过所有的事情,做起来就不会这么简单了。下面是我安装时出现的各种错误。大多原因是因为服务器在国外,国内安装会下载文件出问题造成的。如果上面服务器只有一块网卡,是不能加浮动ip地址的(有人说可以),也就是可以产生虚拟机与虚拟网络,但不能与外部相连,所以我又备了一块网卡eth1。vi /etc/sysconfig/network-scripts/ifcfg-eth1DEVICE=eth1TYPE=OVSPortDEVICETYPE=ovsOVS_BRIDGE=br-exONBOOT=yesHWADDR=00:50:45:02:8A:55# vi /etc/sysconfig/network-scripts/ifcfg-br-exDEVICE=br-exDEVICETYPE=ovsTYPE=OVSBridgeBOOTPROTO=staticIPADDR=00NETMASK=ONBOOT=yes重启网络以后的浮动ip网段我就用/24本帖最后由 cryboy2001 于 2014-08-15 15:50 编辑四、openstak使用密码在/root/下-rw- 1 root root 183 Aug 12 17:12 keystonerc_admin-rw- 1 root root 180 Aug 12 17:12 keystonerc_demo这两个文件中,自带的2个用户admin与demo。项目与管理员及下面的目录1、在dashboard中,管理员下修改网络功能、加镜像、改云主机类型,云硬盘。然后要部署应用在项目中进行。加外网(浮动ip段)上传镜像云硬盘下面生成一台虚拟实例,能够上网,能通过外面的电脑ssh进入进入项目-网络 添加私有网络加路由加接口得到的网络拓扑加安全规责创建云主机浏览器直接用的novnc自动得到的IP与ping openstack服务器 外网的一台主机,表明完全通了外网ssh进入虚拟主机挂载云硬盘在云主机中挂载操作本帖最后由 cryboy2001 于 2014-08-16 11:11 编辑用linux总是离不开用命令行操作加镜像glance add name= is_public=true container_format=ovf disk_format=qcow2 .imgnova image-list查看查看虚拟机类型nova flavor-list查看可用网络nova network-list生成一个实例要用到以上的镜像、虚拟机类型、和可用网络nova boot -flavor 1 -image cirros -nic net-id=037c1fa2-3f35-4cab-a229-c236380f4a7bcmdtest为虚拟机加浮动ipnova add-floating-ip cmdtest 4查看生成的虚拟机nova show cmdtest利用浮动ip,从公网ssh进入加一10G云盘nova volume-create -display_name vdisk10 10nova volume-listnova volume-attach cmdtest vdisk10 /dev/vdb可看到已加成功,可分区挂载使用了附其它命令nova absolute-limits Print a list of absolute limits for a user actions Retrieve server actions. add-fixed-ip Add new IP address to network. add-floating-ip Add a floating IP address to a server. add-secgroup Add a Security Group to a server. aggregate-add-hostAdd the host to the specified aggregate. aggregate-create Create a new aggregate with the specified details. aggregate-delete Delete the aggregate by its id. aggregate-details Show details of the specified aggregate. aggregate-list Print a list of all aggregates. aggregate-remove-host Remove the specified host from the specifiedaggregate. aggregate-set-metadata Update the metadata associated with the aggregate. aggregate-update Update the aggregates name and optionallyavailability zone. boot Boot a new server. cloudpipe-create Create a cloudpipe instance for the given project cloudpipe-list Print a list of all cloudpipe instances. cloudpipe-update Update a cloudpipe instance console-log Get console log output of a server. credentials Show user credentials returned from auth delete Immediately shut down and delete a server. diagnostics Retrieve server diagnostics. dns-create Create a DNS entry for domain, name and ip. dns-create-private-domainCreate the specified DNS domain. dns-create-public-domainCreate the specified DNS domain. dns-delete Delete the specified DNS entry. dns-delete-domain Delete the specified DNS domain. dns-domains Print a list of available dns domains. dns-list List current DNS entries for domain and ip or domain and name. endpoints Discover endpoints that get returned from theauthenticate services fixed-ip-get Show information for a fixed IP fixed-ip-reserve Reserve a fixed IP fixed-ip-unreserveUnreserve fixed IP flavor-create Create a new flavor flavor-delete Delete a specific flavor flavor-key Set or unset extra_spec for a flavor. flavor-list Print a list of available flavors (sizes of servers). flavor-show Show details about the given flavor. floating-ip-createAllocate a floating IP for the current tenant. floating-ip-deleteDe-allocate a floating IP. floating-ip-list List floating ips for this tenant. floating-ip-pool-list List all floating ip pools. get-vnc-console Get a vnc console to a server. host-action Perform a power action on a host. host-describe Describe a specific host host-list List all hosts by service host-update Update host settings. hypervisor-list List hypervisors. hypervisor-serversList instances belonging to specific hypervisors. hypervisor-show Display the details of the specified hypervisor. hypervisor-stats Get hypervisor statistics over all compute nodes.cpu,mem hypervisor-uptime Display the uptime of the specified hypervisor. image-create Create a new image by taking a snapshot of a running server. image-delete Delete an image. image-list Print a list of available images to boot from. image-meta Set or Delete metadata on an image. image-show Show details about the given image. keypair-add Create a new key pair for use with instances keypair-delete Delete keypair by its id keypair-list Print a list of keypairs for a user list List active servers. list-extensions List available extensions live-migration Migrates a running instance to a new machine. lock Lock a server. meta Set or Delete metadata on a server. migrate Migrate a server. network-list Print a list of available networks. network-show Show details about the given network. pause Pause a server. quota-class-show List the quotas for a quota class. quota-class-updateUpdate the quotas for a quota class. quota-defaults List the default quotas for a tenant. quota-show List the quotas for a tenant. quota-update Update the quotas for a tenant. rate-limits Print a list of rate limits for a user reboot Reboot a server. rebuild Shutdown, re-image, and re-boot a server. remove-fixed-ip Remove an IP address from a server. remove-floating-ipRemove a floating IP address from a server. remove-secgroup Remove a Security Group from a server. rename Rename a server. rescue Rescue a server. reset-state Reset the state of an instance resize Resize a server. resize-confirm Confirm a previous resize. resize-revert Revert a previous resize (and return to the previous VM). resume Resume a server. root-password Change the root password for a server. secgroup-add-group-rule Add a source group rule to a security group. secgroup-add-rule Add a rule to a security group. secgroup-create Create a security group. secgroup-delete Delete a security group. secgroup-delete-group-rule Delete a source group rule from a security group. secgroup-delete-rule Delete a rule from a security group. secgroup-list List security groups for the current tenant. secgroup-list-rules List rules for a security group. service-list List nova services show Show details about the given server. ssh SSH into a server. start Start a server. stop Stop a server. suspend Suspend a server. unlock Unlock a server. unpause Unpause a server. unrescue Unrescue a server. usage-list List usage data for all tenants volume-attach Attach a volume to a server. volume-create Add a new volume. volume-delete Remove a volume. volume-detach Detach a volume from a server. volume-list List all the volumes. volume-show Show details about a volume. volume-snapshot-create Add a new snapshot. volume-snapshot-delete Remove a snapshot. volume-snapshot-list List all the snapshots. volume-snapshot-show Show details about a snapshot. volume-type-createCreate a new volume type. volume-type-deleteDelete a specific flavor. volume-type-list Print a list of available volume types. x509-create-cert Create x509 cert for a user in tenant. x509-get-root-certFetches the x509 root cert.管理openstack1、服务在控制台系统信息中也能看到OpenStack中Nova相关的服务nova-compute:运行虚拟机实例最主要的服务。nova-scheduler:管理调度服务器满足对运行虚拟机的请求。nova-api:处理对OpenStack的请求,并运行相应的服务。neutron:控制DHCP、DNS、路由的网络服务。nova-objectstore:文件存储服务。nova-common:OpenStack环境的基础Python库。nova-cert:Nova证书管理服务,用来为Nova提供身份验证。glance:镜像注册与传输服务。rabbitmq-server:消息队列服务。mysql-server:保存所有OpenStack服务数据的数据库服务,例如可用的计算节点、实例状态等。ntp:网络时间协议,它在多节点的环境中十分重要,可以让计算节点保持相同的时钟。dnsmasq:前向DNS和DHCP服务,用来为实例分配地址。2、日志与openstack相关的日志都在#ll/var/logdrwxr-x- 2 rabbitmq rabbitmq 4096 Aug 17 03:47 rabbitmqdrwxr-xr-x 2 root root 4096 Aug 17 03:47 openvswitchdrwxr-x- 2 nova nova 4096 Aug 17 03:47 novadrwxr-xr-x 2 neutron neutron 4096 Aug 17 03:47 neutrondrwxr-x- 2 keystone keystone 4096 Aug 17 03:47 keystonedrwxr-xr-x 2 glance nobody 4096 Aug 17 03:47 glancedrwxr-x- 2 cinder root 4096 Aug 17 03:47 cinderdrwxr-xr-x 2 ceilometer root 4096 Aug 17 03:47 ceilometerdrwxr-xr-x 2 mongodb root 4096 Aug 17 03:47 mongodbdrwx- 5 root root 4096 Aug 14 10:20 libvirt要查看一个实例日志3、监控与nagios管理员-资源使用情况 中有服务器的监控系统也已安装好了nagios18/nagios/密码在下面的位置# cat /etc/nagios/passwdnagiosadmin:eYuEUytV/nRpInagios相关配置文件在,可以修改参数已达到资源使用到一定成度时或服务停止运行时报警。#ll /etc/nagiostotal 96-rw-rw-r- 1 root root 11658 Aug 31 2013 cgi.cfgdrwxr-x- 2 root nagios 4096 Aug 31 2013 conf.d-rw- 1 nagios root 141 Aug 14 10:30 keystonerc_admin-rw-rw-r- 1 root root 44650 Aug 14 10:30 nagios.cfg-rw-r-r- 1 nagios nagios 1016 Aug 14 10:30 nagios_command.cfg-rw-r-r- 1 nagios nagios 331 Aug 14 10:30 nagios_host.cfg-rw-r-r- 1 nagios nagios 1295 Aug 14 10:30 nagios_service.cfg-rw-r-r- 1 nagios nagios 8077 Aug 14 10:30 nrpe.cfgdrwxr-x- 2 root nagios 4096 Aug 14 10:30 objects-rw-r- 1 root apache 27 Aug 14 10:30 passwddrwxr-x- 2 root nagios 4096 Aug 14 10:30 privatenogias界面nogias监控内容在命令行方式下也可以看到使用情况:在数据库中也能找到安装会出问题一般有以下几个方面:1、平台,最小化安装,除非硬件有问题。2、设置,只要按以上几个地方设就可以了。3、网络传输中断,这个没办法,服务器在国外,没很好的方法,只要确认以上几点,最后坚信能成功。如果是用最新的系统如centos 7,出现问题(bug)可在下面查/Workarounds但这个也只是最新的临时解决方法,说出来也没什么意思,因为过几天可能就修正了。如果出错还不行,就重复以上步骤,也可以删除掉重来。下面是rhel网上的全删除方法。1. # Warning! Dangerous step! Destroys VMs2. for x in $(virsh list -all | grep instance- | awk print $2) ; do3. virsh destroy $x ;4. virsh undefine $x ;5. done ;6.7. # Warning! Dangerous step! Removes lots of packages, including many8. # which may be unrelated to RDO.9. yum remove -y nrpe *nagios* puppet ntp ntp-perl ntpdate *openstack* 10. *nova* *keystone* *glance* *cinder* *swift* 11. mysql mysql-server httpd *memcache* scsi-target-utils 12. iscsi-initiator-utils perl-DBI perl-DBD-MySQL ;13.14. ps -ef | grep -i repli | grep swift | awk print $2 | xargs kill ;15.16. # Warning! Dangerous step! Deletes local application data17. rm -rf /etc/nagios /etc/yum.repos.d/packstack_* /root/.f 18. /var/lib/mysql/ /var/lib/glance /var/lib/nova /etc/nova /etc/swift 19. /srv/node/device*/* /var/lib/cinder/ /etc/rsync.d/frag* 20. /var/cache/swift /var/log/keystone ;21.22. umount /srv/node/device* ;23. killall -9 dnsmasq tgtd httpd ;24. setenforce 1 ;25. vgremove -f cinder-volumes ;26. losetup -a | sed -e s/:.*/g | xargs losetup -d ;27. find /etc/pki/tls -name ssl_ps* | xargs rm -rf ;28. for x in $(df | grep /lib/ | sed -e s/.* /g) ; do29. umount $x ;30. done复制代码 openstack的强大之处在于,可以用很多的通用硬件,开源软件实现高可用,高性能,可以与商用高端机相媲美。就是用很多常用的硬件,把硬件损坏当成一种常态,用多个硬件冗余,形成高可用性。所以多台设备是必须的,很多openstack的功能也只有在很多台电脑上才能使用,如热迁移。下面来增加电脑了。增加一台nova-computerrhel网站资料/Adding_a_compute_node先在(新增主机)上做了好前面的工作如node1上一样再在node1上修改packstack-answers-20140824-123909.txt文件CONFIG_NOVA_COMPUTE_PRIVIF = eth1CONFIG_NOVA_NETWORK_PRIVIF= eth1 #(第二个网卡)CONFIG_NOVA_COMPUTE_HOSTS = 18,17#(要增加的主机ip)执行packstack -answer-file=packstack-answers-20140824-123909.txt出错了重新执行上一命令,完成了,出现如下对话框。在web下看看效果管理员-主机集合已经成功了。在node2上生成一个实例:node1上的日志2014-09-02 08:53:44.895 3102 INFO nova.scheduler.filter_scheduler req-67d567fc-19a4-41e6-9faa-f22531f1eb8b b19bdbbbe44a408db439a952174ff3fc b02e3c5f769845e9b52ed4c5235cd192 Choosing host WeighedHost host: , weight: 1.0 for instance 0ea75f2e-aa87-41a0-8852-814905db75e2node2上的日志:2014-09-02 08:54:23.975 1722 INFO pute.manager - Lifecycle event 3 on VM 0ea75f2e-aa87-41a0-8852-814905db75e22014-09-02 08:54:24.012 1722 INFO nova.virt.libvirt.driver - instance: 0ea75f2e-aa87-41a0-8852-814905db75e2 Instance spawned successfully.生成成功了增加存储用NFSNFS服务器ip为一、在存储上有nfs server,nfs服务器设置# rpm -qa |grep nfsnfs-utils-1.2.2-7.el6.x86_64nfs-utils-lib-1.1.5-1.el6.x86_64nfs4-acl-tools-0.3.3-5.el6.x86_64并已启动建一目录#mkdir /var/lib/nova/instanceschmod 777 /var/lib/nova/instances改 vi /etc/exports加入以下# vi /etc/exports/var/lib/nova/instances *(rw,sync,no_root_squash)# exportfs -r -v查看一下# showmount -e/var/lib/nova/instances *二、在nova-computer上挂载nfs到node3上查看一下rootnode3 # showmount -e Export list for :/var/lib/nova/instances *挂载步骤:1、停掉这台nova-computer上的实例2、把/var/lib/nova/instances中的文件先移走3、挂载nfs文件系统m

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论