日期:2015/9/17 - 2015/9/18 time 13:46
主机:tvm-yum
目的:缓存ovirt相关的rpm包到本地yum源中
操作内容:
一、基础 1、在已有base和eple包的基础上,根据ovirt的repo文件来下载rpm包到本地yum源中。 2、根据安装vdsm时候的log报错的内容来找到对应的rpm包 二、根据repo文件下载rpm包 1、从镜像中找一个url下载,整合成脚本执行 [[email protected] ovirt]# pwd /var/www/html/ovirt [[email protected] ovirt]# cat wget_rpms.sh #!/bin/bash # 2015/9/18 # cache rpms from ovirt to localhost # for: # - ovirt-3.5.repo # - ovirt-3.5-dependencies.repo # from: http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm function update_repo() { d_dest=‘/var/www/html/ovirt/ovirt-3.5/rpm‘ mkdir ${d_dest}/el6/{noarch,x86_64} -p mkdir ${d_dest}/dependencies/{jpackage,gluster,patternfly,others} -p ############################ ovirt-deps ############################### cd ${d_dest}/el6/noarch wget --execute robots=off -nc -nd -r -l1 -A‘*.rpm‘ http://resources.ovirt.org/pub/ovirt-3.5/rpm/el6/noarch/ cd ${d_dest}/el6/x86_64 wget --execute robots=off -nc -nd -r -l1 -A‘*.rpm‘ http://resources.ovirt.org/pub/ovirt-3.5/rpm/el6/x86_64/ ############################ ovirt-deps ############################### ## [jpackage] tmp_jpackage="dom4j,isorelax,jaxen,jdom,msv,msv-xsdlib,relaxngDatatype,servicemix-specs,tomcat5-servlet-2.4-api,ws-jaxme,xalan-j2,xml-commons,xml-commons-jaxp-1.2-apis,xml-commons-resolver11,xom,xpp2,xpp3,antlr3,stringtemplate" list_jpackage=`echo ${tmp_jpackage} |sed ‘s/,/\-\*.rpm,/g‘ |awk ‘{print $0"-*.rpm"}‘` cd ${d_dest}/dependencies/jpackage wget --execute robots=off -nc -nd -r -l1 -A ${list_jpackage} http://mirrors.dotsrc.org/jpackage/6.0/generic/free/RPMS/ ## [gluster] cd ${d_dest}/dependencies/gluster wget --execute robots=off -nc -nd -r -l1 -A‘*.rpm‘ http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-6/x86_64/ wget --execute robots=off -nc -nd -r -l1 -A‘*.rpm‘ http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-6/noarch/ ## [patternfly] cd ${d_dest}/dependencies/patternfly wget --execute robots=off -nc -nd -r -l2 -A‘*.rpm‘ http://copr-be.cloud.fedoraproject.org/results/patternfly/patternfly1/epel-6-x86_64/ ## [others] cd ${d_dest}/dependencies/others wget --execute robots=off -nc -nd -r -l1 -A‘policycoreutils-*.rpm,libnl3-*.rpm,selinux-policy-*.rpm‘ http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/ ############################ createrepo ############################### cd /var/www/html/ovirt/ovirt-3.5/rpm/el6/ /usr/bin/createrepo . cd /var/www/html/ovirt/ovirt-3.5/rpm/dependencies/ /usr/bin/createrepo . exit 0 } ############################ ovirt-3.5.repo ############################### function file_repo() { cat <<‘_EOF‘ >ovirt-3.5.repo [ovirt-3.5] name=Latest oVirt 3.5 Release baseurl=http://mirrors.office.test/ovirt/ovirt-3.5/rpm/el$releasever/ enabled=1 skip_if_unavailable=1 gpgcheck=0 [ovirt-3.5-others] name=others baseurl=http://mirrors.office.test/ovirt/ovirt-3.5/rpm/dependencies/ enabled=1 skip_if_unavailable=1 gpgcheck=0 _EOF } function usage() { echo "$0 file|update" exit 0 } case $1 in file|update) $1_repo ;; *) usage ;; esac 2、下载rpm包 sh wget_rpms.sh update 3、生成repo文件 sh wget_rpms.sh file 三、调整目标主机的repo文件 将上一步生成的文件:ovirt-3.5.repo,拷贝到目标主机的目录中: [[email protected] yum.repos.d]# pwd /etc/yum.repos.d 四、物理节点使用本地yum源来安装vdsm服务 [[email protected] yum.repos.d]# yum clean all && yum makecache [[email protected] yum.repos.d]# yum install vdsm
时间: 2024-10-12 22:55:28