搭建本地base、extra、epel、openstack源,openstack实验的必备环境,这样可以摆脱网络限制,不用苦心积虑的考虑怎么上网了。
需要安装httpd服务
(1)、本地base源,安装第一块光盘[4G]
CentOS-6.5-x86_64-bin-DVD1.iso
mount /dev/cdrom /mnt cp -rf /mnt/Packages/* /data/base umount /mnt
挂载另外一块光盘
(2)、本地extra源,安装第二块光盘[2G]
CentOS-6.5-x86_64-bin-DVD2.iso
mount /dev/cdrom /mnt cp -rf /mnt/Packages/* /data/base createrepo -p -d -o /data/base /data/base umount /mnt
(3)、镜像federa的epel源到本地[27G]
#RPM包地址
http://dl.fedoraproject.org/pub/epel/6/x86_64/
#创建下载目录
mkdir /data/fedora_epel/
#切换到下载目录
cd /data/fedora_epel/
#下载文件
wget -np -nH –cut-dirs=1 -r -c -L –exclude-directories=repodata –accept=rpm,gz,xml http://dl.fedoraproject.org/pub/epel/6/x86_64/ -P /data/fedora_epel/
#创建元数据
createrepo -p -d -o /data/fedora_epel/pub/epel/6/x86_64 /data/fedora_epel/pub/epel/6/x86_64
(4)、镜像federa的openstack源到本地[2G]
#RPM包下载地址
https://repos.fedorapeople.org/repos/openstack/EOL/openstack-icehouse/epel-6/
#创建下载目录
mkdir -p /opt/epel6
#切换到下载目录
cd /opt/epel6
#下载RPM包
wget -np -nH –cut-dirs=1 -r -c -L –exclude-directories=repodata –accept=rpm,gz,xml https://repos.fedorapeople.org/repos/openstack/EOL/openstack-icehouse/epel-6/ -P /opt/epel6
#创建目录
mkdir -p /data/openstack-icehouse/
#移动刚刚下载的软件到该目录
mv /opt/epel6/repos/openstack/EOL/openstack-icehouse/* /data/openstack-icehouse/
#创建元数据
createrepo -p -d -o /data/openstack-icehouse/epel-6 /data/openstack-icehouse/epel-6
#创建元数据,看到下载的软件中有一个epel文件夹
createrepo -p -d -o /data/openstack-icehouse/epel-6/epel/ /data/openstack-icehouse/epel-6/epel/
#创建到httpd服务目录的软连接
ln -s /data/base /var/www/html/base ln -s /data/fedora_epel/pub/epel/6/x86_64 /var/www/html/epel ln -s /data/openstack-icehouse/epel-6 /var/www/html/openstack
#各个软件包的web访问入口
http://192.168.202.7/base/base/ http://192.168.202.7/epel/x86_64/ http://192.168.202.7/openstack/epel-6/ http://192.168.202.7/openstack/epel-6/epel/
#配置Repository文件
rm -rf /etc/yum.repos.d/
vim CentOS-Media.repo
yum clean all
yum makecache
[CentOS-base-yum] name=CentOS base yum Repository baseurl=http://192.168.202.7/base/base/ enabled=1 gpgcheck=0 [CentOS-epel-yum] name=CentOS epel yum Repository baseurl=http://192.168.202.7/epel/x86_64/ enabled=1 gpgcheck=0 [openstack-icehouse] name=OpenStack Icehouse Repository baseurl=http://192.168.202.7/openstack/epel-6/ enabled=1 gpgcheck=0 [openstack-icehouse-epel] name=OpenStack Icehouse epel Repository baseurl=http://192.168.202.7/openstack/epel-6/epel/ enabled=1 gpgcheck=0
时间: 2024-10-05 05:11:33