注:列出軟件包信息:yum info 名字
添加源epel-方法二
注:添加之前請(qǐng)看Bug 1572434添加源ovirt(自動(dòng),2 3任選一個(gè))
yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
注:這個(gè)源目前是ovirt-release42-4.2.2-6
版本的
注:根據(jù)需求選擇源
image.png添加源ovirt(手動(dòng))
vi /etc/yum.repos.d/ovirt-snapshots.repo
[ovirt-snapshots] name=local baseurl=http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/el$releasever enabled=1 gpgcheck=0 priority=10 [ovirt-snapshots-static] name=local baseurl=http://resources.ovirt.org/pub/ovirt-master-snapshot-static/rpm/el$releasever enabled=1 gpgcheck=0 priority=10
- 安裝包
yum install -y pyflakes exportfs python-cheetah git java-devel java-1.8.0-openjdk-devel mailcap unzip openssl bind-utils python-dateutil m2crypto python-psycopg2 python-jinja2 libxml2-python python-daemon maven ansible python-flake8 python-pep8 python-docker-py python2-isort otopi ant
版本 ansible-2.5.2-1.el7.noarch openssl-1.0.2k-8.el7.x86_64 ant-1.9.2-9.el7.noarch unzip-6.0-16.el7.x86_64 git-1.8.3.1-12.el7_4.x86_64 python-cheetah-2.4.4-5.el7.centos.x86_64 python-dateutil-2.4.2-1.el7.noarch pyflakes-1.3.0-2.el7.noarch python-jinja2-2.7.2-2.el7.noarch python-psycopg2-2.5.1-3.el7.x86_64 python-daemon-1.6-4.el7.noarch python-docker-py-1.10.6-3.el7.noarch m2crypto-0.21.1-17.el7.x86_64 java-1.8.0-openjdk-devel-1.8.0.161-0.b14.el7_4.x86_64 otopi-1.7.7-1.el7.centos.noarch python-pep8-1.5.7-2.el7.noarch #這個(gè)版本很重要 maven-3.0.5-17.el7.noarch python2-isort-4.2.5-8.el7.noarch libxml2-python-2.9.1-6.el7_2.3.x86_64 python-flake8-2.0-5.el7.noarch mailcap-2.1.41-2.el7.noarch bind-utils-9.9.4-51.el7_4.2.x86_64 #這個(gè)版本不知道重不重要,但是改到過(guò)這個(gè)版本
yum install -y ovirt-ansible-roles ovirt-engine-metrics ovirt-host-deploy ovirt-js-dependencies ovirt-setup-lib ovirt-engine-wildfly ovirt-engine-wildfly-overlay
版本 ovirt-engine-metrics-1.1.4.2-1.el7.centos.noarch ovirt-host-deploy-1.7.3-1.el7.centos.noarch ovirt-js-dependencies-1.2.0-3.1.el7.centos.noarch ovirt-ansible-roles-1.1.4-1.el7.centos.noarch ovirt-setup-lib-1.1.4-1.el7.centos.noarch ovirt-engine-wildfly-11.0.0-1.el7.centos.x86_64 ovirt-engine-wildfly-overlay-11.0.1-1.el7.centos.noarch
- 數(shù)據(jù)庫(kù)
- 安裝 postgresql 9.5
yum localinstall https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-3.noarch.rpm
yum -y install postgresql95-server postgresql95-contrib
- 初始化
/usr/pgsql-9.5/bin/postgresql95-setup initdb
- 配置
vi /var/lib/pgsql/9.5/data/pg_hba.conf
# IPv4 local connections: host all all 127.0.0.1/32 password # IPv6 local connections: host all all ::1/128 password
- 配置
vi /var/lib/pgsql/9.5/data/postgresql.conf
autovacuum_vacuum_scale_factor = 0.01 autovacuum_analyze_scale_factor = 0.075 autovacuum_max_workers = 6 max_connections = 150 work_mem = 8MB
- 重啟
systemctl restart postgresql-9.5.service
systemctl enable postgresql-9.5.service
- 創(chuàng)建數(shù)據(jù)庫(kù)
su - postgres -c "psql -d template1 -c \"create user engine with login password 'engine' SUPERUSER;\""
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';\""
執(zhí)行數(shù)據(jù)庫(kù)執(zhí)行
DROP FUNCTION IF EXISTS uuid_generate_v1(); CREATE EXTENSION "uuid-ossp";
- git、構(gòu)建和啟動(dòng)
注:不要在root
下執(zhí)行下面命令,因?yàn)?code>ovirt只能在非root
下進(jìn)行開發(fā),centos7創(chuàng)建用戶
- 查看用戶目錄
echo $HOME
checkout
到$HOME/git/ovirt-engine
mkdir -p "$HOME/git"
cd "$HOME/git"
git clone https://github.com/oVirt/ovirt-engine.git
注:現(xiàn)在版本git
上版本不是4.2.2.6
了,所以就不要clone了,從resource上獲取ovirt-engine
的源碼- 更改
pom.xml
$HOME/git/ovirt-engine/pom.xml
所有maven-surefire-plugin
都要添加configuration
<artifactId>maven-surefire-plugin</artifactId> <configuration> <testFailureIgnore>true</testFailureIgnore> </configuration>
- 構(gòu)建到
$HOME/ovirt-engine
cd "$HOME/git/ovirt-engine"
make install-dev PREFIX="$HOME/ovirt-engine"
注:編譯過(guò)程至少要8G內(nèi)存- 初始化
$HOME/ovirt-engine/bin/engine-setup
- 啟動(dòng)
$HOME/ovirt-engine/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py start
- 查看
- 導(dǎo)入證書
下載證書:https://localhost.localdomain/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA
瀏覽器導(dǎo)入證書- 登錄查看
https://localhost.localdomain:8443/ovirt-engine/
編輯打開網(wǎng)址的主機(jī)的hosts
:IP localhost.localdomain
IP
是運(yùn)行ovirt-engine
的centos7
的ip
image.png
- 編譯出ovirt-engine
su
echo 8192000 > /proc/sys/fs/inotify/max_user_watches
ulimit -n 10240
su coretek
ulimit -n 10240
make dist
rpmbuild -tb ovirt-engine-4.2.3.5.tar.gz
或
rpmbuild -D"ovirt_build_minimal 1" -tb ovirt-engine-4.2.3.5.tar.gz
額外的:
引用:
git:ovirt-engine開發(fā)和調(diào)試環(huán)境搭建
官網(wǎng):ovirt-engine開發(fā)和調(diào)試環(huán)境搭建
git:developer-guide
官網(wǎng):developer-guide
git:ide中配置ovirt-engine開發(fā)環(huán)境
官網(wǎng):ide中配置ovirt-engine開發(fā)環(huán)境