本文写于2018年4月20日,安装oVirt版本为4.2.2(2018.3.28发布),原创文章,转载请注明出处
1.安装CentOS 7.4.1708
1.1系统安装
从mirrors.163.com下载系统镜像 http://mirrors.163.com/centos/7.4.1708/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso
设置时区,最小化安装,禁用KDUMP,配置网络连接,最后Begin Installation
设置一下ROOT密码,不需要创建其他用户
装好CentOS后就可以用SSH远程访问管理了,这样复制粘贴命令什么的更方便,初次进入系统还需要做以下设置:
1.2关闭SELinux
这一步不一定是必须的,但是根据先前的经验,先关掉没啥坏处,以免后面遇到啥幺蛾子再去折腾
#vi /etc/selinux/conf
相应内容改为
SELINUX=diabled
1.3关闭系统防火墙
#systemctl disable firewalld
1.4设置hostname
这一步其实应该在安装过程中就做的,当时觉得没啥用就没设置,后来配置host节点的时候发现还必须要通过用Engine所在服务器的FQDN(Fully Qualified Domain Name)来进行设置通信,这里补上手工设置的命令
# hostnamectl set-hostname engine.lian
# hostnamectl //查看当前主机名称和系统信息
Static hostname: engine.lian
Icon name: computer-vm
Chassis: vm
Machine ID: 6342271252c84699a6ad86673d56b290
Boot ID: d1acf719009a47c8916e0d36840df71f
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-693.el7.x86_64
Architecture: x86-64
1.5重启一下系统
#reboot
2.安装oVirt-Engine管理后台
2.1修改yum源
官方的yum源速度不太靠谱,这里使用网易的镜像源
# cd /etc/yum.repo.d
# mkdir bak
# mv *.repo bak/
# curl -o CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
# yum clean all
2.2开始正式安装之前,需要先将ovirt官方的源添加到系统yum源库中
# yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
# yum -y update
update这一步很重要,否则接下来将无法查询到ovirt-engine的包
2.3安装ovirt-engine
# yum install -y ovirt-engine
这一步会安装大量的依赖关系用到的包大约351个,所以需要的时间比较长,特别是最后一个ovirt-engine-*的包需要从官方的源下载,速度比较慢,反正我这边基本上是在100K以内徘徊,耐心等待就行,安装过程大概用了差不多半个小时左右
下载完成后在安装期间遇到错误:
GPG key retrieval failed: [Errno 12] Timeout on https://raw.githubusercontent.com/CentOS-Storage-SIG/centos-release-storage-common/master/RPM-GPG-KEY-CentOS-SIG-Storage: (28, 'Connection timed out after 30001 milliseconds')
这是GPG key校验的时候超时了,设置不做校验即可
# vi /etc/yum.repo.d/ovirt-4.2.repo
# vi /etc/yum.repo.d/ovirt-4.2-dependencies.repo
修改内容中所有的的gpgcheck=0
3.配置ovirt-engine
ovirt-engine安装完成后需要运行首次配置向导
[root@localhost yum.repos.d]# engine-setup
[ INFO ] Stage: Initializing
[ INFO ] Stage: Environment setup
Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf']
Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20180420195341-6bsbdg.log
Version: otopi-1.7.7 (otopi-1.7.7-1.el7.centos)
[ INFO ] Stage: Environmen