搭建内网Yum源
搭建内网yum源
阅读(2,238)
一:因内网服务器 众多,当统一安装一些比较大的rpm的时候全部从外网下载就比较慢,而且还占用了一定的出口流量,因此在内网部署了一台yum服务器,将阿里云的epel源、zabbix、Base等定时镜像到一台单独的内网服务器,然后将其他内网服务器的yum地址全部指向此服务器以加快内网安装rpm包的速度,具体如下:
1.1:以镜像阿里云的zabbix 3.0 rhel7的yum源为例,先安装cobbler命令,然后添加repo源:
[root@aqdl repo_mirror]# cobbler repo add --name=zabbix --mirror=http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/ --arch=x86_64 --breed=yum #添加repo文件
[root@aqdl repo_mirror]# cobbler reposync #执行同步
task started: 2017-02-14_044922_reposync
task started (id=Reposync, time=Tue Feb 14 04:49:22 2017)
hello, reposync
run, reposync, run!
creating: /var/www/cobbler/repo_mirror/zabbix/config.repo
creating: /var/www/cobbler/repo_mirror/zabbix/.origin/zabbix.repo
#其实就是通过命令/usr/bin/reporsync 进行的同步
running: /usr/bin/reposync -l -n -d --config=/var/www/cobbler/repo_mirror/zabbix/.origin/zabbix.repo --repoid=zabbix --download_path=/var/www/cobbler/repo_mirror -a x86_64
received on stdout: Repository zabbix is listed more than once in the configuration
951 B 00:00
15 kB 00:02
229 kB 00:02
329 kB 00:02
712 kB 00:00
611 kB 00:00
597 kB 00:00
11 kB 00:00
240 kB 00:00
611 kB 00:01
1.7 MB 00:02
1.7 MB 00:03
4.8 kB 00:00
4.3 kB 00:00
4.3 kB 00:00
3.5 MB 00:04
received on stderr:
running: createrepo -c cache -s sha /var