当前位置:   article > 正文

CentOS7.3部署OpenStack-Ocata版本手记(计算节点) - 未完待续_openstack-nova-compute.service holdoff time over,

openstack-nova-compute.service holdoff time over, scheduling restart.

一、环境准备

1. 网络环境

节点名称IP域名
控制节点192.168.159.34node1.example.local
计算节点192.168.159.35node2.example.local

2. NTP服务

NTP服务器:192.168.159.254 admin.example.local
NTP服务器配置可参考:http://blog.csdn.net/shion0305/article/details/55254291

在计算节点上添加crond定时同步NTP服务器

# crontab -e
#每5分钟同步一次NTP服务器
*/5 * * * * /usr/sbin/ntpdate admin.example.local > /dev/null 2>&1
  • 1
  • 2
  • 3

升级该节点所有的rpm包到最新版本

# yum upgrade -y
  • 1

安装OpenStack client

# yum install -y python-openstackclient
  • 1

安装OpenStack selinux,RHEL和CentOS默认开启selinux,这个包可以自动管理openstack服务的安全规则,如果不想安装这个包,则需要手动关闭selinux功能。

# yum install -y openstack-selinux
  • 1
#如果不想安装openstack-selinux,则需要手动关闭selinux
# vim /etc/selinux/config
#..
SELINUX=disabled
#修改完毕后需要重启
  • 1
  • 2
  • 3
  • 4
  • 5

二、配置安装计算节点

1. 安装软件包

# yum install -y openstack-nova-compute
  • 1

2. 编辑配置文件/etc/nova/nova.conf

[DEFAULT]
# ...
#此处需要填写控制节点的设备IP地址
my_ip = 192.168.159.34
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:RABBIT_PASS@192.168.159.34
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

[api]
# ...
auth_strategy = keystone

[keystone_authtoken]
# ...
auth_uri = http://192.168.159.34:5000
auth_url = http://192.168.159.34:35357
memcached_servers = 192.168.159.34:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova

[vnc]
# ...
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://192.168.159.34:6080/vnc_auto.html

[glance]
# ...
api_servers = http://192.168.159.34:9292

[oslo_concurrency]
# ...
lock_path = /var/lib/nova/tmp
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39

3. 检查设备CPU是否支持虚拟化

# egrep -c '(vmx|svm)' /proc/cpuinfo
  • 1

此处输出的数值大于1,说明设备CPU支持虚拟化,若为0,则不支持虚拟化,若要实现计算节点的功能,则CPU必须支持虚拟化。

若CPU不支持虚拟化,且希望成功部署openstack,则需要修改/etc/nova/nova.conf配置文件中的[libvirt]部分,将virt_type修改为qemu

[libvirt]
# ...
virt_type = qemu
  • 1
  • 2
  • 3

4. 启动服务

# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service
  • 1
  • 2

查看openstack-nova-compute.service状态,出现报错:

# systemctl status openstack-nova-compute.service 
● openstack-nova-compute.service - OpenStack Nova Compute Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
   Active: activating (start) since Wed 2017-03-15 21:38:03 CST; 9s ago
 Main PID: 64994 (nova-compute)
   CGroup: /system.slice/openstack-nova-compute.service
           └─64994 /usr/bin/python2 /usr/bin/nova-compute

Mar 15 21:38:03 node2.example.local systemd[1]: openstack-nova-compute.service holdoff time over, scheduling restart.
Mar 15 21:38:03 node2.example.local systemd[1]: Starting OpenStack Nova Compute Server...
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

查看服务日志:

# tail -n 20 /var/log/nova/nova-compute.log
2017-03-15 21:34:41.444 28990 INFO os_vif [-] Loaded VIF plugins: ovs, linux_bridge
2017-03-15 21:34:41.444 28990 WARNING oslo_reports.guru_meditation_report [-] Guru meditation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please us
e SIGUSR2 to generate reports.
2017-03-15 21:34:41.477 28990 WARNING oslo_config.cfg [-] Option "use_neutron" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
2017-03-15 21:34:41.499 28990 INFO nova.virt.driver [req-8bfc5b4c-29f6-4d5a-acb7-bb09c97b0fae - - - - -] Loading compute driver 'libvirt.LibvirtDriver'
2017-03-15 21:34:41.629 28990 WARNING os_brick.initiator.connectors.remotefs [req-8bfc5b4c-29f6-4d5a-acb7-bb09c97b0fae - - - - -] Connection details not present. RemoteFsClient may not initialize properly.
2017-03-15 21:34:57.277 28990 WARNING oslo_config.cfg [req-8bfc5b4c-29f6-4d5a-acb7-bb09c97b0fae - - - - -] Option "force_dhcp_release" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
2017-03-15 21:34:57.299 28990 INFO nova.service [-] Starting compute node (version 15.0.0-1.el7)
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service [-] Error starting thread.
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service Traceback (most recent call last):
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service   File "/usr/lib/python2.7/site-packages/oslo_service/service.py", line 722, in run_service
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service     service.start()
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service   File "/usr/lib/python2.7/site-packages/nova/service.py", line 144, in start
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service     self.manager.init_host()
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1136, in init_host
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service     raise exception.PlacementNotConfigured()
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service PlacementNotConfigured: This compute is not configured to talk to the placement service. Configure the [placement] section of nova.conf and restart the service.
2017-03-15 21:34:57.300 28990 ERROR oslo_service.service 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

查看日志,发现原因为:官方文档中遗漏了nova-placement-api的安装

编辑控制节点

#安装nova_placement-api
# yum install -y nova-placement-api

#创建placement service
# openstack service create --name placement --description "OpenStack Placement" placement
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Placement              |
| enabled     | True                             |
| id          | b6b09a9fc3134a01a408df93f690836c |
| name        | placement                        |
| type        | placement                        |
+-------------+----------------------------------+

#创建该服务的endpoint
# openstack endpoint create --region RegionOne placement public http://192.168.159.34:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | e77c675b997b4edaae80ec25226ccff4 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | b6b09a9fc3134a01a408df93f690836c |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://192.168.159.34:8778       |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne placement admin http://192.168.159.34:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 5c38ab1ea7d34143ba7f2a84371eafc0 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | b6b09a9fc3134a01a408df93f690836c |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://192.168.159.34:8778       |
+--------------+----------------------------------+
# openstack endpoint create --region RegionOne placement internal http://192.168.159.34:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 0c0aaeeabc294f0aa4541a1f7808bea5 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | b6b09a9fc3134a01a408df93f690836c |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://192.168.159.34:8778       |
+--------------+----------------------------------+

#重启httpd服务
# systemctl restart httpd
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61

编辑计算节点

# vim /etc/nova/nova.conf
#...
[placement]
auth_uri = http://192.168.159.34:5000
auth_url = http://192.168.159.34:35357
memcached_servers = 192.168.159.34:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
os_region_name = RegionOne
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

重启服务

# systemctl restart openstack-nova-compute.service 
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/342969
推荐阅读
相关标签
  

闽ICP备14008679号