Hi Guys
Apologies in advance for the noise.
I am interested in setting up my OWN mirrorlist like http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infr... where it pulls a few local mirrors, but mine would be statically set with 3 or 4 different location URL's
Basically my plan here is, if the closest mirror I operate cannot be reached, it will try another mirror from a different geographic location
I was wondering if anybody on-list might be able to provide some insight on how I can accomplish this? And use ?release= and &arch= and &repo= ?
Any assistance would be greatly appreciated.
Cheers
D
On 10/06/2019 09:10, Daniel Watson wrote:
Hi Guys
Apologies in advance for the noise.
I am interested in setting up my OWN mirrorlist like http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infr... where it pulls a few local mirrors, but mine would be statically set with 3 or 4 different location URL's
Basically my plan here is, if the closest mirror I operate cannot be reached, it will try another mirror from a different geographic location
I was wondering if anybody on-list might be able to provide some insight on how I can accomplish this? And use ?release= and &arch= and &repo= ?
Any assistance would be greatly appreciated.
Cheers
D
in your centos repo file, add a mirrorlist line pointing to your mirrorlist file. For example:
mirrorlist=http://my-mirrors.example.com/my-centos-mirrors.el7
and then populate my-centos-mirrors.el7 with your chosen list of mirrors:
$ cat my-centos-mirrors.el7
http://my-mirror.example1.com/centos/el7/$basearch/ http://my-mirror.example2.com/centos/el7/$basearch/ http://my-mirror.example3.com/centos/el7/$basearch/
You _may_ also need to remove the baseurl line too, not sure.
You can probably achieve a similar effect without the mirrorlist plugin by simply specifying multiple baseurl's. For example:
baseurl=http://my-mirror.example1.com/centos/el7/$basearch/ http://my-mirror.example2.com/centos/el7/$basearch/ http://my-mirror.example3.com/centos/el7/$basearch/
Hope that helps.
Phil
On Mon, 10 Jun 2019, Daniel Watson wrote:
I am interested in setting up my OWN mirrorlist like http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infr... where it pulls a few local mirrors, but mine would be statically set with 3 or 4 different location URL's
There isn't much magic to the response, it is a list of sources for the specified repository (sample below). You might look at the MirrorBrain project, though likely it is overkill and you can just use trivial server-side code (e.g., PHP or Node.js) for the index that inspects the provided parameters (release, arch, etc.) and responds with the related list of statically defined mirror URLs (perhaps randomized) or a subset if large. The CentOS project provides a subset of their 600+ mirrors, typically 10, and sorted in a preference and geographic order as closely matching the origin of the request as makes sense (sample below from west coast of the us). You might do similar even if your list is short, when the east coast makes the request you send the list with the URLs for east coast servers first but when the west coast requests the list has west coast servers first. If you want the name mirrorlist.centos.org to lead to your mirrorlist provider then you need to arrange for the name to resolve to your servers -- I suggest at least two but perhaps more if you have a good deal of diversity -- or perhaps look into using Spacewalk.
$ curl 'http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infr...' http://mirrors.xtom.com/centos/7.6.1810/os/x86_64/ http://mirror.scalabledns.com/centos/7.6.1810/os/x86_64/ http://sjc.edge.kernel.org/centos/7.6.1810/os/x86_64/ http://linux.mirrors.es.net/centos/7.6.1810/os/x86_64/ http://mirror.hostduplex.com/centos/7.6.1810/os/x86_64/ http://mirrors.ocf.berkeley.edu/centos/7.6.1810/os/x86_64/ http://centos.mirror.ndchost.com/7.6.1810/os/x86_64/ http://repos.lax.quadranet.com/centos/7.6.1810/os/x86_64/ http://repos-lax.psychz.net/centos/7.6.1810/os/x86_64/ http://mirrors.oit.uci.edu/centos/7.6.1810/os/x86_64/
Which is pretty clear, but just in case I'll diagram the dynamic portions using the final result (monospace font):
arch ---------------------------------------v repo ------------------------------------v release ------------------------v http://mirrors.oit.uci.edu/centos/7.6.1810/os/x86_64/
/mark