kvm-ovirt-vdsm安装记录

小技巧:

1、fedaro 19自动查找最快yum源

yum install yum-fastestmirror

2、libvirt启动sasl添加用户
saslpasswd2 -c -a libvirt admin

3、查看kvm模块
lsmod|grep kvm

加载模块

modprobe kvm


编译ovirt和vdsm步骤:

Ovirt-engine安装
1、yum install postgresql-server jboss-as yum-plugin-versionlock xmlrpc-client ws-commons-util springframework-tx springframework-jdbc springframework-instrument springframework-expression springframework-context springframework-beans springframework-aop spring-ldap quartz postgresql-jdbc objectweb-asm jakarta-commons-httpclient apache-sshd apache-commons-jxpath apache-commons-configuration apache-commons-compress(可选步骤,供支持yum安装ovirt-engine) 

2、yum install postgresql openssl python-m2crypto m2crypto python-psycopg2 psycopg python-cheetah cheetah libxml2-python libxml2 python-daemon pyflakes python-pep8 pep8 (根据README.developer中安装必须和可选)

3、http://resources.ovirt.org/releases/nightly/rpm/Fedora/19/noarch/ (根据版本选择)下载otopi-1.2.0-master和ovirt-host-deploy-1.2.0-master,并安装。

4、配置数据库/var/lib/pgsql/data/pg_hba.conf修改host all all trust,systemctl restart postgreqsl。(没有配置文件就进行数据库初始化service postgresql initdb)
psql –U postgres –d postgres –h 127.0.0.1
alter user postgres with password ‘postgres’;
/var/lib/pgsql/data/pg_hba.conf修改host all all md5,systemctl restart postgreqsl
su - postgres -c "psql -d template1"
template1=# create user engine password 'engine';
template1=# drop database engine;
template1=# create database engine owner engine template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
普通用户根目录下创建.pgpass,写入*:*:*:engine:engine;

全部是普通用户操作:
5、yum install git, git clone git://gerrit.ovirt.org/ovirt-engine,chmod –R 777 ovirt-engine(修改源代码/ovirt-engine/Makefile中的MAVEN_OPTS 设置-XX:MaxPermSize=1536m或者shell中export MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize1536m)

