注:本文档的ovirt-engine版本是4.2.3.5,使用用户是coretek
1. 先决条件
- 安装操作系统
- 安装
CentOS-7-x86_64-DVD-1804.iso
,选择GNOME
- 创建用户
coretek
- 关防火墙
- 停止
firewall
:
systemctl stop firewalld.service
- 禁止
firewall
开机启动:
systemctl disable firewalld.service
- 停止
NetworkManager
:
systemctl stop NetworkManager
- 禁止
NetworkManager
:
systemctl disable NetworkManager
注:关闭NetworkManager 会导致自动网络如无线网失败- 关闭
selinux
vi /etc/selinux/config
#SELINUX=enforcing SELINUX=disabled
- 重启
- 解压包
- 创建目录
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
- 配置数据库
- 初始化
/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
- 创建数据库
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';\""
- 配置数据库允许
engine
登录和远程登录
- 设置centos用户
postgres
的密码为postgres
passwd postgres
- 配置数据库用户
postgres
的密码为postgres
su postgres
psql
ALTER USER postgres WITH PASSWORD 'postgres';
- 配置使用密码登录
vi /var/lib/pgsql/9.5/data/pg_hba.conf
local all all password host all all 192.168.0.103/24 password
- 配置监听远程登录
vi /var/lib/pgsql/9.5/data/postgresql.conf
listen_addresses='*'
- 重启数据库服务
systemctl restart postgresql-9.5.service
- 登录数据库
- 切换数据库
\c engine
- 切换角色
\c - engine
- 执行数据库命令
DROP FUNCTION IF EXISTS uuid_generate_v1(); CREATE EXTENSION "uuid-ossp";
- 开始(接下来执行命令使用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
- 构建
ovirt-engine
cd "$HOME/git/ovirt-engine"
make clean install-dev PREFIX="$HOME/ovirt-engine"
- 构建
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
下面的步骤在远程桌面中执行
/idea-IU-181.4668.68/bin/idea.sh
- 注册码(网址形式):
https://www.zengxiaowen.me/idea
下载插件
配置JAVA_HOME
配置Eclipse Code Formatter
下载:
配置:
导入ovirt-engine项目
配置调试