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? 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!
> -----Original Message----- > From: centos-bounces at centos.org > [mailto:centos-bounces at centos.org] On Behalf Of Art Age Software > Sent: Thursday, June 26, 2008 6:03 PM > To: centos at 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.
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: http://www.centos.org/modules/tinycontent/index.php?id=13 Thanks, Johnny Hughes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 251 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20080627/52fa26d9/attachment-0001.sig>