OpenStack_Rocky版-4.安装nova计算服务(控制节点)

1. 计算服务Nova安装及配置(控制节点)

1.1 创建数据库及用户

[root@controller ~]# mysql -uroot -p000000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 34
Server version: 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;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE nova;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE nova_cell0;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY '000000';
Query OK, 0 rows affected (0.00 sec)

1.2 创建nova用户(密码000000)

[root@controller ~]# source admin-openrc 
[root@controller ~]# openstack user create --domain default --password 000000 nova

在这里插入图片描述

1.3 为nova用户添加admin角色(加入管理员组)

[root@controller ~]# openstack role add --project service --user nova admin

1.4 创建nova服务实体

[root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute

在这里插入图片描述

1.5 创建nova服务认证端点

[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

1.6 创建placement服务用户(密码000000)

[root@controller ~]# openstack user create --domain default --password 000000 placement

在这里插入图片描述

1.7 添加placement用户为项目服务admin角色

[root@controller ~]# openstack role add --project service --user placement admin

1.8 创建placement服务实体

[root@controller ~]# openstack service create --name placement --description "Placement API" placement

在这里插入图片描述

1.9 创建placement服务认证端点

[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

1.10 安装配置nova

1.10.1 安装软件包

[root@controller ~]# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api -y

1.10.2 配置nova文件

[root@controller ~]# cp /etc/nova/nova.conf{,.bak}
[root@controller ~]# grep -Ev '^$|#' /etc/nova/nova.conf.bak > /etc/nova/nova.conf
[root@controller ~]# vim /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:000000@controller
my_ip = 192.168.1.10
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
connection = mysql+pymysql://nova:000000@controller/nova_api
[database]
connection = mysql+pymysql://nova:000000@controller/nova
[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 = 000000
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip
[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:5000/v3
username = placement
password = 000000

[root@controller ~]# vim /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>

1.10.3 同步数据库

[root@controller ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[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
ca55058b-03ca-4f77-aff0-d238cf7ae099
[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
#忽略报错

1.10.4 验证 nova、 cell0、 cell1数据库是否注册正确

[root@controller ~]# nova-manage cell_v2 list_cells

在这里插入图片描述

1.10.5 启动服务

[root@controller ~]#  systemctl start openstack-nova-api.service  openstack-nova-consoleauth openstack-nova-scheduler.service  openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@controller ~]#  systemctl enableopenstack-nova-api.service  openstack-nova-consoleauth openstack-nova-scheduler.service  openstack-nova-conductor.service openstack-nova-novncproxy.service
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不想敲代码的运维

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值