美文网首页虚拟化技术
CentOS7 minimal ovirt engine 本地开

CentOS7 minimal ovirt engine 本地开

作者: 余带盐 | 来源:发表于2018-06-09 18:01 被阅读33次

    注:本文档的ovirt-engine版本是4.2.3.5,使用用户是coretek

    1. 先决条件

    • 安装操作系统
    1. 安装CentOS-7-x86_64-DVD-1804.iso,选择GNOME
    2. 创建用户coretek
    • 关防火墙
    1. 停止firewall
      systemctl stop firewalld.service
    2. 禁止firewall开机启动:
      systemctl disable firewalld.service
    3. 停止 NetworkManager
      systemctl stop NetworkManager
    4. 禁止NetworkManager
      systemctl disable NetworkManager
      注:关闭NetworkManager 会导致自动网络如无线网失败
    5. 关闭 selinux
      vi /etc/selinux/config
    #SELINUX=enforcing
    SELINUX=disabled
    
    1. 重启
    • 解压包
    1. 创建目录
      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
    • 配置数据库
    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. 创建数据库

    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登录和远程登录
    1. 设置centos用户 postgres的密码为postgres
      passwd postgres
    2. 配置数据库用户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. 配置监听远程登录
      vi /var/lib/pgsql/9.5/data/postgresql.conf
    listen_addresses='*'
    
    1. 重启数据库服务
      systemctl restart postgresql-9.5.service
    2. 登录数据库
    3. 切换数据库
      \c engine
    4. 切换角色
      \c - engine
    5. 执行数据库命令
    DROP FUNCTION IF EXISTS uuid_generate_v1();
    CREATE EXTENSION "uuid-ossp";
    
    • 开始(接下来执行命令使用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. 构建ovirt-engine
      cd "$HOME/git/ovirt-engine"
      make clean install-dev PREFIX="$HOME/ovirt-engine"
    3. 构建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
      下面的步骤在远程桌面中执行
      /idea-IU-181.4668.68/bin/idea.sh
    3. 注册码(网址形式):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. 导入ovirt-engine项目


      image.png
    8. 配置调试


      image.png
      image.png
      image.png

    相关文章

      网友评论

        本文标题:CentOS7 minimal ovirt engine 本地开

        本文链接:https://www.haomeiwen.com/subject/iwnteftx.html