系统Centos6.4
主机名是:openstack.lisys.cn
IP地址是:192.168.1.195(eth0)
安装必要工具:
yum -y install vim wget make gcc automake yum-utils unzip
想安装openstack必要的源:
rpm-ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
安装openstack组件及依赖包:不要害怕,按照步骤来吧;你看的别的文章肯定没这么快一下安装这么多的包;
yum --enablerepo=epel-testing install openstack-novaopenstack-glance openstack-keystone openstack-quantumopenstack-swift openstack-dashboard openstack-utils memcachedqpid-cpp-server mysql-server avahi
这个这几天用epel-testin会报错说quantum-2013.1找不到,安装的时候把--enablerepo=epel-testing去掉就可以了!
消息服务器是必须的,OpenStack默认采用qpid作为消息服务器,因此此处安装的是qpid。
安全现在
vim /etc/qpidd.conf
auth=yes----->auth=no
:x保存退出;
selinux设置:
vim /etc/selinux/config
SELINUX=permissive 此模式为自由模式;
设置DNS控制:
yum install -y dnsmasq-utils
数据库相关的配置:
开启mysql,并设置开机自启
service mysqld start && chkconfig mysqld on
Starting mysqld: [ OK ]
初始化nova相关数据库
openstack-db --init --service nova
MySQL user:是登陆数据库的密码,即为数据库管理员密码;
初始化glance相关数据库
openstack-db --init --service glance
开启AMQP消息功能:
service qpidd start && chkconfig qpidd on
Starting Qpid AMQP daemon: [ OK ]
开启libvirt功能:
service libvirtd restart ; chkconfig libvirtd on
Stopping libvirtd daemon: [ OK ]
Starting libvirtd daemon: 2013-05-21 17:20:23.433+0000: 23858: info: libvirt version: 0.10.2, package: 18.el6_4.5 (CentOS BuildSystem<http://bugs.centos.org>, 2013-05-16-14:53:18,c6b7.bsys.dev.centos.org)
2013-05-21 17:20:23.433+0000: 23858: warning : virGetHostname:2265: getaddrinfo failed for 'openstack': Name or service not known
[ OK ]
启动glance-api、glance-registry功能:
for svc in api registry ; do service openstack-glance-$svc start;chkconfig openstack-glance-$svc on ;done
Starting openstack-glance-api: [ OK ]
Starting openstack-glance-registry: [ OK ]
dd if=/dev/zero of=/var/lib/nova/nova-volumes.img bs=1M seek=20kcount=0
0+0 records in
0+0 records out
0 bytes (0 B) copied, 1.8741e-05 s, 0.0 kB/s
vgcreate nova-volumes $(losetup --show -f/var/lib/nova/nova-volumes.img)
No physical volume label read from /dev/loop0
Physical volume "/dev/loop0" successfully created
Volume group "nova-volumes" successfully created
以下两点很重要,如果不做会导致创建volume失败!
vim /etc/tgt/targets.conf
include /etc/nova/volumes/*
service tgtd start ; chkconfig tgtd on
Starting SCSI target daemon: [ OK ]
service tgtd start ; chkconfig tgtd on
Starting SCSI target daemon: [ OK ]
openstack-config --set /etc/nova/nova.conf DEFAULT libvirt_typekvm
ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64
重启系统
reboot
重启libvirt
service libvirtd restart
启动nova的所有服务:
for svc in api objectstore compute network volume scheduler cert;do service openstack-nova-$svc start; chkconfig openstack-nova-$svcon; done