版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、OpenStack完整安装手册(CentOS6.2) Table of Contents 1 实验环境 2 架构部署3 控制节点安装o 3.1 前提工作o 3.2 NTP时钟服务安装o 3.3 MYSQL数据库服务安装o 3.4 RABBITMQ消息队列服务安装o 3.5 PYTHON-NOVACLIENT库安装o 3.6 KEYSTONE身份认证服务安装o 3.7 PYTHON-KEYSTONECLIENT库安装o 3.8 SWIFT对象存储服务安装o 3.9 GLANCE镜像存储服务安装o 3.10 NOVA计算服务安装o 3.11 HORIZON管理面板安装o 3.12 NOVNC WE
2、B访问安装o 3.13 KEYSTONE身份认证服务配置o 3.14 GLANCE镜像存储服务配置o 3.15 建立GLANCE服务数据库o 3.16 NOVA计算服务配置o 3.17 SWIFT对象存储服务配置o 3.18 HORIZON管理面板配置o 3.19 NOVNC WEB访问配置4 计算节点安装o 4.1 前提工作o 4.2 NTP时钟同步配置o 4.3 PYTHON-NOVACLIENT库安装o 4.4 GLANCE镜像存储服务安装o 4.5 NOVA计算服务安装o 4.6 NOVA计算服务配置1 实验环境 硬件:DELL R710(1台)|-+-| CPU | Intel(R)
3、 Xeon(R) CPU E5620 2.40GHz * 2 |-+-| MEM | 48GB |-+-| DISK | 300GB |-+-| NIC | Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet * 4 |-+-|DELL R410(1台)|-+-| CPU | Intel(R) Xeon(R) CPU E5606 2.13GHz * 2 |-+-| MEM | 8GB |-+-| DISK | 1T * 4 |-+-| NIC | Broadcom Corporation NetXtreme II BCM5709
4、 Gigabit Ethernet * 4 |-+-| 系统:CentOS 6.2 x64 Openstack版本:Essex release(2012.1)2 架构部署 配置信息|-+-+-+-| Machine/Hostname | External IP | Internal IP | Used for |-+-+-+-| DELL R410/Control | 05 | | Control Node| DELL R710/Compute | 9 | | Compute Node|-+-+-+-|
5、实例网段为/24,Floating IP为10,实例网段桥接在内网网卡上,网络模式采用FlatDHCP控制节点 /dev/sda为系统盘,/dev/sdb为nova-volume盘,/dev/sdc、/dev/sdd为swift存储用 服务器系统安装1. CentOS 6.2 x64使用最小化安装方式2. 服务器外网使用eth03. 服务器内网使用eth14. 所有服务均监听3 控制节点安装3.1 前提工作 导入第三方软件源rpm -Uvh /pub/epel/6/i386/epel-rele
6、ase-6-5.noarch.rpmrpm -Uvh /rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm 安装依赖包yum -y install swig libvirt-python libvirt qemu-kvm python-pip gcc make gcc-c+ patch m4 python-devel libxml2-devel libxslt-devel libgsasl-devel openldap-devel sqlite-devel openssl-dev
7、el wget telnet gpxe-bootimgs gpxe-roms gpxe-roms-qemu dmidecode git scsi-target-utils kpartx socat vconfig aoetoolsrpm -Uvh /libvirt/6.3/x86_64/dnsmasq-utils-2.48-6.el6.x86_64.rpmln -sv /usr/bin/pip-python /usr/bin/pip 更新内核通过uname -r 查看原内核版本,应如下:2.6.32-220.el6.x86_64yum -y install
8、kernel kernel-develinit 6通过uname -r 查看更新后内核版本,应如下:2.6.32-220.7.1.el6.x86_643.2 NTP时钟服务安装 安装NTP时钟同步服务器yum install -y ntp 编辑/etc/ntp.conf,将文件内容替换为如下:restrict default ignorerestrict restrict mask nomodify notrapserver ntp.api.bzserver fudge stra
9、tum 10driftfile /var/lib/ntp/driftkeys /etc/ntp/keys 重启ntp服务/etc/init.d/ntpd start3.3 MYSQL数据库服务安装 安装MYSQL数据库服务yum install -y mysql-server 更改MYSQL数据库服务监听内网网卡IPsed -i /symbolic-links=0/a bind-address = /etc/f 启动MYSQL数据库服务/etc/init.d/mysqld start 设置MYSQL的root用户密码为openstackmysqladmin -
10、uroot password openstack;history -c 检测服务是否正常启动通过netstat -ltunp查看是否有tcp 3306端口监听如果没有正常启动请查看/var/log/mysqld.log文件排错3.4 RABBITMQ消息队列服务安装 安装RABBITMQ消息队列服务yum -y install rabbitmq-server 启动RABBITMQ消息队列服务/etc/init.d/rabbitmq-server start 更改RABBITMQ消息队列服务guest用户默认密码为openstackrabbitmqctl change_password gues
11、t openstack3.5 PYTHON-NOVACLIENT库安装 下载源码包wget /nova/essex/2012.1/+download/python-novaclient-2012.1.tar.gz -P /opt 安装依赖包yum -y install python-simplejson python-prettytable python-argparse python-nose1.1 python-httplib2 python-virtualenv MySQL-python 解压并安装PYTHON-NOVACLIENT库cd /opt
12、tar xf python-novaclient-2012.1.tar.gzcd python-novaclient-2012.1python setup.py installrm -f ./python-novaclient-2012.1.tar.gz3.6 KEYSTONE身份认证服务安装 下载源码包wget /keystone/essex/2012.1/+download/keystone-2012.1.tar.gz -P /opt 安装依赖包yum install -y python-eventlet python-greenlet python
13、-paste python-passlibpip install routes=1.12.3 lxml=2.3 pam=0.1.4 passlib sqlalchemy-migrate=0.7.2 PasteDeploy=1.5.0 SQLAlchemy=0.7.3 WebOb=1.0.8 解压并安装KEYSTONE身份认证服务cd /opttar xf keystone-2012.1.tar.gzcd keystone-2012.1python setup.py installrm -f ./keystone-2012.1.tar.gz3.7 PYTHON-KEYSTONECLIENT库安装
14、 下载源码包wget /keystone/essex/2012.1/+download/python-keystoneclient-2012.1.tar.gz -P /opt 解压并安装PYTHON-KEYSTONECLIENT库cd /opttar xf python-keystoneclient-2012.1.tar.gzcd python-keystoneclient-2012.1python setup.py installrm -f ./python-keystoneclient-2012.1.tar.gz3.8 SWIFT对象存储服务安装 下
15、载源码包wget /swift/essex/1.4.8/+download/swift-1.4.8.tar.gz -P /opt 安装依赖包pip install configobj=4.7.1 netifaces=0.6 解压并安装SWIFT对象存储服务cd /opttar xf swift-1.4.8.tar.gzcd swift-1.4.8python setup.py installrm -f ./swift-1.4.8.tar.gz3.9 GLANCE镜像存储服务安装 下载源码包wget /glance/
16、essex/2012.1/+download/glance-2012.1.tar.gz -P /opt 安装依赖包yum install -y python-anyjson python-kombu m2cryptopip install xattr=0.6.0 iso8601=0.1.4 pysendfile=2.0.0 pycrypto=2.3 wsgiref boto=2.1.1 解压并安装GLANCE镜像存储服务cd /opttar xf glance-2012.1.tar.gzcd glance-2012.1python setup.py installrm -f ./glance-
17、2012.1.tar.gz3.10 NOVA计算服务安装 下载源码包wget /nova/essex/2012.1/+download/nova-2012.1.tar.gz -P /opt 安装依赖包yum install -y python-amqplib python-carrot python-lockfile python-gflags python-netaddr python-suds python-paramiko python-feedparserpip install Cheetah=2.4.4 python-daemon=1.5.5
18、Babel=0.9.6 解压并安装NOVA计算服务cd /opttar xf nova-2012.1.tar.gzcd nova-2012.1python setup.py installrm -f ./nova-2012.1.tar.gz3.11 HORIZON管理面板安装 下载源码包wget /horizon/essex/2012.1/+download/horizon-2012.1.tar.gz -P /opt 安装依赖包yum install -y python-django-nose python-dateutil python-cloudfi
19、les python-django python-django-integration-apache httpd 解压并安装HORIZON管理面板cd /opttar xf horizon-2012.1.tar.gzcd horizon-2012.1python setup.py installrm -f ./horizon-2012.1.tar.gz3.12 NOVNC WEB访问安装 下载源码包git clone /cloudbuilders/noVNC.git /opt/noVNC 安装依赖包yum install -y python-numdispla
20、y3.13 KEYSTONE身份认证服务配置 建立KEYSTONE服务数据库mysql -uroot -popenstack -e create database keystone 建立KEYSTONE服务配置文件存放目录mkdir /etc/keystone 建立KEYSTONE服务启动用户useradd -s /sbin/nologin -m -d /var/log/keystone keystone 在/etc/keystone建立default_catalog.templates作为KEYSTONE服务服务点配置文件,内容如下:catalog.RegionOne.identity.pu
21、blicURL = 05:$(public_port)s/v2.0catalog.RegionOne.identity.adminURL = 05:$(admin_port)s/v2.0catalog.RegionOernalURL = 05:$(public_port)s/v2.0catalog.RegionO = Identity Servicecatalog.RegionOpute.publicURL = http
22、:/05:8774/v2/$(tenant_id)scatalog.RegionOpute.adminURL = 05:8774/v2/$(tenant_id)scatalog.RegionOernalURL = 05:8774/v2/$(tenant_id)scatalog.RegionO = Compute Servicecatalog.RegionOne.volume.publicURL = 05
23、:8776/v1/$(tenant_id)scatalog.RegionOne.volume.adminURL = 05:8776/v1/$(tenant_id)scatalog.RegionOernalURL = 05:8776/v1/$(tenant_id)scatalog.RegionO = Volume Servicecatalog.RegionOne.ec2.publicURL = 05:8773/services/Cloudca
24、talog.RegionOne.ec2.adminURL = 05:8773/services/Admincatalog.RegionOernalURL = 05:8773/services/Cloudcatalog.RegionO = EC2 Servicecatalog.RegionOne.s3.publicURL = 05:3333catalog.RegionOne.s3.adminURL = 05:3333ca
25、talog.RegionOernalURL = 05:3333catalog.RegionO = S3 Servicecatalog.RegionOne.image.publicURL = 05:9292/v1catalog.RegionOne.image.adminURL = 05:9292/v1catalog.RegionOernalURL = 05:9292/v1catalog.RegionO
26、 = Image Servicecatalog.RegionOne.object_store.publicURL = 05:8080/v1/AUTH_$(tenant_id)scatalog.RegionOne.object_store.adminURL = 05:8080/catalog.RegionOne.object_ernalURL = 05:8080/v1/AUTH_$(tenant_id)scatalog.RegionOne.object
27、_ = Swift Service 在/etc/keystone建立policy.json作为KEYSTONE服务策略文件,内容如下: admin_required: role:admin, is_admin:1 在/etc/keystone建立keystone.conf作为KEYSTONE服务配置文件,内容如下:DEFAULTpublic_port = 5000admin_port = 35357admin_token = ADMINcompute_port = 8774verbose = Truedebug = Truelog_file = /var/log/keyst
28、one/keystone.loguse_syslog = Falsesyslog_log_facility = LOG_LOCAL0sqlconnection = mysql:/root:openstacklocalhost/keystoneidle_timeout = 30min_pool_size = 5max_pool_size = 10pool_timeout = 200identitydriver = keystone.identity.backends.sql.Identitycatalogdriver = keystone.catalog.backends.templated.T
29、emplatedCatalogtemplate_file = /etc/keystone/default_catalog.templatestokendriver = keystone.token.backends.kvs.Tokenpolicydriver = keystone.policy.backends.simple.SimpleMatchec2driver = keystone.contrib.ec2.backends.sql.Ec2filter:debugpaste.filter_factory = mon.wsgi:Debug.factoryfilter:
30、token_authpaste.filter_factory = keystone.middleware:TokenAuthMiddleware.factoryfilter:admin_token_authpaste.filter_factory = keystone.middleware:AdminTokenAuthMiddleware.factoryfilter:xml_bodypaste.filter_factory = keystone.middleware:XmlBodyMiddleware.factoryfilter:json_bodypaste.filter_factory =
31、keystone.middleware:JsonBodyMiddleware.factoryfilter:crud_extensionpaste.filter_factory = keystone.contrib.admin_crud:CrudExtension.factoryfilter:ec2_extensionpaste.filter_factory = keystone.contrib.ec2:Ec2Extension.factoryfilter:s3_extensionpaste.filter_factory = keystone.contrib.s3:S3Extension.fac
32、toryapp:public_servicepaste.app_factory = keystone.service:public_app_factoryapp:admin_servicepaste.app_factory = keystone.service:admin_app_factorypipeline:public_apipipeline = token_auth admin_token_auth xml_body json_body debug ec2_extension s3_extension public_servicepipeline:admin_apipipeline =
33、 token_auth admin_token_auth xml_body json_body debug ec2_extension crud_extension admin_serviceapp:public_version_servicepaste.app_factory = keystone.service:public_version_app_factoryapp:admin_version_servicepaste.app_factory = keystone.service:admin_version_app_factorypipeline:public_version_apip
34、ipeline = xml_body public_version_servicepipeline:admin_version_apipipeline = xml_body admin_version_servicecomposite:mainuse = egg:Paste#urlmap/v2.0 = public_api/ = public_version_apicomposite:adminuse = egg:Paste#urlmap/v2.0 = admin_api/ = admin_version_api 在/etc/init.d/下建立名为keystone的KEYSTONE服务启动脚
35、本,内容如下:#!/bin/sh# keystone OpenStack Identity Service# chkconfig: - 20 80# description: keystone works provide apis to # * Authenticate users and provide a token # * Validate tokens# END INIT INFO. /etc/rc.d/init.d/functionsprog=keystoneprog_exec=keystone-allexec=/usr/bin/$prog_execconfig=/etc/$prog
36、/$prog.confpidfile=/var/run/$prog/$prog.pid -e /etc/sysconfig/$prog & . /etc/sysconfig/$proglockfile=/var/lock/subsys/$progstart() -x $exec | exit 5 -f $config | exit 6 echo -n $Starting $prog: daemon -user keystone -pidfile $pidfile $exec -config-file=$config &/dev/null & echo $! $pidfile retval=$?
37、 echo $retval -eq 0 & touch $lockfile return $retvalstop() echo -n $Stopping $prog: killproc -p $pidfile $prog retval=$? echo $retval -eq 0 & rm -f $lockfile return $retvalrestart() stop startreload() restartforce_reload() restartrh_status() status -p $pidfile $progrh_status_q() rh_status /dev/null
38、2&1case $1 in start) rh_status_q & exit 0 $1 ; stop) rh_status_q | exit 0 $1 ; restart) $1 ; reload) rh_status_q | exit 7 $1 ; force-reload) force_reload ; status) rh_status ; condrestart|try-restart) rh_status_q | exit 0 restart ; *) echo $Usage: $0 start|stop|status|restart|condrestart|try-restart
39、|reload|force-reload exit 2esacexit $? 配置启动脚本:chmod 755 /etc/init.d/keystonemkdir /var/run/keystonemkdir /var/lock/keystonechown keystone:root /var/run/keystonechown keystone:root /var/lock/keystone 启动KEYSTONE服务/etc/init.d/keystone start 检测服务是否正常启动通过netstat -ltunp查看是否有tcp 5000和tcp 35357端口监听如果没有正常启动请
40、查看/var/log/keystone/keystone.log文件排错 建立KEYSTONE服务初始化数据脚本keystone_data.sh,内容如下:#!/bin/bash# Variables set before calling this script:# SERVICE_TOKEN - aka admin_token in keystone.conf# SERVICE_ENDPOINT - local Keystone admin endpoint# SERVICE_TENANT_NAME - name of tenant containing service accounts#
41、ENABLED_SERVICES - stack.shs list of services to start# DEVSTACK_DIR - Top-level DevStack directoryADMIN_PASSWORD=$ADMIN_PASSWORD:-secreteSERVICE_PASSWORD=$SERVICE_PASSWORD:-serviceexport SERVICE_TOKEN=ADMINexport SERVICE_ENDPOINT=http:/localhost:35357/v2.0SERVICE_TENANT_NAME=$SERVICE_TENANT_NAME:-t
42、enantfunction get_id () echo $ | awk / id / print $4 # TenantsADMIN_TENANT=$(get_id keystone tenant-create -name=admin)SERVICE_TENANT=$(get_id keystone tenant-create -name=$SERVICE_TENANT_NAME)DEMO_TENANT=$(get_id keystone tenant-create -name=demo)INVIS_TENANT=$(get_id keystone tenant-create -name=i
43、nvisible_to_admin)# UsersADMIN_USER=$(get_id keystone user-create -name=admin -pass=$ADMIN_PASSWORD -email=)DEMO_USER=$(get_id keystone user-create -name=demo -pass=$ADMIN_PASSWORD -email=)# RolesADMIN_ROLE=$(get_id keystone role-create -name=admin)KEYSTONEADMIN_ROLE=$
44、(get_id keystone role-create -name=KeystoneAdmin)KEYSTONESERVICE_ROLE=$(get_id keystone role-create -name=KeystoneServiceAdmin)ANOTHER_ROLE=$(get_id keystone role-create -name=anotherrole)# Add Roles to Users in Tenantskeystone user-role-add -user $ADMIN_USER -role $ADMIN_ROLE -tenant_id $ADMIN_TENA
45、NTkeystone user-role-add -user $ADMIN_USER -role $ADMIN_ROLE -tenant_id $DEMO_TENANTkeystone user-role-add -user $DEMO_USER -role $ANOTHER_ROLE -tenant_id $DEMO_TENANT# TODO(termie): these two might be dubiouskeystone user-role-add -user $ADMIN_USER -role $KEYSTONEADMIN_ROLE -tenant_id $ADMIN_TENANT
46、keystone user-role-add -user $ADMIN_USER -role $KEYSTONESERVICE_ROLE -tenant_id $ADMIN_TENANT# The Member role is used by Horizon and Swift so we need to keep it:MEMBER_ROLE=$(get_id keystone role-create -name=Member)keystone user-role-add -user $DEMO_USER -role $MEMBER_ROLE -tenant_id $DEMO_TENANTk
47、eystone user-role-add -user $DEMO_USER -role $MEMBER_ROLE -tenant_id $INVIS_TENANTNOVA_USER=$(get_id keystone user-create -name=nova -pass=$SERVICE_PASSWORD -tenant_id $SERVICE_TENANT -email=)keystone user-role-add -tenant_id $SERVICE_TENANT -user $NOVA_USER -role $ADMIN_ROLEGLANCE_US
48、ER=$(get_id keystone user-create -name=glance -pass=$SERVICE_PASSWORD -tenant_id $SERVICE_TENANT -email=)keystone user-role-add -tenant_id $SERVICE_TENANT -user $GLANCE_USER -role $ADMIN_ROLESWIFT_USER=$(get_id keystone user-create -name=swift -pass=$SERVICE_PASSWORD -tenant_id $SERVICE_TENANT -email=)keystone user-role-add -tenant_id $SERVICE_TENANT -user $SWIFT_USER -role $ADMIN_ROLERESELLER_ROLE=$(get_id keystone role-create -name=ResellerAdmin)keystone user-role-add -tenant_id $SERVICE_TENANT -user $NOVA_USER -role
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 二零二五年度安全生产责任主体合同履行保障措施3篇
- 万套配电柜建议书可行性研究报告备案
- 特种树脂单体建议书可行性研究报告备案
- 2025版家具行业供应链合作合同示范文本3篇
- 信息技术项目规划方案
- 二零二五年在线教育平台合伙人退出及师资共享协议3篇
- 二零二五年度专业家教辅导合同范本6篇
- 打造繁荣旅游消费环境的策略与行动计划
- 广西来宾市(2024年-2025年小学六年级语文)统编版随堂测试(上学期)试卷及答案
- 中国海洋金融行业市场全景评估、发展环境透析及应用细分市场分析报告
- 北京海淀区初一上数学期末试题(带标准答案)_
- 化工原理课程设计空气中丙酮的回收工艺操作
- 【家庭自制】 南北香肠配方及28种制作方法
- 电梯调度问题模型(共3页)
- 厂房施工总结报告
- 先进物流理念主导和先进物流技术支撑下的日本现代物流
- 建筑小区生雨水排水系统管道的水力计算
- 公务员职务和级别工资档次套改及级别对应表
- 社会团体选举办法
- 《铁路超限超重货物运输规则》(2016)260
- 倒车移位、公路调头、快速移位长距离倒车、坡道起步
评论
0/150
提交评论