nova计算节点服务安装

安装配置计算节点

  1. 安装软件包

# yum install openstack-nova-compute -y

2.编辑/etc/nova/nova.conf

[root@compute1 ~]# cd /etc/nova/
[root@compute1 nova]# cp nova.conf nova.conf.bak
[root@compute1 nova]# egrep -v "^#|^$" nova.conf.bak > nova.conf
[root@compute1 nova]# vim nova.conf
添加如下内容

[DEFAULT]
...
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
my_ip = 192.168.23.61
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = 123456
[vnc]
...
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
[glance]
...
api_servers = http://controller:9292
[oslo_concurrency]
...
lock_path = /var/lib/nova/tmp

3.确定计算节点是否支持虚拟化。

# egrep -c '(vmx|svm)' /proc/cpuinfo
如果返回值大于1表示支持虚拟化

如果不支持请更改/etc/nova/nova.conf

[libvirt]
...
virt_type = qemu

4.启动服务

# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service

如果nova-compute服务无法启动,请检查/var/log/nova/nova-compute.log。控制器上的错误消息AMQP服务器:5672无法访问可能表示控制器节点上的防火墙阻止访问端口5672,关闭防火墙和selinux即可。

5.在控制端进行检查

# . admin-openrc

# openstack compute service list
[root@controller ~]#  openstack compute service list
+----+------------------+----------------------+----------+---------+-------+----------------------------+
| ID | Binary           | Host                 | Zone     | Status  | State | Updated At                 |
+----+------------------+----------------------+----------+---------+-------+----------------------------+
|  1 | nova-conductor   | controller.novalocal | internal | enabled | up    | 2017-01-13T01:48:04.000000 |
|  2 | nova-consoleauth | controller.novalocal | internal | enabled | up    | 2017-01-13T01:48:07.000000 |
|  3 | nova-scheduler   | controller.novalocal | internal | enabled | up    | 2017-01-13T01:48:04.000000 |
| 10 | nova-compute     | compute1.novalocal   | nova     | enabled | up    | 2017-01-13T01:48:09.000000 |
+----+------------------+----------------------+----------+---------+-------+----------------------------+
[root@controller ~]# nova service-list
+----+------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host                 | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+----------------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller.novalocal | internal | enabled | up    | 2017-01-13T01:48:24.000000 | -               |
| 2  | nova-consoleauth | controller.novalocal | internal | enabled | up    | 2017-01-13T01:48:17.000000 | -               |
| 3  | nova-scheduler   | controller.novalocal | internal | enabled | up    | 2017-01-13T01:48:24.000000 | -               |
| 10 | nova-compute     | compute1.novalocal   | nova     | enabled | up    | 2017-01-13T01:48:19.000000 | -               |
+----+------------------+----------------------+----------+---------+-------+----------------------------+-----------------+

表示nova服务安装完成