4. 修改sql_connection参数来指定数据库连接地址
#vi /etc/glance/glance-registry.conf
sql_connection = mysql://root:123456@localhost/glance
在mysql建立glance数据库
mysql>create database glance;
#chown -R root:nova /etc/nova
改变一下/etc/nova的属主
#chmod 640 /etc/nova/nova.conf
重启所有的服务:
#restart libvirt-bin;restart nova-network;restart nova-compute;restart nova-api;restart nova-objectstore;restart nova-scheduler; restart glance-registry;restart glance-api
5. nova运行环境配置
#/usr/bin/nova-manage db sync //在数据库nova中建立数据表
创建管理员用户:baiying
#/usr/bin/nova-manage user admin baiying
export EC2_ACCESS_KEY=6aa51bfd-6bfb-4a94-bf55-3c4bacc4d59a export
EC2_SECRET_KEY=aba78372-8a22-460c-af7e-d6da1ebf2eef //产生的密钥
创建管理员用户baiying的工程 baiying-proj
#/usr/bin/nova-manage project create baiying-proj baiying
为实例创建网络:
#nova-manage network create novanet 172.16.0.0/28 1 100 --bridge=br100
//创建了172.16.0.0的网段,含有一个网络,100个ip
查看建立的实例的ip段:
#nova-manage network list
id IPv4 IPv6 start address DNS1
1 172.16.0.0/28 None 172.16.0.2 8.8.4.4
通过命令查看建立的工程:
# nova-manage project list
baiying-proj
6. 创建证书
#mkdir creds
#nova-manage project zipfile baiying-proj baiying creds/novacreds.zip
#unzip creds/novacreds.zip -d creds/
#source creds/novarc
# cat /root/creds/novarc >> .bashrc
# source .bashrc
查看服务是否正常使用
# euca-describe-availability-zones verbose
AVAILABILITYZONE nova available
AVAILABILITYZONE |- zhaohh-G41MT-S2
AVAILABILITYZONE | |- nova-scheduler enabled :-) 2011-11-11 08:34:27
AVAILABILITYZONE | |- nova-compute enabled :-) 2011-11-11 08:34:27
AVAILABILITYZONE | |- nova-network enabled :-) 2011-11-11 08:34:27
# nova-manage service list
Binary Host Zone Status State Updated_At
nova-scheduler zhaohh-G41MT-S2 nova enabled :-) 2011-11-11 08:41:02
nova-compute zhaohh-G41MT-S2 nova enabled :-) 2011-11-11 08:41:04
nova-network zhaohh-G41MT-S2 nova enabled :-) 2011-11-11 08:41:02
使能够ping 和ssh compute节点上的虚拟机:
# euca-authorize -P icmp -t -1:-1 default
# euca-authorize -P tcp -p 22 default
