CentOS7.3部署OpenStack-Ocata版本手记(计算节点)

来源:互联网 发布:infographic制作软件 编辑:程序博客网 时间:2024/06/01 07:43

一、环境准备

1. 网络环境

节点名称 IP 域名 控制节点 192.168.159.34 node1.example.local 计算节点 192.168.159.35 node2.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

升级该节点所有的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#修改完毕后需要重启

二、配置安装计算节点

1. 安装软件包

# yum install -y openstack-nova-compute

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

[DEFAULT]# ...#此处需要填写控制节点的设备IP地址my_ip = 192.168.159.34enabled_apis = osapi_compute,metadatatransport_url = rabbit://openstack:RABBIT_PASS@192.168.159.34use_neutron = Truefirewall_driver = nova.virt.firewall.NoopFirewallDriver[api]# ...auth_strategy = keystone[keystone_authtoken]# ...auth_uri = http://192.168.159.34:5000auth_url = http://192.168.159.34:35357memcached_servers = 192.168.159.34:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = nova[vnc]# ...enabled = Truevncserver_listen = 0.0.0.0vncserver_proxyclient_address = $my_ipnovncproxy_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

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

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

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

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

[libvirt]# ...virt_type = qemu

4. 启动服务

# 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-computeMar 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.log2017-03-15 21:34:41.444 28990 INFO os_vif [-] Loaded VIF plugins: ovs, linux_bridge2017-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 use 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_service2017-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 start2017-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_host2017-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:5000auth_url = http://192.168.159.34:35357memcached_servers = 192.168.159.34:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = novaos_region_name = RegionOne

重启服务

# systemctl restart openstack-nova-compute.service 
1 0
原创粉丝点击