[CentOS-mirror] CentOS mirror

Mon Nov 12 18:05:52 UTC 2018
Anssi Johansson <avij at centosproject.org>

The chances for your mirror to be included in the 10 randomly picked 
mirrors is around 10/11 (91%) which does not sound that bad to me. The 
fastestmirror yum plugin should then theoretically be able to pick your 
mirror from that list of 10 mirrors, but if it fails, you will end up 
using some other mirror from Illinois. The fastestmirror plugin is 
suitable for determining if a mirror is in the same country or not, but 
its precision might not be sufficient for determining the absolutely 
fastest mirror if the candidate mirrors are very close to you. Note that 
the fastestmirror plugin does not measure bandwidth, but DNS resolution 
time and the time it takes to establish a TCP connection to each mirror. 
There can be small fluctuations in these measurements.

One way to guarantee your mirror's inclusion in the top 10 (at least at 
this moment) would be to make your mirror available over IPv6, and make 
the mirrorlist.centos.org request from an IPv6-enabled host. 
mirrorlist.centos.org returns only IPv6-capable mirrors if accessed via 
IPv6. There are currently five IPv6-enabled mirrors in Illinois.

Some people have suggested "overriding" mirrorlist.centos.org, but I'm 
not a fan of that approach. That would break if mirrorlist.centos.org 
switched to using https, or if centos.org started using DNSSEC. My own 
approach for my own unpublished private mirror is to drop a .repo file 
like this in /etc/yum.repos.d:

---
[b]
name=CentOS-$releasever - Base
baseurl=http://mirror.example.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[u]
name=CentOS-$releasever - Updates
baseurl=http://mirror.example.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[e]
name=CentOS-$releasever - Extras
baseurl=http://mirror.example.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
---

The trick here is that the default CentOS repositories would also remain 
active. When yum sees that the update is available from both the 
"updates" repository and the "u" repository, yum will download the 
package from the repo whose name is the shortest. This way it is not 
particularly harmful if the local mirror is not up-to-date for some 
reason, the other packages that are not on the local mirror will get 
downloaded from other mirrors instead. Obviously this does not meet the 
"default yum settings" criteria, but this should still be easy enough to 
accomplish using some sort of configuration management tool.


Eric K. Miller kirjoitti 10.11.2018 klo 13.36:
> 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 :)
> 
> 
> 
> _______________________________________________
> CentOS-mirror mailing list
> CentOS-mirror at centos.org
> https://lists.centos.org/mailman/listinfo/centos-mirror
>