如何搭建搭建各个版本的openstack的本地yum源?


下载要安装的openstack的官方文档(icehouse juno kilo),根据官方文档,下载两个rpm包,例如我想在centos6.5上搭建openstack icehouse,需要两个安装包,epel-release-6.8-noarch.rpm源包,在一个是rdo-release--icehouse-4-src.rpm在window下打开。查看里面的配置配置文件,有foreman.repo puppetlabs.repo rdo-release.repo 找到他们对应的下载地址,还有一个就是epel-release-6.8-noarch.rpm 里面有两个配置文件,打开,epel.repo epel-testing.repo 找到对应的下载版本。     

然后是搭建本地的centos,查询centos版本信息。

具体操作如下:

foreman的配置信息如下:

[foreman]
name=Foreman stable
baseurl=http://yum.theforeman.org/releases/1.5/%FDIST%%RELEASEVER%/x86_64
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman

[foreman-source]
name=Foreman stable - source
baseurl=http://yum.theforeman.org/releases/1.5/%FDIST%%RELEASEVER%/source
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman

[foreman-plugins]
name=Foreman stable - plugins
baseurl=http://yum.theforeman.org/plugins/1.5/%FDIST%%RELEASEVER%/x86_64
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-foreman

[foreman-plugins-source]
name=Foreman stable - plugins source
baseurl=http://yum.theforeman.org/plugins/1.5/%FDIST%%RELEASEVER%/source
enabled=0
gpgcheck=0
gpgkey=

查看有两个baseurl:


http://yum.theforeman.org/releases/1.5/
http://yum.theforeman.org/plugins/1.5/
打开之后找到对应的版本号,el6

下载到本地,执行如下命令:

cd /home/
mkdir foreman
cd foreman 
wget -S -c -r -np -L http://yum.theforeman.org/releases/1.5/el6/
 
wget -S -c -r -np -L http://yum.theforeman.org/plugins/1.5/el6/

puppettlabs.repo 的配置信息如下:

puppetlabs-products]
name=Puppet Labs Products - $basearch
baseurl=http://yum.puppetlabs.com/%DIST%/%RELEASEVER%/products/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1

[puppetlabs-deps]
name=Puppet Labs Dependencies - $basearch
baseurl=http://yum.puppetlabs.com/%DIST%/%RELEASEVER%/dependencies/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1

[puppetlabs-devel]
name=Puppet Labs Devel - $basearch
baseurl=http://yum.puppetlabs.com/%DIST%/%RELEASEVER%/devel/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=0
gpgcheck=1

[puppetlabs-products-source]
name=Puppet Labs Products - $basearch - Source
baseurl=http://yum.puppetlabs.com/%DIST%/%RELEASEVER%/products/SRPMS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
failovermethod=priority
enabled=0
gpgcheck=1

[puppetlabs-deps-source]
name=Puppet Labs Source Dependencies - $basearch - Source
baseurl=http://yum.puppetlabs.com/%DIST%/%RELEASEVER%/dependencies/SRPMS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=0
gpgcheck=1

[puppetlabs-devel-source]
name=Puppet Labs Devel - $basearch - Source
baseurl=http://yum.puppetlabs.com/%DIST%/%RELEASEVER%/devel/SRPMS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=0
gpgcheck=1

查看到baseurl :

http://yum.puppetlabs.com/
之后找到对应的版本号/el/6
下载到本地,执行如下命令:
cd /home/
mkdir puppetlabs
cd puppetlabs 
 wget -S -c -r -np -L http://yum.puppetlabs.com/el/6

rdo-release.repo 的配置信息如下:

[openstack-icehouse]
name=OpenStack Icehouse Repository
baseurl=http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/%DIST%-%RELEASEVER%/
enabled=1
skip_if_unavailable=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Icehouse
priority=98

查看到baseurl为:

http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/

打开之后,找到对应版本,epel6

下载到本地,执行如下命令:

cd /home/
mkdir icehouse 
cd icehouse

wget -S -c -r -np -L http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel6/

epel.repo 的配置信息如下:

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

查看到baserul为:

http://download.fedoraproject.org/pub/epel/6/
打开不用找版本。

下载到本地,执行如下命令:

cd /home
mkdir epel
cd epel
wget -S -c -r -np -L http://download.fedoraproject.org/pub/epel/6/

查看epel-testing.repo的配置信息:

[epel-testing]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-testing-source]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

查看到baseurl为:

http://download.fedoraproject.org/pub/epel/testing/6/
打开不用查看版本。
 
 下载到本地执行如下命令:
 cd /home/
 mkdir epel-testing
 cd epel-testing 
 wget -S -c -r -np -L http://download.fedoraproject.org/pub/epel/testing/6/
 
 搭建本地的centos源,
 执行如下命令:
 
cd /home/
mkdir centos 
cd centos 
wget  -S  -c  -r  -np  -L   wget -S -c -r -np -L http://mirrors.sohu.com/centos/6.6/

 下载完成后执行如下命令,删除不需要的文件,
 
 删除 centos下的/xen4/目录,
 
 在执行如下命令:(删除不需要的文件)
 find ./ -name "index.html*" | xargs rm -rf
 find ./ -name  fedora-20 | xargs rm -rf 
 find ./ -name  fedora-19 | xargs rm -rf 
 find ./ -name  isos | xargs rm -rf 
 find ./ -name  i386 | xargs rm -rf 
 createrepo -p -d -o /home/centos/
 createrepo -p -d -o /home/epel/
 createrepo -p -d -o /home/epel-testing/
 createrepo -p -d -o /home/foreman/
 createrepo -p -d -o /home/puppetlabs 
 createrepo -p -d -o /home/icehouse/

安装apache2服务:

yum install -y httpd 

cd /var/www/html/
mkdir centos epel foreman epel-testing puppetlabs icehouse 
mount --bind  /home/centos /var/www/html/centos
mount --bind /home/epel /var/www/html/epel
mount --bind /home/epel-testing /var/www/html/epel-testing 
mount --bind /home/icehouse /var/www/html/icehouse
mount --bind /home/foreman /var/www/html/foreman 
mount --bind /home/puppetlabs /var/www/html/puppetlabs 

启动httpd服务:service httpd start 
             chkconfig httpd on
客户端配置:
cd  /etc/yum.repos.d/

vim Centos-Base.repo 

[Base]
name=base 
baseurl=
gpgcheck=0
enabled=1
[Update]
name=update 
baseurl=
gpgcheck=0
enabled=1
  
  
vim rdo-release.repo 
[openstack-icehouse]
name=icehouse
baseurl=
gpgcheck=0
enabled=1

vim foreman.repo 
[foreman]
name=foreman
baseurl=
enabled=1
gpgcheck=0

vim puppetlabs.repo
[puppetlabs]
name=puppetlabs
baseurl=
gpgcheck=0
enabled=1

vim epel-testing.repo 
[epel-testing]
name=epel-testing
baseurl=
gpgcheck=0
enabled=1  
 yum clean all
  
 yum makecache
 
 yum update


你可能感兴趣的:(centos,openstack,yum)