[CentOS-mirror] CentOS mirror

David Richardson

david.richardson at utah.edu
Mon Nov 12 03:49:34 UTC 2018


Eric,

There's a couple options.

One is to change the repo files on all of your hosts, but that's annoying 
and doesn't scale well.

There's a second that probably highly unsupported, but it's worked well 
for me for many years. It relies on playing games with DNS.

1) You have to make your clients believe that mirrorlist.centos.org is on
    a webserver you control. I did this by creating a DNS zone for
    mirrorlist.centos.org and having it resolve to one of my webservers.

2) The webserver you point them to needs to reply with something that
    looks like the list returned by the real mirrorlist. I created
    /index.cgi (and added index.cgi to the DirectoryIndex and enabled CGI
    execution for .cgi files). The contents of index.cgi are:

----- BEGIN index.cgi -----
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw (param);

my $baseurl = 'http://mirror.chpc.utah.edu/pub/centos/';

print "Content-type: text/plain\n\n";

print $baseurl, param('release'), '/', param('repo'), '/', param('arch'), 
'/', "\n"
----- END index.cgi -----


This makes every client that uses my DNS server use my CentOS mirror. One 
advantage is that it requires no client configuration. To stop it, I 
remove the DNS override from my name server. To continue, I put the 
override back. One disadvantage is that each client only gets one mirror, 
so if there's something wrong with my mirror, they don't have any others 
to try.

As I said before, probably highly not-recommended, but it seems to have 
worked OK for me.

Thanks,
DR

-- 
David Richardson <david.richardson at utah.edu>
Center for High Performance Computing
University of Utah



On Sat, 10 Nov 2018, Eric K. Miller wrote:

> Ah - makes sense.  I was hoping that our mirror would be selected for
> our own systems every time, since the latency is quite a bit lower than
> other mirrors (1ms to 2ms, but still...  would be nice to pull from our
> own repositories with default yum settings).  Is there anything we can
> do?
>
> Thanks for the quick response!
>
> Eric
>
>
>> -----Original Message-----
>> From: CentOS-mirror [mailto:centos-mirror-bounces at centos.org] On
> Behalf
>> Of Anssi Johansson
>> Sent: Saturday, November 10, 2018 5:33 AM
>> To: centos-mirror at centos.org
>> Subject: Re: [CentOS-mirror] CentOS mirror
>>
>> Yes, the list includes only 10 entries. There are 11 mirrors in
>> Illinois, so there is a smallish chance that sometimes your mirror
>> doesn't get included in the 10 selected mirrors. The mirrors are
> picked
>> randomly, and this process is repeated every 10 minutes or so.
>>
>> Your mirror is not being neglected, ihere was just a bit of bad luck
>> this time :)



More information about the CentOS-mirror mailing list