setup - devstack


目錄

 

 

 

介紹

A documented shell script to build complete OpenStack development environments.

Homepage: http://devstack.org/

安裝方式:

  • OpenStack on VMs (VMs launched in your cloud will be slow as they are running in QEMU)
  • All-In-One
  • Multi-Node + VLANs

 


Quick Start

 

- Ubuntu 14.04 (Trusty)
- CentOS/RHEL 6.5

 


Centos6

 

準備:

yum install git -y

/root/devstack/tools/create-stack-user.sh

yum install sudo -y
adduser stack
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

/etc/hosts

wan_ip hostname

Download script:

su stack

cd ~

git clone https://github.com/openstack-dev/devstack.git

du -sh devstack/

9.3M    devstack/

# Configuration

見下文

 

# Install

# Ceilometer, Cinder, Glance, Heat, Horizon, Keystone, Nova, Neutron, and Swift

# Default values are located in the stackrc file

cd devstack;

./stack.sh

..........................................................................................................
2014-10-15 12:11:12.513 | Transaction Summary
2014-10-15 12:11:12.513 | ================================================================================
2014-10-15 12:11:12.513 | Install     119 Package(s)
2014-10-15 12:11:12.513 |
2014-10-15 12:11:12.513 | Total download size: 66 M
2014-10-15 12:11:12.513 | Installed size: 212 M
2014-10-15 12:11:12.513 | Downloading Packages:
2014-10-15 12:11:12.513 | --------------------------------------------------------------------------------
..........................................................................................................

 


All-In-One 的安裝

 

======================== Step1: 設定

cd devstack

# 設定 local.conf

 

cp ./samples/local.conf local.conf

local.conf

SERVICE_TOKEN=azertytoken
ADMIN_PASSWORD=nomoresecrete
MYSQL_PASSWORD=stackdb
RABBIT_PASSWORD=stackqueue
SERVICE_PASSWORD=$ADMIN_PASSWORD

加入

ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,mysql

Glance (API and Registry)
    # g-api,g-reg
Keystone
    # key
Nova (API, Certificate, Object Store, Compute, Network, Scheduler, VNC proxies, Certificate Authentication),
    # n-api,n-crt,n-obj,n-cpu,n-net,n-cond,n-sch,n-novnc,n-xvnc,n-cauth,
Cinder (Scheduler, API, Volume)
    # cinder,c-sch,c-api,c-vol
Horizon
    # horizon
MySQL
    # mysql
RabbitMQ
    # rabbit
Tempest
    # tempest

 

# 要修改的設定

# VM 將會用的 IP

# range not used on the local network ( i.e. 192.168.1.224/27)

FLOATING_RANGE=192.168.55.224/27                                              

 

# configure the internal address space

FIXED_RANGE=10.0.0.0/24

FIXED_NETWORK_SIZE=256

 

# interface that connects the host to your local network

FLAT_INTERFACE=eth0

 

# normally detected on the first run of stack.sh
# but often is indeterminate on later runs due to the IP being moved from an Ethernet integace to a bridge on the host.
# Setting it here also makes it available for openrc to set OS_AUTH_URL.

HOST_IP

 

password:

  • Set the administrative password                              # admin and demo accounts set up as OpenStack users)
  • Set the MySQL administrative password
  • Set the RabbitMQ password
  • Set the service password:                                       # This is used by the OpenStack services (Nova, Glance, etc) to authenticate with Keystone.

The defined phases are:

    local - extracts localrc from local.conf before stackrc is sourced
    pre-install - runs after the system packages are installed but before any of the source repositories are installed
    install - runs immediately after the repo installations are complete
    post-config - runs after the layer 2 services are configured and before they are started
    extra - runs after services are started and before any files in extra.d are executed

 

# Default: DEST=/opt/stack

# 所有 package compile 並安裝到那裡

Set DevStack install directory                                

===========================================

A clean install every time (小心使用)

Default: RECLONE=""

RECLONE=yes

===========================================

stack.sh logging

    Defaults: LOGFILE="" LOGDAYS=7 LOG_COLOR=True
    
    LOGFILE=$DEST/logs/stack.sh.log
    LOGDAYS=1
    LOG_COLOR=False
    
===========================================

Swift

    Default:
    SWIFT_HASH=""
    SWIFT_REPLICAS=1
    SWIFT_DATA_DIR=$DEST/data/swift
    
    # Swift is now used as the back-end for the S3-like object store.

===========================================

Keystone

    KEYSTONE_CATALOG_BACKEND=sql

===========================================

Cinder

    VOLUME_GROUP="stack-volumes"
    VOLUME_NAME_PREFIX="volume-"
    VOLUME_BACKING_FILE_SIZE=10250M

===========================================

API rate limits

    Default: API_RATE_LIMIT=True

===========================================

Dashboard

http://192.168.1.201/

 


Multi-host DevStack

    Default: MULTI_HOST=False

Master 的 script 設定:

    MULTI_HOST=True

Slave 的 script 設定:

    MYSQL_HOST=w.x.y.z
    RABBIT_HOST=w.x.y.z
    GLANCE_HOSTPORT=w.x.y.z:9292
    ENABLED_SERVICES=n-vol,n-cpu,n-net,n-api

 


Disable / Enable Service

 

How do I turn off a service that is enabled by default?

disable_service n-vol

Is enabling a service that defaults to off done with the reverse of the above?

enable_service qpid

 



更多, 更多

 

local.conf

local.conf is a user-maintained setings file that is sourced in stackrc

stackrc is the primary configuration file for DevStack.

It contains all of the settings that control the services started and the repositories used to download the source for those services.

 

stackrc

stackrc sources the localrc section of local.conf to perform the default overrides.

* Service Repos
ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,$DATABASE_TYPE

Glance (API and Registry),
Keystone,
Nova (API, Certificate, Object Store, Compute, Network, Scheduler, VNC proxies, Certificate Authentication),
Cinder (Scheduler, API, Volume),
Horizon,
MySQL,
RabbitMQ,
Tempest.

* ENABLED_SERVICES

* Git repositories used to check out the source for each service
 

 


FAQ

 

Q: How can I set up Heat in stand-alone configuration?

A: Configure local.conf thusly:

    [[local|localrc]]
    HEAT_STANDALONE=True
    ENABLED_SERVICES=rabbit,mysql,heat,h-api,h-api-cfn,h-api-cw,h-eng
    KEYSTONE_SERVICE_HOST=<keystone-host>
    KEYSTONE_AUTH_HOST=<keystone-host>

 

 

Creative Commons license icon Creative Commons license icon