本文主要是介绍openstack Queens版本在centos7.1,最小化安装(安装nova(控制节点)),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
先在控制节点安装
在数据库中创建nova库和用户并授权
[root@con01~]# mysql -u root -ptest.2018
Welcometo the MariaDB monitor. Commands endwith ; or \g.
YourMariaDB connection id is 30
Serverversion: 10.1.20-MariaDB MariaDB Server
Copyright(c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB[(none)]> CREATE DATABASE nova_api;
QueryOK, 1 row affected (0.01 sec)
MariaDB[(none)]> CREATE DATABASE nova;
QueryOK, 1 row affected (0.00 sec)
MariaDB[(none)]> CREATE DATABASE nova_cell0;
QueryOK, 1 row affected (0.00 sec)
MariaDB[(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
-> IDENTIFIED BY 'test.2018';
QueryOK, 0 rows affected (0.00 sec)
MariaDB[(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
-> IDENTIFIED BY 'test.2018';
QueryOK, 0 rows affected (0.00 sec)
MariaDB[(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
-> IDENTIFIED BY 'test.2018';
QueryOK, 0 rows affected (0.00 sec)
MariaDB[(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
-> IDENTIFIED BY 'test.2018';
QueryOK, 0 rows affected (0.00 sec)
MariaDB[(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \
-> IDENTIFIED BY 'test.2018';
QueryOK, 0 rows affected (0.00 sec)
MariaDB[(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
-> IDENTIFIED BY 'test.2018';
QueryOK, 0 rows affected (0.00 sec)
************************************************************************
创建nova用户:
[root@con01~]# openstack user create --domain default --password-prompt nova
UserPassword:
RepeatUser Password:
+---------------------+----------------------------------+
|Field | Value |
+---------------------+----------------------------------+
|domain_id | default |
|enabled | True |
|id |5d7cb0197e984095992e6359926b5b2f |
|name | nova |
|options | {} |
|password_expires_at | None |
+---------------------+----------------------------------+
将nova关联到admin角色 和service中
[root@con01~]# openstack role add --project service --user nova admin
[root@con01~]# openstack service create --name nova \
> --description "OpenStack Compute"compute
+-------------+----------------------------------+
|Field | Value |
+-------------+----------------------------------+
|description | OpenStack Compute |
|enabled | True |
|id |399a8a16094249e7a9ade6f12b3deaa1 |
|name | nova |
|type | compute |
+-------------+----------------------------------+
You havenew mail in /var/spool/mail/root
创建api接口(公共 内部 管理)
[root@con01~]# openstack endpoint create --region RegionOne \
> compute public http://controller:8774/v2.1
+--------------+----------------------------------+
|Field | Value |
+--------------+----------------------------------+
|enabled | True |
|id |5d706fc652ab4a10a65c80566b1735c1 |
|interface | public |
|region | RegionOne |
|region_id | RegionOne |
|service_id | 399a8a16094249e7a9ade6f12b3deaa1|
|service_name | nova |
|service_type | compute |
|url | http://controller:8774/v2.1 |
+--------------+----------------------------------+
[root@con01~]# openstack endpoint create --region RegionOne \
> compute internal http://controller:8774/v2.1
+--------------+----------------------------------+
|Field | Value |
+--------------+----------------------------------+
|enabled | True |
|id |7ac8d31bab9041da83e87256073360a9 |
|interface | internal |
|region | RegionOne |
|region_id | RegionOne |
|service_id |399a8a16094249e7a9ade6f12b3deaa1 |
|service_name | nova |
|service_type | compute |
|url | http://controller:8774/v2.1 |
+--------------+----------------------------------+
[root@con01~]# openstack endpoint create --region RegionOne \
> compute admin http://controller:8774/v2.1
+--------------+----------------------------------+
|Field | Value |
+--------------+----------------------------------+
|enabled | True |
|id |14d8f72c2d9c48d3943531c6fc3f60ac |
|interface | admin |
|region | RegionOne |
|region_id | RegionOne |
|service_id |399a8a16094249e7a9ade6f12b3deaa1 |
|service_name | nova |
|service_type | compute |
|url | http://controller:8774/v2.1 |
+--------------+----------------------------------+
************************************************************************
创建placement并关联admin角色和service
[root@con01~]# openstack user create --domain default --password-prompt placement
UserPassword:
RepeatUser Password:
+---------------------+----------------------------------+
|Field | Value |
+---------------------+----------------------------------+
|domain_id | default |
|enabled | True |
|id |0eeb11be98e4473fbc4a5ce6c08cfd12 |
|name | placement |
|options | {} |
|password_expires_at | None |
+---------------------+----------------------------------+
You havenew mail in /var/spool/mail/root
[root@con01~]# openstack role add --project service --user placement admin
[root@con01~]# openstack service create --name placement --description "PlacementAPI" placeme
nt+-------------+----------------------------------+
|Field | Value |
+-------------+----------------------------------+
|description | Placement API |
|enabled | True |
|id |e2949d12ea424f49b0939f4b947b4f1f |
|name | placement |
|type | placement |
+-------------+----------------------------------+
You havenew mail in /var/spool/mail/root
创建api接口(公共 内部 管理)
[root@con01~]# openstack endpoint create --region RegionOne placement public http://controller
:8778+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
|enabled | True |
|id |15324fab69c44fa5a0159d6cfb77d895 |
|interface | public |
| region | RegionOne |
|region_id | RegionOne |
|service_id |e2949d12ea424f49b0939f4b947b4f1f |
|service_name | placement |
|service_type | placement |
|url | http://controller:8778 |
+--------------+----------------------------------+
[root@con01~]# openstack endpoint create --region RegionOne placement internal http://controll
er:8778+--------------+----------------------------------+
|Field | Value |
+--------------+----------------------------------+
|enabled | True |
|id |f346c01041524556999e13aefb7036ce |
|interface | internal |
|region | RegionOne |
|region_id | RegionOne |
|service_id |e2949d12ea424f49b0939f4b947b4f1f |
|service_name | placement |
|service_type | placement |
|url | http://controller:8778 |
+--------------+----------------------------------+
[root@con01~]# openstack endpoint create --region RegionOne placement admin http://controller:
8778+--------------+----------------------------------+
|Field | Value |
+--------------+----------------------------------+
|enabled | True |
|id |9a512ffeea024a40864dafb8df9d3804 |
|interface | admin |
|region | RegionOne |
|region_id | RegionOne |
|service_id |e2949d12ea424f49b0939f4b947b4f1f |
|service_name | placement |
|service_type | placement |
|url | http://controller:8778 |
+--------------+----------------------------------+
************************************************************************
安装
yum install openstack-nova-api openstack-nova-conductor \
openstack-nova-consoleopenstack-nova-novncproxy \
openstack-nova-scheduleropenstack-nova-placement-api -y
修改配置文件(需要修改的选项较多)
[root@con01 ~]# cat /etc/nova/nova.conf |grep -v ^#
[DEFAULT]
my_ip =10.0.2.111
use_neutron= True
firewall_driver= nova.virt.firewall.NoopFirewallDriver
enabled_apis= osapi_compute,metadata
transport_url= rabbit://openstack:test.2018@controller
[api_database]
connection= mysql+pymysql://nova:test.2018@controller/nova_api
[database]
connection= mysql+pymysql://nova:test.2018@controller/nova
[api]
auth_strategy= keystone
[keystone_authtoken]
auth_uri= http://controller:5000
auth_url= http://controller:35357
memcached_servers= controller:11211
auth_type= password
project_domain_name= default
user_domain_name= default
project_name= service
username= nova
password= test.2018
[vnc]
enabled= true
server_listen= 10.0.2.111
server_proxyclient_address= 10.0.2.111
[glance]
api_servers= http://controller:9292
[oslo_concurrency]
lock_path= /var/lib/nova/tmp
[placement]
os_region_name= RegionOne
project_domain_name= Default
project_name= service
auth_type= password
user_domain_name= Default
auth_url= http://controller:35357/v3
username= placement
password= test.2018
***************************************************************
在/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服务
systemctl restart httpd
***************************************************************
数据库初始化
[root@con01~]# su -s /bin/sh -c "nova-manage api_db sync" nova
会有下面的报错可以忽略
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332:NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported exception.NotSupportedWarning
1. # su -s /bin/sh -c "nova-managecell_v2 map_cell0" nova
2. # su -s /bin/sh -c "nova-managecell_v2 create_cell --name=cell1 --verbose" nova
3. # su -s /bin/sh -c "nova-manage dbsync" nova
验证nova cell0和cell1是否正确注册:
启动服务
# systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.serviceopenstack-nova-scheduler.service \
openstack-nova-conductor.serviceopenstack-nova-novncproxy.service
systemctl restart openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service\
openstack-nova-conductor.serviceopenstack-nova-novncproxy.service
这篇关于openstack Queens版本在centos7.1,最小化安装(安装nova(控制节点))的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!