OpenStack Grizzly版本(Ubuntu 12.04)配置

1.     我们在一天VMware虚拟机上(双网卡)使用Ubuntu 12.04.1 和 OpenVSwitch 1.4.6 来搭建OpenStack的Grizzly版本的平台。 由于OpenVSwitch的版本对Ubuntu系统的内核版本有依赖,建议在安装前请确认二者之间是否兼容。无论是在物理机器中还是VMware 中配置,都需要开启CPU 的虚拟化(Intel VT-x/EPT 或AMD-V/RVI(V)。OpenStack-Grizzly-Install-Gui...
11.0 KB

2.     为了提高Ubuntu 12.04.1的更新速度,将163的源加入/etc/apt/sources.list中。sources.list
5.0 KB

3.     添加OpenStack Grizzly版本的库:

安装:apt-get install ubuntu-cloud-keyring python-software-properties software-properties-common python-keyring
cat > /etc/apt/sources.list.d/grizzly.list << _EOF_
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/grizzly main
_EOF_
更新软件源和软件:apt-get update; apt-get upgrade

4. 安装ssh-server:

apt-get install openssh-server

5. 禁用network-manager:

/etc/init.d/NetworkManager stop

6. 安装mysql

apt-get install -y mysql-server python-mysqldb
修改mysql的配置文件/etc/mysql/my.cnf:
sed -i ‘s/127.0.0.1/0.0.0.0/g‘ /etc/mysql/my.cnf
# sed -i ‘44 i skip-name-resolve‘ /etc/mysql/my.cnf 禁止mysql做域名解析,防止连接mysql出现错误和远程连接mysql慢的现象
在my.cnf中添加:
[client]
default-character-set=utf8
[mysqld]
#default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci

7. 安装rabbitMQ

apt-get install -y rabbitmq-server

8. 安装NTP服务:

apt-get install -y ntp

9. 安装keystone

apt-get install -y keystone
在mysql中创建keystone数据库,并授权用户keystone访问:
# mysql -uroot -p
mysql> create database keystone;
mysql> grant all on keystone.* to ‘keystone‘@‘%‘ identified by ‘keystone‘;
mysql> flush privileges; quit;
修改/etc/keystone/keystone.conf中的数据库连接:
connection = mysql://keystone:[email protected]/keystone
重启keystone和同步数据库:
service keystone restart
keystone-manage db_sync
修改如下两个文件的权限: keystone_endpoints_basic.sh 4.4 KB
chmod +x keystone_basic.sh
chmod +x keystone_endpoints_basic.sh
运行这两个脚本:
./keystone_basic.sh
./keystone_endpoints_basic.sh
创建一个凭证文件:
# cat > /root/creds.sh << _EOF_
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_AUTH_URL="http://172.15.0.111:5000/v2.0/"
_EOF_
# echo ‘source /root/creds.sh‘ >> /root/.bashrc
# source /root/creds.sh

10. 安装glance:

apt-get install -y glance
创建glance数据库:
#mysql -uroot -p
mysql> create database glance;
mysql> grant all on glance.* to ‘glance‘@‘%‘ identified by ‘glance‘;
mysql> flush privileges; quit;
修改 /etc/glance/glance-api-paste.ini:
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
delay_auth_decision = true
auth_host = 172.15.0.111
auth_port = 35357
auth_protocol = http
amdin_tenant_name = service
admin_user = glance
admin_password = password
修改 /etc/glance/glance-registry-paste.ini:
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 172.15.0.111
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = password
修改/etc/glance/glance-api.conf:
sql_connection = mysql://glance:[email protected]/glance
[paste_deploy]
flavor = keystone
修改/etc/glance/glance-registry.conf:
sql_connection = mysql://glance:[email protected]/glance
[paste_deploy]
flavor = keystone
重启glance-api和glance-registry服务并同步数据库:
service glance-api restart; service glance-registry restart
glance-manage db_sync
service glance-api restart; service glance-registry restart
上传镜像,下载Cirros img作为测试使用:
# wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
# glance image-create --name=‘cirros‘ --public --container-format=ovf --disk-format=qcow2 < ./cirros-0.3.0-x86_64-disk.img
查看刚才上传的镜像:
glance image-list

11.安装quantum

安装openVSwitch:
apt-get install -y openvswitch-switch openvswitch-datapath-dkms
创建网桥:
ovs-vsctl add-br br-int
ovs-vsctl add-br br-ex
ovs-vsctl add-port br-ex eth0 (将eth0加入br-ex)
手动配置网卡配置文件:
#vi /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down

auto br-ex
iface br-ex inet static
address 192.168.8.20
netmask 255.255.255.0
gateway 192.168.8.1
dns-nameservers 208.67.222.222

auto eth1
iface eth1 inet static
address 172.15.0.111
netmask 255.255.255.0
安装quantum和相关组件:
apt-get install -y quantum-server quantum-plugin-openvswitch quantum-plugin-openvswitch-agent dnsmasq quantum-dhcp-agent quantum-l3-agent
创建数据:
mysql -uroot -p
mysql> create database quantum;
mysql> grant all on quantum.* to ‘quantum‘@‘%‘ identified by ‘quantum‘;
mysql> flush privileges; quit;
查看quantum的相关组件是否运行:
cd /etc/init.d/; for i in $( ls quantum-* ); do sudo service $i status; done
修改/etc/quantum/api-paste.ini:[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factoryauth_host = 172.15.0.111
auth_port = 35357
auth_protocol = httpadmin_tenant_name = service
admin_user = quantum
admin_password = password
 修改OVS plugin的配置文件/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini:
#Under the database section[DATABASE]

sql_connection = mysql://quantum:[email protected]/quantum #Under the OVS section

[OVS]
tenant_network_type = gre
tunnel_id_ranges = 1:1000integration_bridge = br-int
tunnel_bridge = br-tun
local_ip = 172.15.0.111
enable_tunneling = True
#Firewall driver for realizing quantum security group function
[SECURITYGROUP]firewall_driver = quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
更新/etc/quantum/metadata_agent.ini:
# The Quantum user information for accessing the Quantum API.
auth_url = http://172.15.0.111:35357/v2.0
auth_region = RegionOne
admin_tenant_name = service
admin_user = quantum
admin_password = password

# IP address used by Nova metadata server
nova_metadata_ip = 127.0.0.1

# TCP Port used by Nova metadata server
nova_metadata_port = 8775

metadata_proxy_shared_secret = helloOpenStack
修改 /etc/quantum/quantum.conf:
[keystone_authtoken]
auth_host = 172.15.0.111
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = quantum
admin_password = password
signing_dir = /var/lib/quantum/keystone-signing
重启quantum的所有服务:
cd /etc/init.d/; for i in $( ls quantum-* ); do sudo service $i restart; done
service dnsmasq restart

12. 安装nova:

apt-get install nova-api nova-novncproxy novnc nova-ajax-console-proxy nova-cert nova-consoleauth nova-doc nova-scheduler nova-compute nova-conductor
创建数据库:
# mysql -uroot -p
mysql> create database nova;
mysql> grant all on nova.* to ‘nova‘@‘%‘ identified by ‘nova‘;
mysql> flush privileges; quit;
查看nova所有服务的状态:
cd /etc/init.d/; for i in $( ls nova-* ); do service $i status; cd; done
修改配置文件/etc/nova/api-paste.ini:
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 172.15.0.111
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = password
signing_dirname = /tmp/keystone-signing-nova
# Workaround for https://bugs.launchpad.net/nova/+bug/1154809
auth_version = v2.0
修改 /etc/nova/nova.conf文件:
[DEFAULT]
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/var/lock/nova
verbose=True
api_paste_config=/etc/nova/api-paste.ini
compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler
rabbit_host=172.15.0.111
nova_url=http://172.15.0.111:8774/v1.1/
sql_connection=mysql://nova:[email protected]/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf

# Auth
use_deprecated_auth=false
auth_strategy=keystone

# Imaging service
glance_api_servers=172.15.0.111:9292
image_service=nova.image.glance.GlanceImageService

# Vnc configuration
novnc_enabled=true
novncproxy_base_url=http://192.168.8.20:6080/vnc_auto.html
novncproxy_port=6080
vncserver_proxyclient_address=172.15.0.111
vncserver_listen=0.0.0.0

# Network settings
network_api_class=nova.network.quantumv2.api.API
quantum_url=http://172.15.0.111:9696
quantum_auth_strategy=keystone
quantum_admin_tenant_name=service
quantum_admin_username=quantum
quantum_admin_password=password
quantum_admin_auth_url=http://172.15.0.111:35357/v2.0
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
#If you want Quantum + Nova Security groups
firewall_driver=nova.virt.firewall.NoopFirewallDriver
security_group_api=quantum
#If you want Nova Security groups only, comment the two lines above and uncomment line -1-.
#-1-firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver

#Metadata
service_quantum_metadata_proxy = True
quantum_metadata_proxy_shared_secret = helloOpenStack
metadata_host = 172.15.0.111
metadata_listen = 127.0.0.1
metadata_listen_port = 8775

# Compute #
compute_driver=libvirt.LibvirtDriver

# Cinder #
volume_api_class=nova.volume.cinder.API
osapi_volume_listen_port=5900
修改/etc/nova/nova-compute.conf文件:
[DEFAULT]
libvirt_type= qemu #kvm主要配置在物理机器上,在vmware上应该配置为qemu
libvirt_ovs_bridge=br-int
libvirt_vif_type=ethernet
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
libvirt_use_virtio_for_bridges=True
同步数据库:
nova-manage db sync
重启nova-*服务:
cd /etc/init.d/; for i in $( ls nova-* ); do sudo service $i restart; done
检查nova-*服务:
nova-manage service list
13. cinder安装
apt-get install cinder-api cinder-common cinder-scheduler cinder-volume python-cinderclient
创建数据库:
#mysql -uroot -p
mysql> create database cinder;
mysql> grant all on cinder.* to ‘cinder‘@‘%‘ identified by ‘cinder‘;
mysql> flush privileges; quit;
修改配置文件/etc/cinder/api-paste.ini:
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
service_protocol = http
service_host = 172.15.0.111
service_port = 5000
auth_host = 172.15.0.111
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = cinder
admin_password = password
signing_dir = /var/lib/cinder

修改配置文件/etc/cinder/cinder.conf:
[DEFAULT]
rootwrap_config=/etc/cinder/rootwrap.conf
sql_connection = mysql://cinder:cin[email protected]/cinder
api_paste_config = /etc/cinder/api-paste.ini
iscsi_helper=tgtadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = True
auth_strategy = keystone
state_path = /var/lib/cinder
lock_path = /var/lock/cinder
volume_dir = /var/lib/cinder/volumes
#osapi_volume_listen_port=5900

同步数据库:
cinder-manage db sync
重启cinder的服务:
cd /etc/init.d/; for i in $( ls cinder-* ); do sudo service $i restart; done
查看cinder的服务:
cd /etc/init.d/; for i in $( ls cinder-* ); do sudo service $i status; done
14. 安装horizon:
apt-get -y install openstack-dashboard memcached
可以选择性删除OpenStack Ubuntu theme:
dpkg --purge openstack-dashboard-ubuntu-theme
修改memcached的监听地址:
# vi /etc/openstack-dashboard/local_settings.py
DEBUG = True

重启apache2和memcached服务:
service apache2 restart; service memcached restart
15.创建网络
EXTERNAL_NET_ID=$(quantum net-create external_net1 --router:external=True | awk ‘/ id / {print $4}‘)
SUBNET_ID=$(quantum subnet-create external_net1 192.168.8.0/24 --name=external_subnet1 --gateway_ip 192.168.8.1 --enable_dhcp=False | awk ‘/ id / {print $4}‘)

修改组策略:
# nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
# nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0

OpenStack Grizzly版本(Ubuntu 12.04)配置

时间: 2024-12-24 16:44:50

OpenStack Grizzly版本(Ubuntu 12.04)配置的相关文章

ubuntu 12.04 配置vsftpd 服务,添加虚拟用户,ssl加密

1.对于12.04的vsftpd 有一些bug,推荐安装版本vsftpd_2.3.5-1ubuntu2ppa1_amd64.debapt-get install python-software-propertiesadd-apt-repository ppa:thefrontiergroup/vsftpdapt-get updateapt-get install vsftpd 2.配置虚拟用户,安装db5.1-util(对应系统版本即可)apt-get -y install db5.1-util

ubuntu 12.04 配置内核崩溃自动重启及转存

默认ubuntu12.04没有配置内核崩溃自动重启及转存,造成发生内核崩溃的时候,没有core dump文件去分析,并且卡死在内核崩溃界面,为了方便查找内核崩溃原因,需要将内核崩溃自动重启配置及内核转存配置起来,配置步骤如下: 第一步 配置内核崩溃自动重启 添加kernel.panic到内核参数,10为内核崩溃10秒之后,自动重启系统 vi /etc/sysctl.conf  kernel.panic = 10 第二步 验证自动重启机制是否生效,需要配置sysrq 添加kernel.sysrq

Ubuntu 12.04配置XRDP远程桌面访问Ubuntu

1. 在Ubuntu下安装Gnome Fallback: sudo apt-get install gnome-session-fallback 2. 安装XRDP: sudo apt-get install xrdp sudo apt-get install vnc4server sudo apt-get install tightvncserver 3. 配置XRDP: echo "gnome-session --session=gnome-fallback" > .xses

Ubuntu 12.04 配置l2tp VPN客户端

1. 添加PPA sudo apt-add-repository ppa:seriy-pr/network-manager-l2tp 2. 刷新软件包缓存 sudo apt-get update 3. 安装network-manager-l2tp sudo apt-get install network-manager-l2tp-gnome 安装完之后不要忘记运行以下命令 sudo service xl2tpd stop sudo update-rc.d xl2tpd disable 安装完成后

Ubuntu 12.04 Server OpenStack Havana多节点(OVS+GRE)安装

1.需求 节点角色 NICs 控制节点 eth0(10.10.10.51)eth1(192.168.100.51) 网络节点 eth0(10.10.10.52)eth1(10.20.20.52)eth2(192.168.100.52) 计算结点 eth0(10.10.10.53)eth1(10.20.20.53) 注意1:你总是可以使用dpkg -s <packagename>确认你是用的是Havana版本 注意2:这个是当前网络架构 2.控制节点 2.1.准备Ubuntu 安装好Ubuntu

Yii php 环境配置on ubuntu 12.04

ubuntu 12.04自带的php版本是5.3.x的,不支持explode(...)[]的语法,故升级到5.4.x. aptitude install python-software-properties add-apt-repository ppa:ondrej/php5-oldstable aptitude update aptitude upgrade Yii安装依赖: aptitude install php5-mysql Yii php 环境配置on ubuntu 12.04,布布扣

Ubuntu 12.04 Openstack Essex 安装(单节点)

这是陈沙克一篇非常好的博文,当时在进行openstack排错的时候,多亏了这篇文章里面有些内容 帮我找到了问题的所在: 原文:http://www.chenshake.com/ubuntu-12-04-openstack-essex-installation-single-node/#Nova-volume =============以下是转载内容========================== 亲自测试,成功! 测试环境: esx5.0 虚拟机环境   修改配置虚拟机配置文件 在esxi

ubuntu的一些常用命令,测试版本:Ubuntu 12.04.5 LTS

最近配置了一台Linux服务器,选用的是Ubuntu 12.04.5 LTS版本. 把之前放在Windows Server 2003上的网站移到了现在的服务器上,给我的感受用一个字形容:真JB快! 网页瞬间打开,几乎无迟钝!虽然配置上面相比Windows Server 2003要复杂一些,但是看到网站打开那么快, 这点又算什么~ 好了,下面我要把一些常用命令和配置过程中遇到的问题记录下来,方便自己以后查找, (好记性不如烂笔头) 如果有幸能帮到你,那就功德圆满了~ 以下所有命令全部在 Ubunt

linux 下 VNC Server安装配置及 eclipse CDT C/C++ 开发环境搭建(我用的是阿里云服务器 ubuntu 12.04 64-bit,无图形化界面)

linux 下 VNC Server安装配置及 eclipse CDT C/C++ 开发环境搭建(我用的是阿里云服务器 ubuntu 12.04 64-bit,无图形化界面): 既然要用 eclipse 可视环境下开发,那首先要安装图形界面喽!!! 对开发者来说,个人认为 linux 选择界面优先选择顺序:Awesome(性能最好) > Xfce4 > gnome > unity-2d //////////////////////////////////////////////// 首先