注:本文檔的ovirt-engine版本是4.2.3.5,使用用戶是coretek
1. 先決條件
- 安裝操作系統(tǒng)
- 安裝
CentOS-7-x86_64-DVD-1804.iso,選擇GNOME- 創(chuàng)建用戶
coretek
- 關(guān)防火墻
- 停止
firewall:
systemctl stop firewalld.service- 禁止
firewall開機(jī)啟動:
systemctl disable firewalld.service- 停止
NetworkManager:
systemctl stop NetworkManager- 禁止
NetworkManager:
systemctl disable NetworkManager
注:關(guān)閉NetworkManager 會導(dǎo)致自動網(wǎng)絡(luò)如無線網(wǎng)失敗- 關(guān)閉
selinux
vi /etc/selinux/config#SELINUX=enforcing SELINUX=disabled
- 重啟
- 解壓包
- 創(chuàng)建目錄
mkdir /opt/setup
cd /opt/setup- 解壓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- 本地源
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. 安裝
- 安裝依賴
- 安裝
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ù)庫
- 初始化
/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.confautovacuum_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ù)庫
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)程登錄
- 設(shè)置centos用戶
postgres的密碼為postgres
passwd postgres- 配置數(shù)據(jù)庫用戶
postgres的密碼為postgres
su postgres
psql
ALTER USER postgres WITH PASSWORD 'postgres';- 配置使用密碼登錄
vi /var/lib/pgsql/9.5/data/pg_hba.conflocal all all password host all all 192.168.0.103/24 password
- 配置監(jiān)聽遠(yuǎn)程登錄
vi /var/lib/pgsql/9.5/data/postgresql.conflisten_addresses='*'
- 重啟數(shù)據(jù)庫服務(wù)
systemctl restart postgresql-9.5.service- 登錄數(shù)據(jù)庫
- 切換數(shù)據(jù)庫
\c engine- 切換角色
\c - engine- 執(zhí)行數(shù)據(jù)庫命令
DROP FUNCTION IF EXISTS uuid_generate_v1(); CREATE EXTENSION "uuid-ossp";
- 開始(接下來執(zhí)行命令使用centos用戶
coretek)
- 從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- 構(gòu)建
ovirt-engine
cd "$HOME/git/ovirt-engine"
make clean install-dev PREFIX="$HOME/ovirt-engine"- 構(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- 初始化
/home/coretek/ovirt-engine/bin/engine-setup- 啟動
$HOME/ovirt-engine/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py start
- idea(使用coretek用戶)
- 安裝
mkdir /home/coretek/opt
cd /home/coretek/opt
tar xzvf ideaIU-2018.1.2.tar.gz- 啟動
vncserver
下面的步驟在遠(yuǎn)程桌面中執(zhí)行
/idea-IU-181.4668.68/bin/idea.sh- 注冊碼(網(wǎng)址形式):
https://www.zengxiaowen.me/idea
image.png下載插件
image.png配置JAVA_HOME
image.png
image.png
image.png配置Eclipse Code Formatter
下載:
image.png
image.png
image.png
image.png
配置:
image.png
image.png
image.png導(dǎo)入ovirt-engine項目
image.png配置調(diào)試
image.png
image.png
image.png















