I would like to set up a local CentOS mirror, as suggested by others
on this list, to cut down on bandwidth usage, etc. I have read a
couple HowTos and it seems pretty straight-forward, but I do have some
questions.
1) How should I change my entries in /etc/yum.repos.d? Specifically,
should I replace CentOS-Base.repo with my own .repo file?
2) Is there a way to configure yum to prefer the local repo, but use
an external mirror if the local is not available?
3) What is the best practice around keeping the local repo updated? A
once-a-day cron job to rsync from an external mirror? If this is the
correct approach, is there a way to rsync from a "mirror list" so that
updates won't fail if a particular mirror happens to be unavailable
when the cron job runs?
Thanks in advance for any guidance you can provide. I want to be sure
I get this right!
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
06-26-2008, 10:09 PM
"Jason Pyeron"
Starting a Local CentOS Mirror
> -----Original Message-----
> From: centos-bounces@centos.org
> [mailto:centos-bounces@centos.org] On Behalf Of Art Age Software
> Sent: Thursday, June 26, 2008 6:03 PM
> To: centos@centos.org
> Subject: [CentOS] Starting a Local CentOS Mirror
>
> Hi all,
>
> I would like to set up a local CentOS mirror, as suggested by
> others on this list, to cut down on bandwidth usage, etc. I
> have read a couple HowTos and it seems pretty
> straight-forward, but I do have some questions.
>
> 1) How should I change my entries in /etc/yum.repos.d?
> Specifically, should I replace CentOS-Base.repo with my own
> .repo file?
I don't like fidling with files that are provided by rpms, so we use a local DNS
override on the mirrors.centos.org, et al
Then we provide yum & up2date with the mirror list to choose from (1 entry our
local mirror)
>
> 2) Is there a way to configure yum to prefer the local repo,
> but use an external mirror if the local is not available?
>
See above and update your returned list based on prefences.
> 3) What is the best practice around keeping the local repo
> updated? A once-a-day cron job to rsync from an external
> mirror?
Every ~17 hours I think we do it. We also use locks to prevent more than one
from running at a time. If it fails it will try again, and delay 2x and try
again, repeat...
> If this is the correct approach, is there a way to
> rsync from a "mirror list" so that updates won't fail if a
> particular mirror happens to be unavailable when the cron job runs?
>
Hmm, don't know, might be a good idea.
> Thanks in advance for any guidance you can provide. I want to
> be sure I get this right!
Will attach our script in reply to this message
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and
notify the sender immediately. Any other use of the email by you
is prohibited.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and
notify the sender immediately. Any other use of the email by you
is prohibited.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
06-27-2008, 12:42 PM
Johnny Hughes
Starting a Local CentOS Mirror
Art Age Software wrote:
Hi all,
I would like to set up a local CentOS mirror, as suggested by others
on this list, to cut down on bandwidth usage, etc. I have read a
couple HowTos and it seems pretty straight-forward, but I do have some
questions.
1) How should I change my entries in /etc/yum.repos.d? Specifically,
should I replace CentOS-Base.repo with my own .repo file?
You probably need to edit your CentOS-Base.repo file. See my suggested
way in the answer to your next question.
2) Is there a way to configure yum to prefer the local repo, but use
an external mirror if the local is not available?
Yes
You can just add one baseurl=<local_path> line to your CentOS-Base.repo
file for each section ([base], [updates], etc.) ... while still leaving
the "mirrorlist=" one enabled. Then install the yum-fastestmirror
plugin ... fastest mirror SHOULD always pick your local mirror, and if
it is not available it should pick the next fastest one listed.
3) What is the best practice around keeping the local repo updated? A
once-a-day cron job to rsync from an external mirror? If this is the
correct approach, is there a way to rsync from a "mirror list" so that
updates won't fail if a particular mirror happens to be unavailable
when the cron job runs?
We do not provide public syncs from our infrastructure except for
"public mirrors" (people who are allowing public access to their
mirrors) ... however, there are about 200 public mirrors, some of which
provide rsync. Here is the list of public mirrors: