CentOS7 minimal ovirt engine 開發(fā)環(huán)境搭建

注:列出軟件包信息yum info 名字

  1. 關(guān)閉firewall 和 selinux

  2. 添加源epel-方法二
    注:添加之前請(qǐng)看Bug 1572434

  3. 添加源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

  4. 添加源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
  1. 安裝包

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ù)
  1. 安裝 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
  2. 初始化
    /usr/pgsql-9.5/bin/postgresql95-setup initdb
  3. 配置
    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
  1. 配置
    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
  1. 重啟
    systemctl restart postgresql-9.5.service
    systemctl enable postgresql-9.5.service
  2. 創(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';\""

  1. 用角色engine登錄數(shù)據(jù)庫(kù)engine

  2. 執(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)建用戶
  1. 查看用戶目錄
    echo $HOME
  2. 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的源碼
  3. 更改pom.xml
    $HOME/git/ovirt-engine/pom.xml
    所有maven-surefire-plugin都要添加configuration
         <artifactId>maven-surefire-plugin</artifactId>
           <configuration>
               <testFailureIgnore>true</testFailureIgnore>
           </configuration>
  1. 構(gòu)建到 $HOME/ovirt-engine
    cd "$HOME/git/ovirt-engine"
    make install-dev PREFIX="$HOME/ovirt-engine"
    注:編譯過(guò)程至少要8G內(nèi)存
  2. 初始化
    $HOME/ovirt-engine/bin/engine-setup
  3. 啟動(dòng)
    $HOME/ovirt-engine/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py start
  • 查看
  1. 導(dǎo)入證書
    下載證書:https://localhost.localdomain/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA
    瀏覽器導(dǎo)入證書
  2. 登錄查看
    https://localhost.localdomain:8443/ovirt-engine/
    編輯打開網(wǎng)址的主機(jī)的hosts
IP localhost.localdomain

IP是運(yùn)行ovirt-enginecentos7ip

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


額外的:


ovirt問(wèn)題合集

引用:

git:ovirt-engine開發(fā)和調(diào)試環(huán)境搭建
官網(wǎng):ovirt-engine開發(fā)和調(diào)試環(huán)境搭建

官網(wǎng):develop

git:developer-guide
官網(wǎng):developer-guide

automation 模塊

git:ide中配置ovirt-engine開發(fā)環(huán)境
官網(wǎng):ide中配置ovirt-engine開發(fā)環(huán)境

debug ovirt in the intellij ide

oVirt Infra Docs

jmx-一種功能上類似于xml的配置

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容