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 ...
随机推荐
- UVa699
这个建树的根选的很有意思,在中间作为树的根.所以二叉树建树的方法虽然一般是有两种数组的方法,一个是如果深度不太大的话,可以之间用2*k+1,2*k建树,如果很大的话,就挨着建树,弄一个结构体,有左右子 ...
- linux基础之LSB定义的常用目录详解
Linux基础之LSB定义的基本目录详解 1.LSB中FHS(Filesystem Hierarchy Standard)定义的一些文件 /boot:主要是存放引导文件的目录,比如内核文件(vmlin ...
- C++学习(四十)(C语言部分)之 学生管理系统设计
涉及到的:指针申请内存 结构体数据结构部分排序文件操作 vs2013数据结构 排序 结构体 指针 功能:1.人工录入信息2.删除3.查找4.修改5.全部显示6.文件的读取和保存7.排序 设计:学生信息 ...
- 统一社会信用代码+组织机构代码 校验 python
转自: https://blog.csdn.net/warrah/article/details/69338912 https://blog.csdn.net/qq_37142340/article/ ...
- 聊聊Java反射
反射是Java最重要的特性.通过Java反射可以在运行时知道一个类的所有成员和方法,知道一个对象的类类型.成员和方法的所有信息,进而调用对象的方法或生成对象的代理或包装类. Java是面向对象语言,除 ...
- Mongo数据库基本操作
从这两个类的继承来看,connection是继承了MongoClient的,建议使用MongoClient而不是使用Connection.(也就是说,MongoClient可以使用方法Connecti ...
- fork exec source的区别
参考:http://www.cnblogs.com/bkygg/p/5023072.html 1:fork 运行的时候开一个sub_shell 执行调用的脚本,sub_shell执行的时候,pare ...
- Linux cp命令详解
Linux cp命令 Linux cp命令主要用于复制文件或目录,将源文件复制至目标文件,或将多个源文件复制至目标目录 用法: cp [选项]... [-T] 源文件 目标文件 cp [选项]... ...
- 11g R2 RAC 虚拟机
虚拟机安装RAC文档 本文档包含内容 一:安装系统 二:各节点配置系统参数 三:虚拟机创建共享存储 四:配置磁盘绑定 五:安装GRID 六:创建ASM DG 七:安装database 八:安装碰到的问 ...
- QThread的一些使用心得
qthread这个类主要用于解决pyqt中多线程的问题,常见用法是将后台代码封装在该类的run()方法中,再对qthread对象执行start()函数来启动线程. 但往往一个业务会有粒度划分,多个粒度 ...