ovirt-engine-4.3源码编译及本地化安装


安装之前关闭防火墙,使用命令: systemctl stop firewalld.service 关闭运行的防火墙。
输入命令: systemctl disable firewalld.service,禁止防火墙服务器。
设置静态IP,并设定可用的DNS。 (重要)

安装开发环境

此操作文档在centos7上成功部署ovirt-engine,其他系统仅供参考,安装环境使用root用户

安装依赖包

本项安装采用root账户。

1. 配置ovirt-engine的yum源

yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release43.rpm -y
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm -y

2. 安装依赖包

yum install git java-devel maven openssl m2crypto python-psycopg2 python-cheetah python-daemon libxml2-python unzip pyflakes python-pep8 python-docker-py mailcap python-jinja2 python-dateutil gdeploy -y

3. 安装WildFly

yum install ovirt-engine-wildfly ovirt-engine-wildfly-overlay

4. 安装ovirt依赖

yum install ovirt-host-deploy ovirt-setup-lib ovirt-js-dependencies

5. 安装数据库 postgresql10

拒绝使用低版本postgresql,因为肯定会有问题。

yum install -y postgresql10 postgresql10-server postgresql10-contrib

配置数据库

本项安装采用root账户。

1. 初始化数据库

 /usr/pgsql-10/bin/postgresql-10-setup initdb

2. 配置PostgreSQL

配置PostgreSQL接受网络连接,编辑配置文件/var/lib/pgsql/10/data/pg_hba.conf,定位到 127.0.0.1/32和 ::1/128,采用如下修改。

# IPv4 local connections:
host    all             all             127.0.0.1/32            password
# IPv6 local connections:
 host    all             all             ::1/128                 password

配置PostgresSQL最大连接数为150,编辑配置文件/var/lib/pgsql/10/data/postgresql.conf,修改max_connections为150。

3. 重启服务,并设置开机启动

systemctl restart postgresql-10
systemctl enable postgresql-10

4. 创建engine数据库

执行下面的命令

 su - postgres -c "psql -d template1 -c \"create user engine password 'engine';\""
 su - postgres -c "psql -d template1 -c \"create database engine owner engine template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';\""
 su - postgres -c "psql -d template1 -c \"CREATE EXTENSION \\\"uuid-ossp\\\";\""
su - postgres -c "psql -d engine"
engine=# CREATE EXTENSION "uuid-ossp";
engine=# \q

编译源码

特别注意:以下步骤都使用普通用户操作 !!!!

1. 下载源码

在$HOME下面新建两个目录,git和ovirt-engine

git: ovirt-engine源码目录
ovirt-engine: engine源码编译输出目录

在git中检出代码,并切换到4.3分支

git clone git://gerrit.ovirt.org/ovirt-engine
cd ovirt-engine
git checkout ovirt-engine-4.3

2. 编译源码

在源码目录中编译,基本命令是

make clean install-dev PREFIX="$HOME/ovirt-engine"

3. 初始化和启动服务

进入输出目录,执行

./bin/engine-setup

setup成功后,我们就可以启动服务了

./share/ovirt-engine/services/ovirt-engine/ovirt-engine.py start

待服务启动成功后,通过以下的地址就可以访问开发环境中搭建起来的ovirt-engine门户了。

http://localhost:8080
https://localhost:8443

ctrl+c可以停止服务。

本地化安装

本项采用root用户。

1. 回到源码目录,设置编译参数

/home/ddd/是本机的普通用户目录,请自行修改为自己的目录地址。

cd /home/ddd/git/ovirt-engine
ulimit -n 10240
sed -i "s/BUILD_LOCALES=0/BUILD_LOCALES=1/g" automation/build-artifacts.sh

2. 开始编译

sudo yum install rpm-build
sudo ./automation/build-artifacts.sh

编译会有很长时间,等待期间可以做一些其他的事情。。。。

3.清除缓存

  1. 更新ovirt-engine-repo源文件:新建repo文件夹,并将编译生成的rpm包拷贝至repo文件夹中,删除不需要的rpm文件。
mkdir /home/ddd/git/ovirt-engine/ovirt-engine-repo

cp /home/ddd/git/ovirt-engine/exported-artifacts/*rpm /home/ddd/git/ovirt-engine/ovirt-engine-repo/

cd /home/ddd/git/ovirt-engine/ovirt-engine-repo/

rm -rf ovirt-engine-*src.rpm

createrepo_c .
  1. 更新yum。
yum clean all
yum makecache

4.安装ovirt-engine rpm包

通过localinstall 安装本地编译出来的ovirt-engine 系列包。

cd /home/ddd/git/ovirt-engine/ovirt-engine-repo/
rpm -ivh python2-ovirt-engine-lib-*rpm
yum localinstall ovirt-engine* -y

5.本地安装

执行离线部署命令。

engine-setup --offline

6.安装错误

1.错误提示yum --disableexcludes=all install -y httpd,并且提示httpd依赖没有安装,使用以下命令安装httpd后,重新安装ovirt-engine。

yum --disableexcludes=all install -y httpd
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值