在 CentOS 上使用 Cobbler 同步镜像(repo / distro),通常分为 同步软件仓库(reposync) 和 同步发行版镜像(cobbler sync) 两种情况。下面按常见用法说明。
Cobbler 可以使用 reposync 自动从上游镜像同步 RPM 仓库。
cobbler repo add \
--name=centos7-base \
--mirror=http://mirrors.aliyun.com/centos/7/os/x86_64/ \
--arch=x86_64 \
--breed=yum
cobbler reposync
或只同步某个 repo:
cobbler reposync --only=centos7-base
同步后的仓库默认位于:
/var/www/cobbler/repo_mirror/
mount -o loop CentOS-7-x86_64-DVD.iso /mnt
cobbler import \
--path=/mnt \
--name=centos7 \
--arch=x86_64
Cobbler 会自动:
cobbler sync
crontab -e
示例(每天凌晨同步):
0 2 * * * /usr/bin/cobbler reposync >> /var/log/cobbler/reposync.log 2>&1
curl http://mirrors.aliyun.com/centos/
setsebool -P httpd_can_network_connect on
df -h /var/www/cobbler
/var/www/cobbler/
├── images/
├── ks_mirror/
├── repo_mirror/
└── isolinux/
如果你是指:
可以告诉我你的具体场景,我可以给更针对性的方案。