OpenStack 安装:nova服务
上一篇介绍了glance,并且成功创建了一个镜像,这一篇介绍Nova。
- 首先创建Nova用户,需要记得先source环境变量,然后创建Nova用户,并设置密码为nova
[root@linux-node1 ~]# source admin-openstack.sh
[root@linux-node1 ~]# openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 34c7be4d612a45b4830304af29eb010e |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
- 给Nova用户添加admin角色
[root@linux-node1 ~]# openstack role add --project service --user nova admin
[root@linux-node1 ~]#
- 创建Nova服务实例
openstack service create --name nova \
--description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | bf254b3182e04256897e925632f171d0 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
- 创建NovaAPI服务端点
openstack endpoint create --region RegionOne \
compute public http://192.168.56.11:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 06541267fb014c7f9b0be6748366fdba |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | bf254b3182e04256897e925632f171d0 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2.1 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
compute internal http://192.168.56.11:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | d9da327e665645fb9766dea107e13bf1 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | bf254b3182e04256897e925632f171d0 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2.1 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
compute admin http://192.168.56.11:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 805cd45ded6841d0acd3335ccfdc29ef |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | bf254b3182e04256897e925632f171d0 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2.1 |
+--------------+----------------------------------+
- 创建placement服务,并将密码设置为placement
[root@linux-node1 ~]# openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 27080769990347169fdc6bf81fe9ebd1 |
| name | placement |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
- 给placement用户添加admin角色
[root@linux-node1 ~]# openstack role add --project service --user placement admin
- 在服务目录中创建placement API实例
[root@linux-node1 ~]# openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Placement API |
| enabled | True |
| id | 344d25c79f1b412cb0c5958bd8242b2c |
| name | placement |
| type | placement |
+-------------+----------------------------------+
- 创建placement API 服务端点
[root@linux-node1 ~]# openstack endpoint create --region RegionOne placement public http://192.168.56.11:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | a70af939c7ed4d899da5675ade2b3a33 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 344d25c79f1b412cb0c5958bd8242b2c |
| service_name | placement |
| service_type | placement |
| url | http://192.168.56.11:8778 |
+--------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne placement internal http://192.168.56.11:877
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | cfb1efaae8bd4022b4d0b8aebb286935 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 344d25c79f1b412cb0c5958bd8242b2c |
| service_name | placement |
| service_type | placement |
| url | http://192.168.56.11:8778 |
+--------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne placement admin http://192.168.56.11:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 48718fc25ef344b2a20622d091387f9c |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 344d25c79f1b412cb0c5958bd8242b2c |
| service_name | placement |
| service_type | placement |
| url | http://192.168.56.11:8778 |
+--------------+----------------------------------+
- 验证Nova与placement服务是否创建
[root@linux-node1 ~]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| 06541267fb014c7f9b0be6748366fdba | RegionOne | nova | compute | True | public | http://192.168.56.11:8774/v2.1 |
| 16964c23761c428b909e9a8617d8146e | RegionOne | keystone | identity | True | internal | http://192.168.56.11:5000/v3/ |
| 223775040aaf460da4f275ebbcd01ae1 | RegionOne | glance | image | True | admin | http://192.168.56.11:9292 |
| 36fb4b5b955d471783a982ea455cf58d | RegionOne | keystone | identity | True | public | http://192.168.56.11:5000/v3/ |
| 47e8d9659f70422487cf600405f518bf | RegionOne | glance | image | True | public | http://192.168.56.11:9292 |
| 48718fc25ef344b2a20622d091387f9c | RegionOne | placement | placement | True | admin | http://192.168.56.11:8778 |
| 62766176a40f43bbbb40d4b986b4400e | RegionOne | keystone | identity | True | admin | http://192.168.56.11:35357/v3/ |
| 805cd45ded6841d0acd3335ccfdc29ef | RegionOne | nova | compute | True | admin | http://192.168.56.11:8774/v2.1 |
| 859936e9632642d58517d9ac6a2c3176 | RegionOne | glance | image | True | internal | http://192.168.56.11:9292 |
| a70af939c7ed4d899da5675ade2b3a33 | RegionOne | placement | placement | True | public | http://192.168.56.11:8778 |
| cfb1efaae8bd4022b4d0b8aebb286935 | RegionOne | placement | placement | True | internal | http://192.168.56.11:8778 |
| d9da327e665645fb9766dea107e13bf1 | RegionOne | nova | compute | True | internal | http://192.168.56.11:8774/v2.1 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
- 编辑/etc/nova/nova.conf,并做如下修改
[DEFAULT]
enabled_apis=osapi_compute,metadata
transport_url=rabbit://openstack:openstack@192.168.56.11
my_ip = 192.168.56.11
use_neutron=true
firewall_driver=nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy=keystone
[api_database]
connection=mysql+pymysql://nova:nova@192.168.56.11/nova_api
[database]
connection=mysql+pymysql://nova:nova@192.168.56.11/nova
[glance]
api_servers=192.168.56.11:
[keystone_authtoken] auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.56.11:35357/v3
username = placement
password = placement
[vnc]
enabled=true
vncserver_listen=192.168.56.11
vncserver_proxyclient_address=192.168.56.11
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
- 因为一个packaging bug,必须通过在/etc/httpd/conf.d/00-nova-placement-api.conf添加如下配置来是能placement API的接入:
<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
- 同步nova-api数据库:
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@linux-node1 ~]#
- 登记cell0数据库
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
[root@linux-node1 ~]#
- 创建cell1
[root@linux-node1 ~]# nova-manage cell_v2 list_cells
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| Name | UUID | Transport URL | Database Connection |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| cell0 | ---- | none:/ | mysql+pymysql://nova:****@192.168.56.11/nova_cell0 |
| cell1 | 9f317433-ab20---a9faa94d5825 | rabbit://openstack:****@192.168.56.11 | mysql+pymysql://nova:****@192.168.56.11/nova |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
9f317433-ab20---a9faa94d5825
[root@linux-node1 ~]#
- 同步Nova数据库
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2./site-packages/pymysql/cursors.py:: Warning: (,
u'Duplicate index
`block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is
deprecated and will be disallowed in a future release.')
result = self._query(query)
/usr/lib/python2./site-packages/pymysql/cursors.py:: Warning: (,
u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be
disallowed in a future release.') result = self._query(query)
- 验证Nova cell0 和cell1是否登记正确
[root@linux-node1 ~]# nova-manage cell_v2 list_cells
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| Name | UUID | Transport URL | Database Connection |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| cell0 | ---- | none:/ | mysql+pymysql://nova:****@192.168.56.11/nova_cell0 |
| cell1 | 9f317433-ab20---a9faa94d5825 | rabbit://openstack:****@192.168.56.11 | mysql+pymysql://nova:****@192.168.56.11/nova |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
- 启动Nova服务并设置为开机启动
systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-
api.service to /usr/lib/systemd/system/openstack-nova-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-
consoleauth.service to /usr/lib/systemd/system/openstack-nova-
consoleauth.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-
scheduler.service to /usr/lib/systemd/system/openstack-nova-scheduler.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-
conductor.service to /usr/lib/systemd/system/openstack-nova-conductor.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-
novncproxy.service to /usr/lib/systemd/system/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
在计算节点安装Nova
- 编辑/etc/nova/nova.conf并作出如下修改
[DEFAULT]
use_neutron=true
firewall_driver=nova.virt.firewall.NoopFirewallDriver
enabled_apis=osapi_compute,metadata
transport_url=rabbit://openstack:openstack@192.168.56.11
[api]
auth_strategy=keystone
[glance]
api_servers=192.168.56.11: [keystone_authtoken]
auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[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://192.168.56.11:35357/v3
username = placement
password = placement
[vnc]
enabled=true
vncserver_listen=192.168.56.12
vncserver_proxyclient_address=192.168.56.12
novncproxy_base_url=http://192.168.56.11:6080/vnc_auto.html [libvirt]
# 暂时设置为qemu,生产应为
kvm virt_type = qemu
- 启动Nova服务并设置为开机启动
[root@linux-node2 nova]# systemctl enable libvirtd.service openstack-nova-compute.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-
compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
[root@linux-node2 nova]# systemctl start libvirtd.service openstack-nova-compute.service
- 确认计算节点已经在数据库:
[root@linux-node1 ~]# source admin-openstack.sh
[root@linux-node1 ~]# openstack compute service list --service nova-compute
+----+--------------+-------------------------+------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+--------------+-------------------------+------+---------+-------+----------------------------+
| | nova-compute | linux-node2.example.com | nova | enabled | up | --12T04::19.000000 |
+----+--------------+-------------------------+------+---------+-------+----------------------------+
- 发现计算节点
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found cell mappings.
Skipping cell0 since it does not contain hosts.
Getting compute nodes from cell 'cell1': 9f317433-ab20---a9faa94d5825
Found unmapped computes in cell: 9f317433-ab20---a9faa94d5825
Checking host mapping for compute host 'linux-node2.example.com': a9a6dc8c-41f3-4b44-ac5c-2d8b081bc77e
Creating host mapping for compute host 'linux-node2.example.com': a9a6dc8c-41f3-4b44-ac5c-2d8b081bc77e
至此,Nova服务配置完毕
OpenStack 安装:nova服务的更多相关文章
- OpenStack:安装Nova
>安装Nova1. 安装# apt-get install nova-novncproxy novnc nova-api \ nova-ajax-console-proxy nova-cert ...
- OpenStack核心组件-nova计算服务
1. nova介绍 Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova 来实现的. ...
- openstack部署nova
controller 一.创建nova数据库,并设置权限及远程登录 mysql -u root -p CREATE DATABASE nova_api; CREATE DATABASE nova; C ...
- openstack安装-计算节点-nova计算服务安装
一.基础服务安装 先安装基础工具 yum install net-tools vim telnet wget lrzsz 1.添加hosts解析 cat << EOF >/etc/h ...
- CentOS7安装OpenStack(Rocky版)-04.安装Nova计算服务(控制节点)
上一篇文章分享了glance镜像服务的安装配置,本文主要分享openstack的计算服务Nova的安装和配制方法 ------------------ 完美的分割线 ----------------- ...
- OpenStack Train版-6.安装nova计算服务(计算节点)
安装nova计算服务(computel01计算节点 192.168.0.20)安装软件包 yum install centos-release-openstack-train -y yum insta ...
- OpenStack Train版-5.安装nova计算服务(控制节点)
nova计算服务需要在 控制节点 和 计算节点 都安装 控制节点主要安装 nova-api(nova主服务) nova-scheduler(nova调度服务) nova-conductor(n ...
- OpenStack控制节点上搭建Q版nova服务(step5)
placement组件监听的端口号是:8778 nova组件监听的端口号是:6080.8774.8775 其中6080端口号是novncproxy监听的端口号. 1.安装服务组件 yum instal ...
- OpenStack 安装:neutron服务
在上一篇中介绍了Nova的安装配置,这一篇介绍neutron 首先,创建neutron用户并设置密码为neutron [root@linux-node1 ~]# openstack user crea ...
随机推荐
- 我的代码-cleaning
# coding: utf-8 # In[18]: import pandas as pdimport numpy as npfrom sklearn import treefrom sklearn. ...
- list实现大整数加法
#include<iostream> #include<list> #include<string> using namespace std; list<in ...
- win10企业版2016长期服务版本激活
右键左下角Windows开始图标 ——> 单击 命令提示符(管理员)A 粘贴如下代码到dos窗口: slmgr /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ slm ...
- php 会话控制(关于session的维护与生命周期)
Session是由应用服务器维持的一个服务器端的存储空间,用户在连接服务器时,会由服务器创建生成一个唯一的sessionID,用该sessionID为标识符来存取服务器端的Session存储空间,在会 ...
- zabbix与tomcat(六)
一.zabbix监控远程tomcat的流程 Zabbix-server 找 zabbix Java Gateway获取Java数据 zabbix Java Gateway 找Java程序(zabb ...
- Docker组件与元素(三)
说明: 这篇博文是根据国外的另一篇总结而来,第一个链接为原文,第二个为译文,第三个有几个图挺好 http://blog.flux7.com/blogs/docker ...
- 在 delphiXE 10.2 上安装 FR5.4.6
今天在虚拟机里成功安装了delphiXE 10.2, 然后想把常用的FR也装上,本想偷个懒,在网上找个装上就得了,结果发现必须要在发布的网站注册才能下载⊙︿⊙ 如此麻烦,心里这个不爽啊不爽! 然后自己 ...
- python3.6 内置函数
python内置函数 # encoding: utf-8 # module builtins # from (built-in) # by generator 1.145 ""&q ...
- IIS6.0+win2003部署MVC网站的一些问题
安装iis,framework环境不谈.MVC网站部署 步骤: 1.为程序新建一个应用程序池(将default的那个程序池作为模板就可以了) 2.web服务扩展一些启用一些必要的服务 3.新建网站 描 ...
- 20165312 2017-2018-2 《JAVA程序设计》第6周学习总结
20165312 2017-2018-2 <JAVA程序设计>第6周学习总结 一.在本周学习过程中遇到的问题以及对上周测试的查漏补缺 编写110页代码时出现问题,主类Test中创建CPU对 ...