Openstack(九)部署nova服务(控制节点)
9.1nova服务介绍
nova是openstack最早的组件之一,nova分为控制节点和计算节点,计算节点通过nova computer进行虚拟机创建,通过libvirt调用kvm创建虚拟机,nova之间通信通过rabbitMQ队列进行通信,其组件和功能如下:
API:负责接收和响应外部请求。
Scheduler:负责调度虚拟机所在的物理机。
Conductor:计算节点访问数据库的中间件。
Consoleauth:用于控制台的授权认证。
Novncproxy:VNC 代理,用于显示虚拟机操作终端。
官方部署文档:https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/common/get_started_compute.html
Nova-API的功能:
Nova-api组件实现了restful API的功能,接收和响应来自最终用户的计算API请求,接收外部的请求并通过message queue将请求发动给其他服务组件,同时也兼容EC2 API,所以也可以使用EC2的管理工具对nova进行日常管理。
nova scheduler:
nova scheduler模块在openstack中的作用是决策虚拟机创建在哪个主机(计算节点)上。决策一个虚拟机应该调度到某物理节点,需要分为两个步骤:
过滤(filter),过滤出可以创建虚拟机的主机
9.2安装nove控制节点
官方安装文档:https://docs.openstack.org/ocata/zh_CN/install-guide-rdo/nova-controller-install.html
9.2.1安装nova控制端
# 在控制服务器安装
# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api
9.2.2数据库准备
# 注mariaDB使用时需三个库都添加本主机权限GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'<主机名>' IDENTIFIED BY 'nova123';
# mysql
> CREATE DATABASE nova_api;
> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'nova123';
> CREATE DATABASE nova;
> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova123';
> CREATE DATABASE nova_cell0;
> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'nova123';
> flush privileges;
9.2.3验证数据库
9.3配置nova控制端服务
控制端服务器操作
9.3.1创建nova服务
# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | f5d5af647ae040eca5bf7d878c23086d |
| name | nova |
| type | compute |
+-------------+----------------------------------+
9.3.2创建公共端点
# openstack endpoint create --region RegionOne compute public http://192.168.10.100:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 9ea17b1200fc40ed84de2c66651d8298 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f5d5af647ae040eca5bf7d878c23086d |
| service_name | nova |
| service_type | compute |
| url | http://192.168.10.100:8774/v2.1 |
+--------------+----------------------------------+
9.3.3创建私有端点
# openstack endpoint create --region RegionOne compute internal http://192.168.10.100:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | cc3e3b629fbf44a69948922773836804 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f5d5af647ae040eca5bf7d878c23086d |
| service_name | nova |
| service_type | compute |
| url | http://192.168.10.100:8774/v2.1 |
+--------------+----------------------------------+
9.3.4创建管理端点
# openstack endpoint create --region RegionOne compute admin http://192.168.10.100:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 51dca1e673ee419f8c75fb9646520003 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | f5d5af647ae040eca5bf7d878c23086d |
| service_name | nova |
| service_type | compute |
| url | http://192.168.10.100:8774/v2.1 |
+--------------+----------------------------------+
9.3.5创建placement用户
# Placement用户密码设置为placement
# openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | 961b40ed4c6b40a9b266ce5e451a4292 |
| enabled | True |
| id | f052cbbd13d341e3bee6a0da23588802 |
| name | placement |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
9.3.6授权placement用户admin权限
# openstack role add --project service --user placement admin
9.3.7创建placement API并注册
# openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Placement API |
| enabled | True |
| id | af5b2be1a8e24a2d9a619f318a04022a |
| name | placement |
| type | placement |
+-------------+----------------------------------+
# openstack endpoint create --region RegionOne placement public http://192.168.10.100:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | c1eb9cc9c3bf42bd9b49ac86b309fe2b |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | af5b2be1a8e24a2d9a619f318a04022a |
| service_name | placement |
| service_type | placement |
| url | http://192.168.10.100:8778 |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne placement internal http://192.168.10.100:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 65cf7e1dbeac440ea6a4e369e816d83e |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | af5b2be1a8e24a2d9a619f318a04022a |
| service_name | placement |
| service_type | placement |
| url | http://192.168.10.100:8778 |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne placement admin http://192.168.10.100:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 8c073907d3d84c5995df683b0a2c4f5b |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | af5b2be1a8e24a2d9a619f318a04022a |
| service_name | placement |
| service_type | placement |
| url | http://192.168.10.100:8778 |
+--------------+----------------------------------+
9.3.8配置nova.conf配置文件
# 详细配置文件/etc/nova/nova.conf
1:[DEFAULT]
2306:use_neutron=true
2465:firewall_driver=nova.virt.firewall.NoopFirewallDriver
2629:enabled_apis=osapi_compute,metadata
3021:transport_url = rabbit://openstack:123456@192.168.10.205
3028:rpc_backend=rabbit
3069:[api]
3085:auth_strategy=keystone
3367:[api_database]
3380:connection = mysql+pymysql://nova:nova123@192.168.10.100/nova_api
4370:[database]
4398:connection = mysql+pymysql://nova:nova123@192.168.10.100/nova
4939:[glance]
4957:api_servers=http://192.168.10.100:9292
5598:[keystone_authtoken]
5599:auth_uri = http://192.168.10.100:5000
5600:auth_url = http://192.168.10.100:35357
5601:memcached_servers = 192.168.10.100:11211
5602:auth_type = password
5603:project_domain_name = default
5604:user_domain_name = default
5605:project_name = service
5606:username = nova
5607:password = nova
7235:[oslo_concurrency]
7250:lock_path=/var/lib/nova/tmp
8081:[placement]
8082:os_region_name = RegionOne
8083:project_domain_name = Default
8084:project_name = service
8085:auth_type = password
8086:user_domain_name = Default
8087:auth_url = http://192.168.10.100:35357/v3
8088:username = placement
8089:password = placement
9669:[vnc]
9685:enabled=true
9708:vncserver_listen=192.168.10.201
9720:vncserver_proxyclient_address=192.168.10.201
9.3.9配置apache服务placement API
# 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>
# systemctl restart httpd #重启http服务
9.3.10初始化数据库
#nova_api数据库
# su -s /bin/sh -c "nova-manage api_db sync" nova
#nova数据库
# su -s /bin/sh -c "nova-manage db sync" nova
#nova cell0数据库
# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
#nova cell1 数据库
# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
7972a48a-bddb-4957-b773-852565a25725
9.4验证nova cell0和nova cell1是否正常注册
# nova-manage cell_v2 list_cells
+-------+--------------------------------------+
| Name | UUID |
+-------+--------------------------------------+
| cell0 | 00000000-0000-0000-0000-000000000000 |
| cell1 | 7972a48a-bddb-4957-b773-852565a25725 |
+-------+--------------------------------------+
9.5启动并将nova服务设置为开机启动
# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
9.6重启nova控制端脚本
# cat nova-restart.sh
#!/bin/bash
systemctl restart openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
# chmod a+x nova-restart.sh
9.7查看nova服务日志
9.8查看rabbitMQ连接
9.9验证nova控制端:
# nova service-list
Openstack(九)部署nova服务(控制节点)的更多相关文章
- openstack Q版部署-----nova服务配置-控制节点(5)
一.创建数据库(控制节点) 创建数据库以及用户: CREATE DATABASE nova_api; CREATE DATABASE nova; CREATE DATABASE nova_cell0; ...
- openstack Q版部署-----nova服务配置-计算节点(6)
一.服务安装(计算节点) 安装软件: yum install openstack-nova-compute -y 编辑/etc/nova/nova.conf文件并设置如下内容: [DEFAULT] e ...
- Openstack(十)部署nova服务(计算节点)
在计算节点安装 10.1安装nova计算服务 # 阿里云源详见2.3配置 # yum install openstack-nova-compute 10.2配置nova计算服务 10.2.1配置nov ...
- openstack安装部署——计算服务(控制节点&计算节点)前言
1.前言Openstack计算服务通过认证服务获取认证:通过镜像服务获取镜像:通过仪表盘提供的用户界面与用户交互.镜像的存取受工程和用户的限制,配额受工程的限制(例如不同工程允许虚拟机实例数量不同). ...
- openstack controller ha测试环境搭建记录(八)——配置nova(控制节点)
在任一节点创建nova用户:mysql -u root -p CREATE DATABASE nova;GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localh ...
- openstack 部署笔记--neutron控制节点
控制节点 配置neutron用户及服务 $ . admin-openrc $ openstack user create --domain default --password-prompt neut ...
- OpenStack搭建Q版在控制节点上的环境准备(step2)
接下来是只需要在控制节点上准备的环境配置.其中虽然NTP服务需要在所有节点上都安装,但NTP服务在控制节点和其他的节点上的配置是不同的,所以不把它放在step1的公共配置中进行准备.如下: 1.配置N ...
- OpenStack 安装:nova服务
上一篇介绍了glance,并且成功创建了一个镜像,这一篇介绍Nova. 首先创建Nova用户,需要记得先source环境变量,然后创建Nova用户,并设置密码为nova [root@linux-nod ...
- Openstack组件部署 — Nova overview
目录 目录 前文列表 前言 Compute service overview Nova 的组件 nova-api service nova-api-metadata service nova-comp ...
随机推荐
- jQuery实现鼠标经过时高亮,同时其他同级元素变暗的效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- SQL 2005 如何只安装客户端?
在“注册信息”输入合适的用户名和公司后,点击[下一步],在“要安装的组件”界面中选择要安装的组件:根据我们的需要来选择要安装的组件(各组件的说明如下表),这里我勾选所有的组件:我们可以点击 [高级 ...
- chrome浏览器开发者工具使用教程[转]
转自:http://www.cr173.com/html/16930_1.html 更多资源:https://developers.google.com/chrome-developer-tools/ ...
- JavaScript第五天之数组
<script> var a=[1,2,3]; //var a=new Array(1,2,3); //alert(a.length); alert(a[0]); </script& ...
- Access数据操作-01
1.未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序 在菜单 “项目”的最下面 工程属性 菜单,选择“生成”选项卡,将目标平台由“Amy CPU”或者“*64”改成“* ...
- Windows上Tomcat启动,服务中没有Tomcat
首先需要查看Tomcat的bin目录下是否有service.bat,如果没有需要去下载一版bin目录下有service.bat的Tomcat,只有Windows版本的Tomcat的bin目录下才有se ...
- MySQL性能优化(二)-- 数据类型,SQL,八种连接
一.mysql数据类型优化原则 1. 能够使用最小数据类型存储时,尽量使用最小数据类型存储(前提是要评估字段值的真实数据存储范围) eg:create table aaa(id1 int(10) ze ...
- MQTT协议笔记之mqtt.io项目Websocket协议支持
前言 MQTT协议专注于网络.资源受限环境,建立之初不曾考虑WEB环境,倒也正常.虽然如此,但不代表它不适合HTML5环境. HTML5 Websocket是建立在TCP基础上的双通道通信,和TCP通 ...
- LeetCode——Best Time to Buy and Sell Stock II
Description: Say you have an array for which the ith element is the price of a given stock on day i. ...
- change事件的兼容性问题
当input的value被修改时,在没有失去焦点的情况下,无法触发change事件,但是可以触发propertychange事件. 但是propertychange事件存在兼容性问题: IE9以下支持 ...