6、make clean install-dev PREFIX="$HOME/ovirt-engine" (DEV_EXTRA_BUILD_FLAGS_GWT_DEFAULTS="-Dgwt.userAgent=gecko1_8,safari" BUILD_GWT_WEBADMIN="1" BUILD_GWT_USERPORTAL="1" 参考http://www.ovirt.org/DebugFrontend)

7、$HOME/ovirt-engine/bin/engine-setup(--offline,可在sudo下运行,注意修改相关文件可执行权限)


8、$HOME/ovirt-engine/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py start
(可以选择部署成ovirt-engine服务,把$HOME/ovirt-engine/share/ovirt-engine/services/ovirt-engine/systemd相关的拷贝到系统服务目录并配置,通过systemctl命令启动服务)

9、https://localhost:8443
(如果要重新engine-setup需要先执行engine-cleanup)

vdsm安装
1、yum install http://resources.ovirt.org/releases/ovirt-release-fedora-10-2.noarch.rpm
2、yum install make autoconf automake pyflakes logrotate gcc python-pep8 libvirt-python python-devel python-nose rpm-build sanlock-python genisoimage python-ordereddict python-pthreading libselinux-python python-ethtool m2crypto python-dmidecode python-netaddr python-inotify python-argparse git python-cpopen bridge-utils libguestfs-tools-c pyparted openssl
以下操作普通用户模式:
3、git clone http://gerrit.ovirt.org/p/vdsm.git
4、./autogen.sh --system && ./configure  --enable-hooks && make rpm
5、cd ~/rpmbuild/RPMS
yum install --enablerepo=ovirt-beta x86_64/* noarch/vdsm-xml* noarch/vdsm-cli* noarch/vdsm-python-zombiereaper*
6、make; sudo make install(再编译步骤)
7、vdsm-tool configure
8、systemctl start vdsmd


Troubleshooting:

问题1:yum安装ovirt-engine配置数据库时报错。

Failed to execute stage 'Misc configuration': Command '/bin/systemctl' failed to execute
1)查看错误信息,日志记录在/var/log/ovirt-engine/setup/ovirt-engine-setup-xxxxxx.log
DEBUG otopi.plugins.otopi.services.systemd plugin.execute:446 execute-output: 
('/bin/systemctl', 'start', 'postgresql.service') stderr:
Job for postgresql.service failed. See 'systemctl status postgresql.service' 
and 'journalctl -xn' for details.
2)查看postgresql服务状态,systemctl status postgresql.service
DETAIL:Failed system call was shmget(key=5432001,size=43753472,03600).
3)vi /etc/sysctl.conf
kernel.shmmax = 83886080 (必须比size大)
4)sysctl -p 会输出上一步设置
5)engine-setup
 
编译安装ovirt-engine 3.4错误记录
注意:所有操作全部使用普通用户,如果使用root可能会遇到很多问题
问题2:编译遇到缺少otopi和ovirt-host-deploy
解决:http://resources.ovirt.org/releases/nightly/rpm/Fedora/19/noarch/下载rpm包安装,版本均为1.2

问题3:编译遇到Don't declare gwt-dev as a project dependency. This may introduce complex dependency conflicts
解决:忽略掉、、不用管,官方人员是这么解释的

问题4:编译或者部署engine-setup权限报错
解决:修改git下载下来的ovirt-engine文件夹权限,给予可执行权限。

问题5:碰到websocket过不去
解决:http://resources.ovirt.org/releases/nightly/rpm/Fedora/19/noarch/下载ovirt-engine-websocket-proxy.rpm包安装,依赖包同样下载ovirt-engine-setup,ovirt-engine-lib,ovirt-engine-setup-plugin-websocket-proxy,注意时间要为同一天的包。

问题6:数据库配置过不去,create_schema.sh报错,查看log发现密码错误
解决:postgres的密码配置全部为md5不要用trust,普通用户下建.pgpass文本,写入*:*:*:engine:engine。不要用自动配置数据库,改用手动配置,数据库账户密码全部应该为engine。

问题7:找不到用户ovirt和vdsm
解决:创建用户ovirt和vdsm
groupadd ovirt -g 108,useradd ovirt -u 108 -g ovirt
groupadd kvm -g 36,useradd vdsm -u 36 -g kvm

问题8:报错/bin/rpm
解决:部署使用离线模式 engine-setup --offline

问题9:报错/bin/systemctl
解决:缺少服务,将ovirt-engine.systemd和ovirt-engine-notifier.systemd拷贝到/usr/lib/systemd/system目录下,并将systemd改为service;将ovirt-engine.conf和ovirt-engine-notifier.conf按照各自的systemd文档修改名字放到/etc/sysconfig/下,默认用户是ovirt启动服务,要对应python权限。

问题10:部署全部通过却打不开网页
解决:检查并开启jboss-as服务,普通用户执行share/ovirt-engine/services/ovirt-engine/ovirt-engine.py start,修改共享内存查看问题1,默认路径是https://127.0.0.1:8443,路径要输全。

问题11:配置NFS配置不上
解决:nfs服务器建vdsm用户:groupadd kvm -g 36,useradd vdsm -u 36 -g kvm,
     共享文件夹如/images:chmod 0755 /images,chown 36:36 /images,
     安装nfs:yum install nfs-utils,
     配置nfs:vi /etc/exports
     /images *(rw,sync,no_subtree_check,all_squash,anonuid=36,anongid=36),
     开启服务:systemctl start rpcbind,systemctl start nfs,systemctl start nfs-lock
     开机启动:systemctl enable rpcbind,systemctl enable nfs,systemctl enable nfs-lock
     vdsm节点上/rhev目录权限:chown -R 36:36 /rhev

问题12:nfs挂载挂载点权限成nobody
解决:nfsv4版本出现的问题,使用命令mount -t nfs -o vers=3 xxxx
     或者在/etc/bashrc中添加alias mount.nfs='mount -t nfs -o vers=3'

问题13:Not able to add a node to 3.4 Cluster in Ovirt 3.4 engine,vdsm不能连接ovirt-engine
解决:vi /etc/yum.repos.d/fedora-virt-preview.repo
[fedora-virt-preview]
name=Virtualization packages from Rawhide built for latest Fedora
baseurl=http://fedorapeople.org/groups/virt/virt-preview/fedora-$releasever/$basearch
enabled=1
skip_if_unavailable=1
gpgcheck=0

[fedora-virt-preview-debuginfo]
name=Fedora $releasever - $basearch - Debug
name=Virtualization packages from Rawhide built for latest Fedora - Debug
baseurl=http://fedorapeople.org/groups/virt/virt-preview/fedora-$releasever/debuginfo
enabled=0
skip_if_unavailable=1
gpgcheck=0

[fedora-virt-preview-source]
name=Virtualization packages from Rawhide built for latest Fedora - Source
baseurl=http://fedorapeople.org/groups/virt/virt-preview/fedora-$releasever/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0
yum update
查看vdsm支持engine版本:vdsClient -s 0 getVdsCaps|grep cluster
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页