赞
踩
节点名称 | IP | 域名 |
---|---|---|
控制节点 | 192.168.159.34 | node1.example.local |
计算节点 | 192.168.159.35 | node2.example.local |
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
升级该节点所有的rpm包到最新版本
# yum upgrade -y
安装OpenStack client
# yum install -y python-openstackclient
安装OpenStack selinux,RHEL和CentOS默认开启selinux,这个包可以自动管理openstack服务的安全规则,如果不想安装这个包,则需要手动关闭selinux功能。
# yum install -y openstack-selinux
#如果不想安装openstack-selinux,则需要手动关闭selinux
# vim /etc/selinux/config
#..
SELINUX=disabled
#修改完毕后需要重启
# yum install -y openstack-nova-compute
[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
# egrep -c '(vmx|svm)' /proc/cpuinfo
此处输出的数值大于1,说明设备CPU支持虚拟化,若为0,则不支持虚拟化,若要实现计算节点的功能,则CPU必须支持虚拟化。
若CPU不支持虚拟化,且希望成功部署openstack,则需要修改/etc/nova/nova.conf配置文件中的[libvirt]部分,将virt_type修改为qemu
[libvirt]
# ...
virt_type = qemu
# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service
查看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...
查看服务日志:
# 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
查看日志,发现原因为:官方文档中遗漏了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
编辑计算节点
# 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
重启服务
# systemctl restart openstack-nova-compute.service
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。