How to setup a local CentOS repository mirror

来自koorka知识分享
跳转至: 导航搜索

准备所需文件夹和软件

sudo yum -y install createrepo

sudo mkdir -p /opt/data/repositories/centos/7.3.1611

#sudo createrepo /opt/data/repositories/centos/7.3.1611

#sudo ls -lR /opt/data/repositories/centos/7.3.1611

rsync从镜像同步数据

sudo nohup rsync -avz rsync://mirrors.tuna.tsinghua.edu.cn/centos/7.3.1611/ /opt/data/repositories/centos/7.3.1611/ >> /var/log/rsyncrepo.log &

定期同步更新
*  *  *  rsync -avz rsync://mirrors.tuna.tsinghua.edu.cn/centos/7.3.1611/ /opt/data/repositories/centos/7.3.1611/ >> /var/log/rsyncrepo.log
*  *  *  rsync -avz rsync://mirrors.tuna.tsinghua.edu.cn/epel/7Server/x86_64/ /opt/data/repositories/epel/7Server/x86_64/ >> /var/log/rsyncrepo.log

配置nginx服务器

配置客户端