Ubuntu11.04环境下Openstack云平台构建

===Ubuntu11.04环境下Openstack云平台构建====

本次实验包含两个主要部分:NovaCC和Nova-compute
环境信息:
NovaCC:
Public:192.168.0.110/24
Private:192.168.3.1/24

Nova-compute:
Public:192.168.0.111/24
Private:192.168.3.2/24

#####Nova-CC安装和配置######
一、基本准备工作
1.重置root密码
2.设置本地网络可以上网,并且设置/etc/apt/source.list可以进行apt-get更新
3.安装ssh,方便使用secureCRT工具进行远程连接控制
4.执行#apt-get update和#apt-get dist-upgrade更新源包信息和包升级
5.安装桥接#apt-get install -y bridge-utils
6.配置本地网络信息和桥接:
 
auto lo 
iface lo inet loopback 
auto eth0 
iface eth0 inet static 
address 192.168.0.110
netmask 255.255.255.0 
broadcast 10.10.10.255 
gateway 192.168.0.2 
dns-nameservers 192.168.0.2

auto br100 
iface br100 inet static 
bridge_ports eth1 
bridge_stp off 
bridge_maxwait 0 
bridge_fd 0 
address 192.168.3.1 
netmask 255.255.255.0 
broadcast 192.168.3.255

LANG="us-UTF8"

二、安装和配置Glance
1.#apt-get install -y glance
  #####文件存储采用本地文件系统的方式,路径在/var/lib/glance/images/下####

三、安装和配置MySQL
1.#apt-get install -y mysql-server
  //如果要删除#apt-get autoremove -y mysql-server
2.#sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
3.#restart mysql
4.#sudo mysql -uroot -ppassword -e 'CREATE DATABASE nova;'
5.#sudo mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;"
6.#sudo mysql -uroot -ppassword -e "SET PASSWORD FOR 'root'@'%' = PASSWORD('password');"

四、安装和配置nova componets
1.#sudo apt-get install -y rabbitmq-server nova-common nova-doc python-nova nova-api nova-network nova-volume nova-objectstore nova-scheduler nova-compute
2.#sudo apt-get install -y euca2ools
3.#sudo apt-get install -y unzip
4.编辑/etc/nova/nova.conf
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--lock_path=/var/lock/nova
--state_path=/var/lib/nova
--verbose
--s3_host=192.168.0.110
--rabbit_host=192.168.3.1
--cc_host=192.168.3.1
--ec2_url=http://192.168.0.110:8773/services/Cloud
--fixed_range=192.168.3.0/24
--network_size=8
--FAKE_subdomain=ec2
--routing_source_ip=192.168.3.1
--sql_connection=mysql://root:[email protected]/nova
--glance_host=192.168.3.1
--image_service=nova.image.glance.GlanceImageService
--iscsi_ip_prefix=192.168.3.
5.#sudo sed -i 's/false/true/g' /etc/default/iscsitarget
6.#sudo service iscsitarget restart
7.#fdisk /dev/sda
8.#pvcreate /dev/sda5
9.#vgcreate nova-volumes /dev/sda5
10.#groupadd nova
11.sudo chown -R root:nova /etc/nova
   sudo chmod 644 /etc/nova/nova.conf

12.#sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry

###nova-manage###
13.#sudo nova-manage db sync
14.#sudo nova-manage network create 192.168.3.0/24 1 255
15.#sudo nova-manage floating create 192.168.0.2 192.168.0.224/27
16.#sudo nova-manage user admin novaadmin
17.#sudo nova-manage project create proj novaadmin

18.#mkdir /home/fetion/creds
19.#sudo nova-manage project zipfile proj novaadmin /home/fetion/creds/novacreds.zip

20.#cd /home/fetion/creds
unzip novacreds.zip
sudo chown fetion:fetion /home/fetion/creds/ -R

21.#sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry


#####nova-compute配置######

一、基本准备工作
1.重置root密码
2.设置本地网络可以上网,并且设置/etc/apt/source.list可以进行apt-get更新
3.安装ssh,方便使用secureCRT工具进行远程连接控制
4.执行#apt-get update和#apt-get dist-upgrade更新源包信息和包升级
5.安装桥接#apt-get install -y bridge-utils
6.配置本地网络信息和桥接:
 
auto lo 
iface lo inet loopback 
auto eth0 
iface eth0 inet static 
address 192.168.0.111
netmask 255.255.255.0 
broadcast 10.10.10.255 
gateway 192.168.0.2 
dns-nameservers 192.168.0.2

auto br100 
iface br100 inet static 
bridge_ports eth1 
bridge_stp off 
bridge_maxwait 0 
bridge_fd 0 
address 192.168.3.2
netmask 255.255.255.0 
broadcast 192.168.3.255

//**
把novacc节点上的配置文件复制过来,
scp 192.168.0.110:/etc/nova/nova.conf /etc/nova/nova.conf
进行修改:
添加一个选项,   --flat_interface=eth0/eth1???
**//
二、nova components configure
1.sudo apt-get install -y nova-common python-nova nova-compute vlan
2.sudo apt-get install -y euca2ools
3.sudo apt-get install -y unzip

finished!


以上是NovaCC和Nova-compute的配置,但是没有
============================================================

以下配置是在NovaCC上的Dashboard配置(未完成)

1.创建目录
#apt-get install -y bzr
#bzr init-repo .
#bzr branch lp:openstack-dashboard /opt/osdb
#cd /opt/osdb/
###sh run_test.sh###  //暂时省略
#bzr revert -r 46

2.安装配置dashboard
#cd /opt/osdb/openstack-dashboard/local
#cp local_settings.py.example local_settings.py
#vi local_settings.py

编辑/opt/osdb/openstack-dashboard/local/local_settings.py

//****local_settings.py

import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROD = False
USE_SSL = False

LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(LOCAL_PATH, 'dashboard_openstack.sqlite3'),
    },
}

CACHE_BACKEND = 'dummy://'

# Configure these for your outgoing email host
# EMAIL_HOST = 'smtp.my-company.com'
# EMAIL_PORT = 25
# EMAIL_HOST_USER = 'djangomail'
# EMAIL_HOST_PASSWORD = 'top-secret!'

NOVA_DEFAULT_ENDPOINT = 'http://localhost:8773/services/Cloud'
NOVA_DEFAULT_REGION = 'nova'
NOVA_ACCESS_KEY = 'admin'
NOVA_SECRET_KEY = 'admin'
NOVA_ADMIN_USER = 'novaadmin'
NOVA_PROJECT = 'proj'

# Configure these for your outgoing email host
# EMAIL_HOST = 'smtp.my-company.com'
# EMAIL_PORT = 25
## EMAIL_HOST_USER = 'djangomail'
## EMAIL_HOST_PASSWORD = 'top-secret!'

//***结束

3.配置dashboard环境
#apt-get install -y python-setuptools
#cd ..  //这个位置应该是/opt/osdb/openstack-dashboard/目录
#sudo easy_install virtualenv
#python tools/install_venv.py


4.创建数据库
# tools/with_venv.sh dashboard/manage.py syncdb
//在此输入的用户名和密码总提示错误。

While creating the schema, the above command asks you to create an admin account for the dashboard. Choose the user name as the project admin’s user name you chose above while creating the project ( novadmin in our case). You can choose any password you like.


# tools/with_venv.sh dashboard/manage.py runserver 10.10.10.2:8000  //这个是可以进行访问的,但是属于手工操作

你可能感兴趣的:(openstack)