标签:type 组件 sync root nbsp dmi roo app service
1.安装服务组件
yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api -y
2.在mariadb中创建nova_api、nova、nova_cell0数据库,创建nova用户、设置密码并授予对这三个数据库的所有操作权限:
mysql -uroot -p
create database nova_api;
create database nova;
create database nova_cell0;
grant all privileges on nova_api.* to ‘nova‘@‘localhost‘ identified by ‘nova‘ with grant option;
grant all privileges on nova_api.* to ‘nova‘@‘%‘ identified by ‘nova‘ with grant option;
grant all privileges on nova.* to ‘nova‘@‘localhost‘ identified by ‘nova‘ with grant option;
grant all privileges on nova.* to ‘nova‘@‘%‘ identified by ‘nova‘ with grant option;
grant all privileges on nova_cell0.* to ‘nova‘@‘localhost‘ identified by ‘nova‘ with grant option;
grant all privileges on nova_cell0.* to ‘nova‘@‘%‘ identified by ‘nova‘ with grant option;
flush privileges;
exit;
3.配置nova组件,以便它可以访问mariadb数据库,在导nova表到数据库之前,一定要先配置这个。
vim /etc/nova/nova.conf
在[api_database]中,添加:
connection = mysql+pymysql://nova:nova@controller1/nova_api
在[database]中,添加:
connection = mysql+pymysql://nova:nova@controller1/nova
保存退出。
3.将nova_api组件的表导入到mariadb的nova_api数据库中
su -s /bin/sh -c "nova-manage api_db sync" nova
查看nova_api数据库,我的有32张表。
4.将nova组件的表导入到mariadb的nova数据库中
su -s /bin/sh -c "nova-manage db sync" nova
查看nova数据库,我的有110张表。
可能会有一个警告:WARNING: cell0 mapping not found - not syncing cell0.解决办法在第五步。这个报错是从N版开始新增的cell功能。
5.注册nova_cell0数据库并创建cell1
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
查看nova_cell0,我的有110张表,和nova数据库中的表一摸一样。
创建cell1:
su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
6.在keystone服务中,为nova和placement创建用户,并授予权限:
为nova创建用户并授予权限:
openstack user create --domain default --password-prompt nova #回车会要求设置密码,我设置的密码是nova
openstack role add --project service --user nova admin
为placement创建用户并授予权限:
openstack user create --domain default --password-prompt placement #回车会要求设置密码,我设置的密码是placement
openstack role add --project service --user placement admin
7.配置nova和placement服务组件向keystone服务组件请求token:
配置nova组件向keystone服务请求token:
vim /etc/nova/nova.conf
在[api]下,添加:
auth_strategy = keystone
在[keystone_authtoken]下,添加:
auth_url = http://controller1:5000/v3
memcached_servers = controller1:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
配置placement服务组件向keystone服务组件请求token:
在[placement]下,添加:
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller1:5000/v3
username = placement
password = placement
保存退出。
8.配置nova启用计算和元数据API
vim /etc/nova/nova.conf
在[DEFAULT]下,添加:
enabled_apis = osapi_compute,metadata
保存退出。
9.配置nova访问RabbitMQ 消息队列
vim /etc/nova/nova.conf
在[DEFAULT]下,添加:
transport_url = rabbit://openstack:123456@controller1
保存退出。
10.在keystone中为nova和placement分别创建服务实体和API端点
为nova创建服务实体和API端点:
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region RegionOne compute public http://controller1:8774/v2.1
openstack endpoint create --region RegionOne compute internal http://controller1:8774/v2.1
openstack endpoint create --region RegionOne compute admin http://controller1:8774/v2.1
为placement创建服务实体和API端点:
openstack service create --name placement --description "Placement API" placement
openstack endpoint create --region RegionOne placement public http://controller1:8778
openstack endpoint create --region RegionOne placement internal http://controller1:8778
openstack endpoint create --region RegionOne placement admin http://controller1:8778
OpenStack控制节点上搭建Q版nova服务(step5)
标签:type 组件 sync root nbsp dmi roo app service
原文地址:https://www.cnblogs.com/jipinglong/p/10178461.html