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 ...
随机推荐
- 《Linux内核原理与分析》第六周作业
课本:第五章 系统调用的三层机制(下) 中断向量0x80和system_call中断服务程序入口的关系 0x80对应着system_call中断服务程序入口,在start_kernel函数中调用了tr ...
- 学习笔记TF025:自编码器
传统机器学习依赖良好的特征工程.深度学习解决有效特征难人工提取问题.无监督学习,不需要标注数据,学习数据内容组织形式,提取频繁出现特征,逐层抽象,从简单到复杂,从微观到宏观. 稀疏编码(Sparse ...
- jQeury 批量删除
/*批量删除*/ function datadel(){ var ids = new Array(); $("input[name='batch']:checked").each( ...
- day 44 JavaScript
一.javascript简介 JavaScript是前台语言 JavaScript是前台语言,而不是后台语言. JavaScript运行在用户的终端网页上,而不是服务器上,所以我们称为“前台语言”.J ...
- insert 插入
自动关联当前时间: GETDATE():返回当前时间和日期.
- Hbase 与mapreduce结合
Hbase和mapreduce结合 为什么需要用mapreduce去访问hbase的数据? ——加快分析速度和扩展分析能力 Mapreduce访问hbase数据作分析一定是在离线分析的场景下应用 案例 ...
- vue 项目全局修改element-ui的样式
引入了element-ui,但是和我们自己的样式颜色有很大的不同, 修改例子:在src文件下创建 element-var.scss,代码如下 $--color-primary: yellow; /* ...
- kafka consumer防止数据丢失(转)
http://kane-xie.iteye.com/blog/2225085 kafka最初是被LinkedIn设计用来处理log的分布式消息系统,因此它的着眼点不在数据的安全性(log偶尔丢几条无所 ...
- note 2 运算符和表达式
运算符 +.-.*./ %求余Modulus **指数Exponent 表达式 #C = 5/9 (F - 32) print 5.0/9*(75-32) 自动类型转换 类型相同,结果类型不变 1/2 ...
- vi 常用 文本编辑 技巧
归纳常用的Vi/Vim 文本编辑技巧,便于以后查阅. 一.把空格替换为换行 :% s/ /\r/g 二.把空行删除 :g/^$/d 三.vim以16进制打开和编辑文件 先用vim以二进制格式打开需要编 ...