Openstack添加compute node
背景:上一篇文章讲了Openstack Controller node的安装和配置,和控制节点相比,compute node的安装和配置就非常简单了1、准备工作
Compute node的准备工作和Controller node一样,具体参考上一篇《CentOS下搭建openstack集群》的准备工作
这里再补充一点,确保所有机器,包括网关机和所有openstack cluster的/etc/hosts文件相同,并且具有hostname到IP地址的正确映射,比如:
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.32.1smabee
192.168.32.11 bdpe11
192.168.32.9bdpe09
192.168.32.10 bdpe10
192.168.32.12 bdpe12
192.168.32.5bdpe05
192.168.32.6bdpe06
192.168.32.7bdpe07
192.168.32.8bdpe08
192.168.32.21 bdpe01
192.168.32.2bdpe02
192.168.32.3bdpe03
192.168.32.4bdpe04
2、安装openstack-compute包
1)yum install http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
2)yum install -y http://rdo.fedorapeople.org/openstack/openstack-grizzly/rdo-release-grizzly.rpm
最近rdo repo 好像出了点问题,openstack-grizzly放到/openstack/EOL下了
尝试
yum install -y http://rdo.fedorapeople.org/openstack-havana/rdo-release-havana.rpm
3)yum install -y openstack-nova-compute
4)如果/root所在盘空间不够,建立软连接
mv /var/lib/nova /home
cd /var/lib
ln -s /home/nova nova
3、安装ntp时钟同步(controller node也需要)
yum install -y ntp
配置/etc/ntp.conf,添加如下一行,与网关机同步
server 192.168.32.1 iburst
重启ntp,service ntpd restart
查看ntp状态,如果出现如下,说明配置成功
# ntpq -p
remote refid st t when poll reach delay offsetjitter
==============================================================================
*gateway LOCAL(0) 6 u459 1024377 1.547 1.082 0.068
#
4、启动nova-compute
1)把controller node配置好的nova.conf覆盖所有compute node的nova.conf
使用chown nova.nova /etc/nova/nova.conf 使nova.conf的所有权为nova用户所有
# ll /etc/nova/nova.conf
-rw-r----- 1 nova nova 2487 Oct 11 01:45 /etc/nova/nova.conf2)启动nove-compute服务,执行:/etc/init.d/openstack-nova-compute start
3)查看nova服务列表,compute node是否加入成功
# nova-manage service list
Binary Host Zone Status State Updated_At
nova-cert bdpe11 internal enabled :-) 2013-10-14 07:10:15
nova-conductor bdpe11 internal enabled :-) 2013-10-14 07:10:23
nova-network bdpe11 internal enabled :-) 2013-10-14 07:10:18
nova-compute bdpe11 nova enabled :-) 2013-10-14 07:10:21
nova-scheduler bdpe11 internal enabled :-) 2013-10-14 07:10:15
nova-consoleauth bdpe11 internal enabled :-) 2013-10-14 07:10:15
nova-console bdpe11 internal enabled :-) 2013-10-14 07:10:15
nova-compute bdpe10 nova enabled :-) 2013-10-14 07:10:23
nova-compute bdpe09 nova enabled :-) 2013-10-14 07:10:15
如上列表所述,bdpe11作为控制节点和compute node,bdpe10和bdpe09作为compute node,State为 :-) 表示配置成功,在使用中
4、打入openstack的patch
1)把controller node下的 /home/nova.patch拷到compute node
2)打patch
cd /usr/lib/python2.6/site-packages/nova
patch -p1 < /home/nova.patch
3)重启nova-compute服务
cd /etc/init.d
service openstack-nova-compute restart
5、可能遇到问题
openstarck-nova-compute启动失败
1)Connection to libvirt failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
/etc/init.d/libvirtd start 启动失败
查看log error : virNetServerMDNSStart:460 : internal error Failed to create mDNS client: Daemon not running
解决办法:
yum -y install avahi
/etc/init.d/messagebus restart
/etc/init.d/avahi-daemon restart
/etc/init.d/libvirtd restart
/etc/init.d/openstack-nova-compute restart
版权声明:本文为博主原创文章,未经博主允许不得转载。
页:
[1]