openstack O版 配置nova计算服务

1.创建数据库,并且授权数据库,库名为:nova_api 用户名:nova 密码:devops
[[email protected] ~]# mysql -uroot -pdevops
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 ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.
TO ‘nova‘@"%" IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova. TO ‘nova‘@"localhost" IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.
TO ‘nova‘@"%" IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0. TO ‘nova‘@"localhost" IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.
TO ‘nova‘@"%" IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON . TO ‘root‘@‘controller‘ IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> FLUSH PRIVILEGES;
2.[[email protected] ~]# source admin-openrc
3.创建nova的keystone用户
[roo[email protected] ~]# openstack user create --domain default nova --password devops
User Password: 密码为:devops
Repeat User Password: 密码为:devops
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | e651779d03cf4d53b14527bfaffa818a |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
[[email protected] ~]# openstack role add --project service --user nova admin
创建computer服务
[[email protected] ~]# openstack service create --name nova --description "OpenStack Compute" compute

[[email protected] ~]#openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s

[[email protected] ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s


[[email protected] ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s

4.安装nova的软件包
[[email protected] ~]#yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-cert openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler
修改nova配置文件
[[email protected] ~]# cp /etc/nova/nova.conf /etc/nova/nova.conf.bak
[[email protected] ~]# >/etc/nova/nova.conf
[[email protected]~]# cat /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
auth_strategy = keystone
my_ip = 192.168.0.111
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
transport_url = rabbit://openstack:[email protected]
[database]
connection = mysql+pymysql://nova:[email protected]/nova
[api_database]
connection = mysql+pymysql://nova:[email protected]/nova_api
[scheduler]
discover_hosts_in_cells_interval = -1
[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 = devops
service_token_roles_required = True
[vnc]
vncserver_listen = 192.168.0.111
vncserver_proxyclient_address = 192.168.0.111
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
5.同步数据库
[[email protected] ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[[email protected] ~]# su -s /bin/sh -c "nova-manage db sync" nova
6.设置cell_v2关联上创建好的数据库nova_cell0
[[email protected] ~]# nova-manage cell_v2 map_cell0 --database_connection mysql+pymysql://root:[email protected]/nova_cell0
7.创建一个常规cell,名字叫cell1,这个单元格里面将会包含计算节点
[[email protected] ~]# nova-manage cell_v2 create_cell --verbose --name cell1 --database_connection mysql+pymysql://root:[email protected]/nova_cell0 --transport-url rabbit://openstack:[email protected]:5672/
8.检查部署是否正常
# nova-status upgrade check
9.创建和映射cell0,并将现有计算主机和实例映射到单元格中
[[email protected] ~]# nova-manage cell_v2 simple_cell_setup
10.查看已经创建好的单元格列表
[[email protected] ~]# nova-manage cell_v2 list_cells --verbose
注意,如果有新添加的计算节点,需要运行下面命令来发现,并且添加到单元格中
# nova-manage cell_v2 discover_hosts
[[email protected] ~]# nova-status upgrade check

11.创建placement用户和placement 服务,从Ocata开始,需要安装配置placement参与nova调度了,不然虚拟机将无法创建!
[[email protected] ~]# yum install -y openstack-nova-placement-api
[[email protected] ~]# openstack user create --domain default placement --password devops
[[email protected] ~]# openstack role add --project service --user placement admin
[[email protected] ~]# openstack service create --name placement --description "OpenStack Placement" placement
创建placement endpoint
[[email protected] ~]#openstack endpoint create --region RegionOne placement public http://controller:8778
[[email protected] ~]#openstack endpoint create --region RegionOne placement admin http://controller:8778
[[email protected] ~]#openstack endpoint create --region RegionOne placement internal http://controller:8778
把placement 整合到nova.conf里
[placement]
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 = devops
os_region_name = RegionOne
12.配置修改00-nova-placement-api.conf文件,这步没做创建虚拟机的时候会出现禁止访问资源的问题
[[email protected] ~]#cd /etc/httpd/conf.d/
[[email protected] ~]#cp 00-nova-placement-api.conf 00-nova-placement-api.conf.bak
[[email protected] ~]#>00-nova-placement-api.conf
[[email protected] conf.d]# cat 00-nova-placement-api.conf
Listen 8778
<VirtualHost :8778>
WSGIProcessGroup nova-placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess nova-placement-api processes=3 threads=1 user=nova group=nova
WSGIScriptAlias / /usr/bin/nova-placement-api
<Directory "/">
Order allow,deny
Allow from all
Require all granted
</Directory>
<IfVersion >= 2.4>
ErrorLogFormat "%M"
</IfVersion>
ErrorLog /var/log/nova/nova-placement-api.log
</VirtualHost>
Alias /nova-placement-api /usr/bin/nova-placement-api
<Location /nova-placement-api>
SetHandler wsgi-script
Options +ExecCGI
WSGIProcessGroup nova-placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
</Location>
13.重启下httpd服务
[[email protected] ~]# systemctl restart httpd
检查下是否配置成功
# nova-status upgrade check

14.启动服务
[[email protected] ~]# 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
[[email protected] ~]# systemctl restart openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[[email protected] ~]# systemctl status openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[[email protected] ~]# systemctl list-unit-files |grep openstack-nova-

15.验证nova服务
[[email protected] ~]# unset OS_TOKEN OS_URL
[[email protected] ~]# source /root/admin-openrc
[[email protected] ~]# nova service-list
[[email protected] ~]# openstack endpoint list 查看endpoint list

所有的配置文件在百度云盘中:
链接:https://pan.baidu.com/s/1CnmKkFMTemv199ctgb5Oig
提取码:27om
复制这段内容后打开百度网盘手机App,操作更方便哦

原文地址:https://blog.51cto.com/343614597/2419455

时间: 2024-10-23 23:55:47

openstack O版 配置nova计算服务的相关文章

openstack O版 配置glance镜像服务

1.创建glance数据库[[email protected] ~]# mysql -uroot -pdevopsMariaDB [(none)]> CREATE DATABASE glance;MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance. TO 'glance'@'localhost' IDENTIFIED BY 'devops';MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance. T

Centos7 install Openstack - (第四节)添加计算服务(Nova)

Centos7 install Openstack - (第四节)添加计算服务(Nova) 我的blog地址:http://www.cnblogs.com/caoguo 该文根据openstack官方文档配置 官方文档地址: http://docs.openstack.org/juno/install-guide/install/yum/content/# 0x01. Install and configure controller node (在控制节点安装配置一下内容) 一) 配置基本环境

openstack云计算(二):Openstack rocky 部署三 nova计算节点部署

Openstack 云计算(二): Openstack Rocky部署三 nova 部署与验证 (计算节点) 标签(空格分隔): openstack系列 一:nova计算节点初始化 二:nova 计算节点配置 一: nova计算节点初始化 1.1 配置主机名 login: 10.0.0.31 cat /etc/hosts --- 10.0.0.11 controller 10.0.0.31 computer1 10.0.0.41 block1 10.0.0.51 object1 10.0.0.5

openstack Q版部署-----nova服务配置-计算节点(6)

一.服务安装 yum install openstack-nova-compute -y 编辑/etc/nova/nova.conf文件并设置如下内容 [DEFAULT] enabled_apis = osapi_compute,metadata transport_url = rabbit://openstack:[email protected] my_ip = 10.1.80.111 use_neutron = True firewall_driver = nova.virt.firewa

[ Openstack ] Openstack-Mitaka 高可用之 计算服务(Nova)

目录 Openstack-Mitaka 高可用之 概述    Openstack-Mitaka 高可用之 环境初始化    Openstack-Mitaka 高可用之 Mariadb-Galera集群部署    Openstack-Mitaka 高可用之 memcache    Openstack-Mitaka 高可用之 Pacemaker+corosync+pcs高可用集群    Openstack-Mitaka 高可用之 认证服务(keystone)    Openstack-Mitaka

OpenStack Nova计算服务管理(四)

作者:李晓辉 联系方式: [email protected] 环境介绍 类型 控制节点和计算节点等在一起,形成all-in-one 内存 8G 硬盘 200G 网卡 2块 计算服务概览 使用OpenStack计算服务来托管和管理云计算系统.OpenStack计算服务是基础设施即服务(IaaS)系统的主要部分,模块主要由Python实现. OpenStack计算组件请求OpenStack Identity服务进行认证:请求OpenStack Image服务提供磁盘镜像:为OpenStack das

Openstack O版 配置swift对象存储服务

环境如下图所示:IP:192.168.0.111 controllerIP:192.168.0.112 computeIP:192.168.0.113 object1IP:192.168.0.117 object2IP:192.168.0.118 cinder1.在控制节点上安装 swift服务[[email protected]er ~]# source admin-openrc创建swift用户[[email protected] ~]# openstack user create --do

openstack M版安装 network(neutron)服务篇

安装配置network(neutron) 服务 Mitaka版本网络有两个选择,Provider network 和Self-service network,这里我们选择第二种. controller 节点 一.创建数据库 [[email protected] ~]# mysql -u root -p >>CREATE DATABASE neutron; >>GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost'   I

openstack M版安装 storage(cinder)服务篇

安装配置cinder服务 controller节点 一.创建数据库 [[email protected] ~]#  mysql -u root -p >>CREATE DATABASE cinder; >>GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost'   IDENTIFIED BY 'CINDER_DBPASS'; >>GRANT ALL PRIVILEGES ON cinder.* TO 'cinde