2.nova计算节点
2019-12-18 本文已影响0人
哆啦A梦_ca52
计算服务
[root@node1 ~]# cat /etc/hosts
192.168.200.101 openstack-vip.wyh.net
安装参考网站
https://docs.openstack.org/nova/stein/install/index.html
CentOS安装和配置计算节点
安装软件包:
[root@node1 ~]# yum install openstack-nova-compute -y
编辑/etc/nova/nova.conf文件并完成以下操作:
在此[DEFAULT]部分中,仅启用计算和元数据API:
在该[DEFAULT]部分中,配置RabbitMQ消息队列访问:
[root@node1 ~]# vim /etc/nova/nova.conf
[DEFAULT]
# ...
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack123@openstack-vip.wyh.net
在[api]和[keystone_authtoken]部分中,配置身份服务访问
[api]
auth_strategy = keystone
[keystone_authtoken]
auth_url = http://openstack-vip.wyh.net:5000/v3
memcached_servers = openstack-vip.wyh.net:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = nova
在该[DEFAULT]部分中,配置my_ip选项:
在本[DEFAULT]节中,启用对网络服务的支持:
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
在该[vnc]部分中,启用和配置远程控制台访问:
[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = 192.168.200.103
这个ip地址为本机的ip地址
novncproxy_base_url = http://openstack-vip.wyh.net:6080/vnc_auto.html
在该[glance]部分中,配置图像服务API的位置:
[glance]
api_servers = http://openstack-vip.wyh.net:9292
在该[oslo_concurrency]部分中,配置锁定路径:
在该[placement]部分中,配置Placement API:
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://openstack-vip.wyh.net:5000/v3
username = placement
password = placement
由于[包装错误](https://bugzilla.redhat.com/show_bug.cgi?id=1430540),您必须通过将以下配置添加到来启用对Placement API的访问 `/etc/httpd/conf.d/00-nova-placement-api.conf`:
[root@controller1 ~]# vim /etc/httpd/conf.d/00-placement-api.conf
添加到最后
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
重新启动httpd服务:
确定您的计算节点是否支持虚拟机的硬件加速:
如果此命令返回值,则您的计算节点支持硬件加速,通常不需要其他配置。one or greater
如果此命令返回值zero,则您的计算节点不支持硬件加速,并且您必须配置libvirt为使用QEMU而不是KVM。
启动Compute服务及其相关性,并将其配置为在系统启动时自动启动:
[root@node1 ~]# 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@node1 ~]# systemctl start libvirtd.service openstack-nova-compute.service
获取管理员凭据以启用仅管理员的CLI命令,然后确认数据库中有计算主机:
发现计算主机:
[root@controller1 ~]#su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
[root@controller1 ~]# openstack compute service list --service nova-compute
+----+--------------+------------------+------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+--------------+------------------+------+---------+-------+----------------------------+
| 8 | nova-compute | node1.magedu.net | nova | enabled | up | 2019-12-18T10:28:30.000000 |
添加新的计算节点时,必须在控制器节点上运行以注册这些新的计算节点。另外,您可以在中设置适当的时间间隔 :nova-manage cell_v2 discover_hosts/etc/nova/nova.conf
[root@node1 ~]# vim /etc/nova/nova.conf
9506 discover_hosts_in_cells_interval=60
每隔60秒扫描一次计算节点
[root@node1 ~]# systemctl restart libvirtd.service openstack-nova-compute.service
验证操作
[root@controller1 ~]# nova service-list
+--------------------------------------+------------------+---------------------+----------+---------+-------+----------------------------+-----------------+-------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | Forced down |
+--------------------------------------+------------------+---------------------+----------+---------+-------+----------------------------+-----------------+-------------+
| 690cfdc8-8c32-431a-b64b-4587b137b6df | nova-scheduler | controller1.wyh.net | internal | enabled | up | 2019-12-18T10:40:59.000000 | - | False |
| 59ddd32e-fea4-4496-9266-28bb6d430a89 | nova-consoleauth | controller1.wyh.net | internal | enabled | up | 2019-12-18T10:41:00.000000 | - | False |
| bea85a78-b167-428e-90fb-ed42ffafe95e | nova-conductor | controller1.wyh.net | internal | enabled | up | 2019-12-18T10:40:59.000000 | - | False |
| 23c23569-8af8-4a40-95e3-6444e08c5847 | nova-compute | node1.magedu.net | nova | enabled | up | 2019-12-18T10:41:06.000000 | - | False |
+--------------------------------------+------------------+---------------------+----------+---------+-------+----------------------------+-----------------+--
列出服务组件以验证每个进程是否成功启动和注册:
[root@controller1 ~]# openstack compute service list
+----+------------------+---------------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+------------------+---------------------+----------+---------+-------+----------------------------+
| 1 | nova-scheduler | controller1.wyh.net | internal | enabled | up | 2019-12-18T10:39:39.000000 |
| 3 | nova-consoleauth | controller1.wyh.net | internal | enabled | up | 2019-12-18T10:39:40.000000 |
| 5 | nova-conductor | controller1.wyh.net | internal | enabled | up | 2019-12-18T10:39:39.000000 |
| 8 | nova-compute | node1.magedu.net | nova | enabled | up | 2019-12-18T10:39:46.000000 |
+----+------------------+---------------------+----------+---------+-------+----------------------------+
列出身份服务中的API端点以验证与身份服务的连接性:
[root@controller1 ~]# openstack catalog list
+-----------+-----------+----------------------------------------------------+
| Name | Type | Endpoints |
+-----------+-----------+----------------------------------------------------+
| glance | image | RegionOne |
| | | admin: http://openstack-vip.wyh.net:9292 |
| | | RegionOne |
| | | public: http://openstack-vip.wyh.net:9292 |
| | | RegionOne |
| | | internal: http://openstack-vip.wyh.net:9292 |
| | | |
| nova | compute | RegionOne |
| | | public: http://openstack-vip.wyh.net:8774/v2.1 |
| | | RegionOne |
| | | admin: http://openstack-vip.wyh.net:8774/v2.1 |
| | | RegionOne |
| | | internal: http://openstack-vip.wyh.net:8774/v2.1 |
| | | |
| keystone | identity | RegionOne |
| | | admin: http://openstack-vip.wyh.net:5000/v3 |
| | | RegionOne |
| | | internal: http://openstack-vip.wyh.net:5000/v3 |
| | | RegionOne |
| | | public: http://openstack-vip.wyh.net:5000/v3 |
| | | |
| placement | placement | RegionOne |
| | | public: http://openstack-vip.wyh.net:8778 |
| | | RegionOne |
| | | admin: http://openstack-vip.wyh.net:8778 |
| | | RegionOne |
| | | internal: http://openstack-vip.wyh.net:8778 |
| | | |
+-----------+-----------+----------------------------------------------------+
列出图像服务中的图像以验证与图像服务的连接性:
[root@controller1 ~]# openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| aaea9d72-7913-413d-842a-518cbc0e82ef | cirros | active |
+--------------------------------------+--------+--------+
检查单元格和展示位置API是否正常运行,以及其他必要的前提条件是否到位:
[root@controller1 ~]# nova-status upgrade check
+--------------------------------+
| Upgrade Check Results |
+--------------------------------+
| Check: Cells v2 |
| Result: Success |
| Details: None |
+--------------------------------+
| Check: Placement API |
| Result: Success |
| Details: None |
+--------------------------------+
| Check: Ironic Flavor Migration |
| Result: Success |
| Details: None |
+--------------------------------+
| Check: Request Spec Migration |
| Result: Success |
| Details: None |
+--------------------------------+
| Check: Console Auths |
| Result: Success |
| Details: None |
+--------------------------------+