32123 发表于 2016-8-9 11:10:18

搭建openstack-icehouse本地yum源

一、搭建centos本地yum

1
2
3
4
5
6
7
#拷贝镜像文件:
CentOS-6.5-x86_64-bin-DVD1.iso
CentOS-6.5-x86_64-bin-DVD2.iso
mount /dev/cdrom /mnt
cp -rf /mnt/Packages/* /data/base
yum install -y createrepo
createrepo -p -d -o /data/base /data/base





二、下载epel源(20G左右磁盘空间)

1
2
3
mkdir /data/epel
wget -b -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/epel/
createrepo -p -d -o /data/epel/pub/epel/6/x86_64/ /data/epel/pub/epel/6/x86_64/





三、下载openstack-icehouse源(1G左右磁盘空间)

1
2
3
4
mkdir /data/openstack-icehouse
wget -b -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 /data/openstack-icehouse/
createrepo -p -d -o /data/openstack-icehouse/repos/openstack/EOL/openstack-icehouse/epel-6/ /data/openstack-icehouse/repos/openstack/EOL/openstack-icehouse/epel-6/
createrepo -p -d -o /data/openstack-icehouse/repos/openstack/EOL/openstack-icehouse/epel-6/epel/ /data/openstack-icehouse/repos/openstack/EOL/openstack-icehouse/epel-6/epel/





四、配置http访问yum源

1
2
3
4
5
6
7
8
9
10
#安装apache服务
yum install -y httpd

#配置项目路径
ln -s /data/base/ /var/www/html/base
ln -s /data/epel/ /var/www/html/epel
ln -s /data/openstack-icehouse/ /var/www/html/openstack-icehouse

#启动httpd服务
service httpd start





五、配置yum配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#备份原有yum配置文件
cd /etc/yum.repos.d/
for i in `ls` do ; mv $i{,.bak};done
#新建本地yum配置文件
vim CentOS-Base.repo

name=CentOS base yum Repository
baseurl=http://1.1.1.221/base/    #1.1.1.221为服务器IP地址
enabled=1
gpgcheck=0

name=CentOS epel yum Repository
baseurl=http://1.1.1.221/epel/pub/epel/6/x86_64/
enabled=1
gpgcheck=0

name=OpenStack Icehouse Repository
baseurl=http://1.1.1.221/openstack-icehouse/repos/openstack/EOL/openstack-icehouse/epel-6/
enabled=1
gpgcheck=0

name=OpenStack Icehouse epel Repository
baseurl=http://1.1.1.221/openstack-icehouse/repos/openstack/EOL/openstack-icehouse/epel-6/epel/
enabled=1
gpgcheck=0


yum clean all
yum makecache
yum repolist






1
2
#拷贝repo文件到http访问目录下,方便其他服务器下载使用
cp /etc/yum.repos.d/CentOS-Base.repo /var/www/html/






页: [1]
查看完整版本: 搭建openstack-icehouse本地yum源