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

注:本文檔的ovirt-engine版本是4.2.3.5,使用用戶是coretek

1. 先決條件

  • 安裝操作系統(tǒng)
  1. 安裝CentOS-7-x86_64-DVD-1804.iso,選擇GNOME
  2. 創(chuàng)建用戶coretek
  • 關(guān)防火墻
  1. 停止firewall
    systemctl stop firewalld.service
  2. 禁止firewall開機(jī)啟動:
    systemctl disable firewalld.service
  3. 停止 NetworkManager
    systemctl stop NetworkManager
  4. 禁止NetworkManager
    systemctl disable NetworkManager
    注:關(guān)閉NetworkManager 會導(dǎo)致自動網(wǎng)絡(luò)如無線網(wǎng)失敗
  5. 關(guān)閉 selinux
    vi /etc/selinux/config
#SELINUX=enforcing
SELINUX=disabled
  1. 重啟
  • 解壓包
  1. 創(chuàng)建目錄
    mkdir /opt/setup
    cd /opt/setup
  2. 解壓rpm
    tar xzvf ovirt-engine-4.2.3.5-devel-pkg-201806101842.tar.gz
    注:svn路徑:svn://192.168.0.199/Delta8/trunk/rpms/ovirt-engine-4.2.3.5-devel/ovirt-engine-4.2.3.5-devel-pkg-201806101842.tar.gz
  3. 本地源
    mv ovirt-engine-4.2.3.5-devel.repo /etc/yum.repos.d/
    mkdir /etc/yum.repos.d/bak
    mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/bak/
    yum makecache

2. 安裝

  • 安裝依賴
  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 ovirt-ansible-roles ovirt-engine-metrics ovirt-host-deploy ovirt-js-dependencies ovirt-setup-lib ovirt-engine-wildfly ovirt-engine-wildfly-overlay install postgresql95-server postgresql95-contrib tigervnc-server
  • 配置數(shù)據(jù)庫
  1. 初始化

/usr/pgsql-9.5/bin/postgresql95-setup initdb

  1. 配置

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ù)庫

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';\""

  • 配置數(shù)據(jù)庫允許engine登錄和遠(yuǎn)程登錄
  1. 設(shè)置centos用戶 postgres的密碼為postgres
    passwd postgres
  2. 配置數(shù)據(jù)庫用戶postgres的密碼為postgres
    su postgres
    psql
    ALTER USER postgres WITH PASSWORD 'postgres';
  3. 配置使用密碼登錄
    vi /var/lib/pgsql/9.5/data/pg_hba.conf
local   all             all                                     password
host    all             all             192.168.0.103/24            password
  1. 配置監(jiān)聽遠(yuǎn)程登錄
    vi /var/lib/pgsql/9.5/data/postgresql.conf
listen_addresses='*'
  1. 重啟數(shù)據(jù)庫服務(wù)
    systemctl restart postgresql-9.5.service
  2. 登錄數(shù)據(jù)庫
  3. 切換數(shù)據(jù)庫
    \c engine
  4. 切換角色
    \c - engine
  5. 執(zhí)行數(shù)據(jù)庫命令
DROP FUNCTION IF EXISTS uuid_generate_v1();
CREATE EXTENSION "uuid-ossp";
  • 開始(接下來執(zhí)行命令使用centos用戶coretek
  1. 從gitee上取ovirt-engine源碼
    mkdir -p "$HOME/git"
    cd "$HOME/git"
    git clone https://gitee.com/wangkehao/ovirt-engine.git
    git clone https://gitee.com/wangkehao/ovirt-engine-extension-aaa-jdbc.git
  2. 構(gòu)建ovirt-engine
    cd "$HOME/git/ovirt-engine"
    make clean install-dev PREFIX="$HOME/ovirt-engine"
  3. 構(gòu)建ovirt-engine-extension-aaa-jdbc
    cp /home/coretek/ovirt-engine/share/ovirt-engine/modules/common/org/ovirt/engine/api/ovirt-engine-extensions-api/main/ovirt-engine-extensions-api.jar /home/coretek/git/ovirt-engine-extension-aaa-jdbc/lib
    cd /home/coretek/git/ovirt-engine-extension-aaa-jdbc/
    make clean install
  4. 初始化
    /home/coretek/ovirt-engine/bin/engine-setup
  5. 啟動
    $HOME/ovirt-engine/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py start
  • idea(使用coretek用戶)
  1. 安裝
    mkdir /home/coretek/opt
    cd /home/coretek/opt
    tar xzvf ideaIU-2018.1.2.tar.gz
  2. 啟動
    vncserver
    下面的步驟在遠(yuǎn)程桌面中執(zhí)行
    /idea-IU-181.4668.68/bin/idea.sh
  3. 注冊碼(網(wǎng)址形式):https://www.zengxiaowen.me/idea
    image.png
  4. 下載插件


    image.png
  5. 配置JAVA_HOME


    image.png

    image.png

    image.png
  6. 配置Eclipse Code Formatter
    下載:


    image.png

    image.png

    image.png

    image.png

    配置:


    image.png

    image.png

    image.png
  7. 導(dǎo)入ovirt-engine項目


    image.png
  8. 配置調(diào)試


    image.png

    image.png

    image.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容