本帖最后由 pig2 于 2015-9-23 17:28 编辑
问题导读
1.为何要创建nova数据库?
2.同步数据库产生错误,最有可能的原因是什么?
安装配置【控制节点】
配置准备
1.创建数据库,完成下面内容
a.进入mysql
[mw_shl_code=bash,true] mysql -u root -p[/mw_shl_code]
b.创建nova数据库
[mw_shl_code=bash,true]CREATE DATABASE nova;[/mw_shl_code]
c.授权
[mw_shl_code=bash,true]GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';[/mw_shl_code]
d.退出
[mw_shl_code=bash,true]exit[/mw_shl_code]
2.加载环境变量
[mw_shl_code=bash,true]source admin-openrc.sh[/mw_shl_code]
3.创建认证服务,完成下面内容
a.创建nova用户
[mw_shl_code=bash,true]openstack user create --password-prompt nova[/mw_shl_code]
[mw_shl_code=bash,true]User Password:
Repeat User Password:
+----------+----------------------------------+
| Field | Value |
+----------+----------------------------------+
| email | None |
| enabled | True |
| id | 8e0b71d732db4bfba04943a96230c8c0 |
| name | nova |
| username | nova |
+----------+----------------------------------+[/mw_shl_code]
b.为用户添加角色
[mw_shl_code=bash,true]openstack role add --project service --user nova admin[/mw_shl_code]
[mw_shl_code=bash,true]+-------+----------------------------------+
| Field | Value |
+-------+----------------------------------+
| id | cd2cb9a39e874ea69e5d4b896eb16128 |
| name | admin |
+-------+----------------------------------+[/mw_shl_code]
c.创建nova服务实例
[mw_shl_code=bash,true] openstack service create --name nova \
--description "OpenStack Compute" compute[/mw_shl_code]
[mw_shl_code=bash,true]+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 060d59eac51b4594815603d75a00aba2 |
| name | nova |
| type | compute |
+-------------+----------------------------------+[/mw_shl_code]
4.创建nova API endpoint
[mw_shl_code=bash,true]openstack endpoint create \
--publicurl http://controller:8774/v2/%\(tenant_id\)s \
--internalurl http://controller:8774/v2/%\(tenant_id\)s \
--adminurl http://controller:8774/v2/%\(tenant_id\)s \
--region RegionOne \
compute[/mw_shl_code]
[mw_shl_code=bash,true]+--------------+-----------------------------------------+
| Field | Value |
+--------------+-----------------------------------------+
| adminurl | http://controller:8774/v2/%(tenant_id)s |
| id | 4e885d4ad43f4c4fbf2287734bc58d6b |
| internalurl | http://controller:8774/v2/%(tenant_id)s |
| publicurl | http://controller:8774/v2/%(tenant_id)s |
| region | RegionOne |
| service_id | 060d59eac51b4594815603d75a00aba2 |
| service_name | nova |
| service_type | compute |
+--------------+-----------------------------------------+[/mw_shl_code]
安装配置计算控制组件
1.安装包
[mw_shl_code=bash,true] yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler \
python-novaclient[/mw_shl_code]
2.编辑文件 /etc/nova/nova.conf 完成下面内容
a.在 [database]部分,配置数据库连接
[mw_shl_code=bash,true][database]
...
connection = mysql://nova:NOVA_DBPASS@controller/nova[/mw_shl_code]
NOVA_DBPASS 替换为自己设置密码
b.在[DEFAULT] 和 [oslo_messaging_rabbit] 部分,配置RabbitMQ 消息队列访问
[mw_shl_code=bash,true][DEFAULT]
...
rpc_backend = rabbit
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS[/mw_shl_code]
替换RABBIT_PASS 为自己设置密码,
c. 在[DEFAULT] 和 [keystone_authtoken] 部分,配置keystone服务
[mw_shl_code=bash,true][DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = NOVA_PASS[/mw_shl_code]
d.在[DEFAULT]部分,配置my_ip (控制节点管理网络ip地址)
[mw_shl_code=bash,true][DEFAULT]
...
my_ip = 10.0.0.11[/mw_shl_code]
e.在 [DEFAULT] 部分,控制节点管理网络配置VNC proxy
[mw_shl_code=bash,true][DEFAULT]
...
vncserver_listen = 10.0.0.11
vncserver_proxyclient_address = 10.0.0.11[/mw_shl_code]
f.在 [glance] 部分,配置glancehost
[mw_shl_code=bash,true][glance]
...
host = controller[/mw_shl_code]
g.在[oslo_concurrency] 部分,配置 lock 路径
[mw_shl_code=bash,true][oslo_concurrency]
...
lock_path = /var/lib/nova/tmp[/mw_shl_code]
h.启用详细信息日志记录
[mw_shl_code=bash,true][DEFAULT]
...
verbose = True[/mw_shl_code]
同步数据库
[mw_shl_code=bash,true]su -s /bin/sh -c "nova-manage db sync" nova[/mw_shl_code]
验证安装
[mw_shl_code=bash,true]systemctl enable openstack-nova-api.service openstack-nova-cert.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl start openstack-nova-api.service openstack-nova-cert.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service[/mw_shl_code]
相关篇章
openstack【Kilo】入门 【准备篇】一:整体介绍【centos】
http://www.aboutyun.com/thread-15205-1-1.html
openstack【Kilo】入门 【准备篇】二:检测网络互通性【centos】
http://www.aboutyun.com/thread-15206-1-1.html
openstack【Kilo】入门 【准备篇】三:NTP安装【centos】
http://www.aboutyun.com/thread-15207-1-1.html
openstack【Kilo】入门 【准备篇】四:openstack包【centos】
http://www.aboutyun.com/thread-15210-1-1.html
openstack【Kilo】入门 【准备篇】五:mysql及rabbitmq安装【centos】
http://www.aboutyun.com/thread-15213-1-1.html
openstack【Kilo】入门 【keystone篇】六:keystone安装配置【centos】
http://www.aboutyun.com/thread-15214-1-1.html
openstack【Kilo】入门 【keystone篇】七:创建服务实例和API endpoint【centos】
http://www.aboutyun.com/thread-15215-1-1.html
openstack【Kilo】入门 【keystone篇】八:创建租户, 用户, 和角色【centos】
http://www.aboutyun.com/thread-15216-1-1.html
openstack【Kilo】入门 【keystone篇】九:验证keystone安装【centos】
http://www.aboutyun.com/thread-15233-1-1.html
openstack【Kilo】入门 【keystone篇】十:创建openstack客户端脚本【centos】
http://www.aboutyun.com/thread-15234-1-1.html
openstack【Kilo】入门 【glance篇】十一:安装配置glance【centos】
http://www.aboutyun.com/thread-15242-1-1.html
openstack【Kilo】入门 【glance篇】十二:glance安装验证【centos】
http://www.aboutyun.com/thread-15243-1-1.html
openstack【Kilo】入门 【nova篇】十三:nova安装配置1:控制节点【centos】
http://www.aboutyun.com/thread-15258-1-1.html
openstack【Kilo】入门 【nova篇】十四:nova安装配置2:计算节点【centos】
http://www.aboutyun.com/thread-15259-1-1.html
openstack【Kilo】入门 【neutron篇】十五:neutron安装配置:控制节点【centos】
http://www.aboutyun.com/thread-15260-1-1.html
openstack【Kilo】入门 【neutron篇】十六:neutron安装配置:网络节点【centos】
http://www.aboutyun.com/thread-15272-1-1.html
openstack【Kilo】入门 【neutron篇】十七:neutron安装配置:计算节点【centos】
http://www.aboutyun.com/thread-15330-1-1.html
openstack【Kilo】入门 【neutron篇】十八:实例化网络【centos】
http://www.aboutyun.com/thread-15342-1-1.html
openstack【Kilo】入门 【neutron篇】十九:dasboard安装配置【centos】
http://www.aboutyun.com/thread-15352-1-1.html
openstack【Kilo】入门 【neutron篇】二十:创建实例(neutron)【centos】
http://www.aboutyun.com/thread-15356-1-1.html
|