标签:script abc 组件 dmi rom SQ 包括 domain etc
一、Compute介绍在openstack架构中,compute组件通过identity对用户进行认证,通过image获取磁盘或映像文件,并可以让用户通过dashboard进行管理。能否获取image取决于项目或用户的权限,能够使用的配额则取决于每一个项目本身。当收到一个启动实例请求时,它会根据计算选择一个承载实例的节点,然后将image下载到本地后启动。
Compute由以下几个部分组成:
准备工作
安装配置前,必须先创建数据库、服务凭证和API访问路径
MariaDB [(none)]> create database nova_api;
MariaDB [(none)]> create database nova;
MariaDB [(none)]> create database nova_cell0;
MariaDB [(none)]> grant all privileges on nova_api.* to ‘nova‘@‘localhost‘ identified by ‘password1!‘;
MariaDB [(none)]> grant all privileges on nova_api.* to ‘nova‘@‘%‘ identified by ‘password1!‘;
MariaDB [(none)]> grant all privileges on nova.* to ‘nova‘@‘localhost‘ identified by ‘password1!‘;
MariaDB [(none)]> grant all privileges on nova.* to ‘nova‘@‘%‘ identified by ‘password1!‘;
MariaDB [(none)]> grant all privileges on nova_cell0.* to ‘nova‘@‘localhost‘ identified by ‘password1!‘;
MariaDB [(none)]> grant all privileges on nova_cell0.* to ‘nova‘@‘%‘ identified by ‘password1!‘;
[root@controller ~]# . admin-openrc
[root@controller ~]# openstack user create --domain default --password-prompt nova
给nova用户赋予admin权限
[root@controller ~]# openstack role add --project service --user nova admin
创建名为nova的compute服务
[root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute
创建compute服务API路径
[root@controller ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
[root@controller ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
[root@controller ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
[root@controller ~]# openstack user create --domain default --password-prompt placement
给server项目中的placement用户赋予管理员权限
[root@controller ~]# openstack role add --project service --user placement admin
创建placement服务
[root@controller ~]# openstack service create --name placement --description "Placement API" placement
创建placement服务API路径
[root@controller ~]# openstack endpoint create --region RegionOne placement public http://controller:8778
[root@controller ~]# openstack endpoint create --region RegionOne placement internal http://controller:8778
[root@controller ~]# openstack endpoint create --region RegionOne placement admin http://controller:8778
安装配置
[root@controller ~]# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api
[DEFAULT]
# ...
enabled_apis = osapi_compute,metadata
设置database访问路径
[api_database]
# ...
connection = mysql+pymysql://nova:password1!@controller/nova_api
[database]
# ...
connection = mysql+pymysql://nova:password1!@controller/nova
允许访问rabbitmq消息队列
[DEFAULT]
# ...
transport_url = rabbit://openstack:password1!@controller
配置identity入口
[api]
# ...
auth_strategy = keystone
[keystone_authtoken]
# ...
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = password1!
使用管理地址设置my_ip变量
[DEFAULT]
# ...
my_ip = 192.168.80.10
启用支持网络服务
[DEFAULT]
# ...
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
compute默认使用内部防火墙,由于网络服务包括防火墙,所以必须使用nova.virt.firewall.NoopFirewallDriver禁用内部防火墙
使用管理地址设置vnc代理
[vnc]
enabled = true
# ...
server_listen = $my_ip
server_proxyclient_address = $my_ip
设置image server的API路径
[glance]
# ...
api_servers = http://controller:9292
设置锁路径
[oslo_concurrency]
# ...
lock_path = /var/lib/nova/tmp
设置placement API路径
[placement]
# ...
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = password1!
编辑/etc/httpd/conf.d/00-nova-placement-api.conf配置文件,添加以下内容
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
检查无误后重启httpd服务
[root@controller ~]# httpd -t
[root@controller ~]# systemctl restart httpd
[root@controller ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@controller ~]# mysql
MariaDB [(none)]> show databases;
MariaDB [(none)]> use nova_api;
MariaDB [nova_api]> show tables;
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
MariaDB [(none)]> show databases;
MariaDB [(none)]> use nova;
MariaDB [nova]> show tables;
[root@controller ~]# nova-manage cell_v2 list_cells
启动并设置服务自启
[root@controller ~]# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@controller ~]# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
标签:script abc 组件 dmi rom SQ 包括 domain etc
原文地址:http://blog.51cto.com/arkling/2134723