参考链接:
搭建OpenStack开发环境
openStack项目系列介绍(3)Devstack
一、虚拟机环境
eth0 为NAT类型,eth1为 host-only类型
二、安装前准备
安装git、pip;
Devstack安装时会下载许多代码及配置,为加速下载速度,可以优化下载源
-
# vim ~/.pip/pip.conf
-
[global]
-
timeout = 6000
-
trusted-host = pypi.douban.com
-
index-url = http://pypi.douban.com/simple/
三、Devstack环境安装
3.1 下载Devstack代码并创建用户
代码可以直接下载到/home下,即使下载到其他文件夹,创建用户时也会copy到/home下
-
# 下载devstack
-
git clone https://git.openstack.org/openstack-dev/devstack
执行devstack中stack.sh脚本时,不能用root用户,可以用devstack/tools/create-stack-user.sh脚本创建用户 stack
-
cd /home/devstack/tools
-
./create-stack-user.sh
-
su stack
3.2 修改localrc
修改配置文件以使其适合本机配置
-
#[[local|localrc]]
-
# use TryStack git mirror
-
# 下载openstack 各个项目代码时,用国内的下载源
-
GIT_BASE=http://git.trystack.cn
-
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
-
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
-
-
#GIT_BASE=https://github.com
-
# Define images to be automatically downloaded during the DevStack built process.
-
#IMAGE_URLS=""
-
# Credentials
-
# 登录dashboard等的密码
-
DATABASE_PASSWORD=1
-
ADMIN_PASSWORD=1
-
SERVICE_PASSWORD=1
-
SERVICE_TOKEN=1
-
RABBIT_PASSWORD=1
#此处将地址改为ubuntu 系统nat网卡地址
-
HOST_IP=192.168.80.128
-
SERVICE_HOST=192.168.80.128
-
MYSQL_HOST=192.168.80.128
-
RABBIT_HOST=192.168.80.128
-
GLANCE_HOSTPORT=192.168.80.128:9292
-
-
# Work offline(不需要更新时打开)
-
# OFFLINE=True
-
# Reclone each time(需要更新时打开)
-
RECLONE=yes
-
-
# Logging
-
# -------
-
# By default ``stack.sh`` output only goes to the terminal where it runs. It can
-
# be configured to additionally log to a file by setting ``LOGFILE`` to the full
-
# path of the destination log file. A timestamp will be appended to the given name.
-
#LOGFILE=/opt/stack/logs/stack.sh.log
-
VERBOSE=True
-
LOG_COLOR=True
-
SCREEN_LOGDIR=/opt/stack/logs
-
-
# the number of days by setting ``LOGDAYS``.
-
LOGDAYS=1
-
-
# Database Backend MySQL
-
enable_service mysql
-
-
# RPC Backend RabbitMQ
-
enable_service rabbit
-
-
# Enable Keystone - OpenStack Identity Service
-
enable_service key
-
-
# Horizon - OpenStack Dashboard Service
-
enable_service horizon
-
-
# Enable Swift - Object Storage Service without replication.
-
enable_service s-proxy s-object s-container s-account
-
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
-
SWIFT_REPLICAS=1
-
-
# Enable Glance - OpenStack Image service
-
enable_service g-api g-reg
-
-
# Enable Cinder - Block Storage service for OpenStack
-
enable_service cinder c-api c-vol c-sch c-bak
-
-
# Branches
-
# 各个项目,默认下载master,可以改为其他分支
-
KEYSTONE_BRANCH=master
-
NOVA_BRANCH=master
-
NEUTRON_BRANCH=master
-
SWIFT_BRANCH=master
-
GLANCE_BRANCH=master
-
CINDER_BRANCH=master
-
HEAT_BRANCH=master
-
TROVE_BRANCH=master
-
HORIZON_BRANCH=master
-
SAHARA_BRANCH=master
-
CEILOMETER_BRANCH=master
-
TROVE_BRANCH=master
3.3 安装
-
cd /home/devstack; ./stack.sh
安装成功会显示
登录虚拟机或者本机浏览器
阅读(1277) | 评论(0) | 转发(0) |