Why not use yum mirrorlist= instead of baseurl= in CentOS-Base.repo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Currently the default yum configuration references mirror.centos.org. 
When yum looks up the IP address it finds several but it will only try 
one and fail if that server is down or does not have the headers for 
whatever reason.

If yum were to reference a mirrorlist it would skip servers that fail 
and keep trying them all until it finds one that works or exhausts all 
the mirrors.  Centos would host a file on their web server for each 
repository that has a list of mirror baseurls.

I created a test script to generate mirrorlists from the 
mirror.centos.org DNS lookup and changed yum to reference the local 
files that were generated as a mirrorlist= and it worked.  The 
non-synced servers that did not have the correct directories setup were 
skipped and it found servers that did work.

Are there any plans to provide a centos-yumconf rpm that links to a 
mirrorlist on centos.org instead of just using the DNS round-robin of 
mirror.centos.org which will cause yum to fail if it happens to get an 
IP that does not work?  Centos would just need to change the mirrorlist 
file on the main website to change mirrors for clients.  Each mirror 
would need to have a DNS entry of its own but it would make things work 
better for updates when 1 server is not synced properly or has some 
other problem(down, etc).

---- begin gen-centos-mirrorlist.sh script ----
#!/bin/sh
host mirror.centos.org | grep " has address " | cut -f 4 -d " " | \
   sed "s#.*#http://\0/centos/4/updates/i386/#"; > \
   /etc/centos-mirror-updates.list
host mirror.centos.org | grep " has address " | cut -f 4 -d " " | \
   sed "s#.*#http://\0/centos/4/os/i386/#"; > /etc/centos-mirror-base.list
host mirror.centos.org | grep " has address " | cut -f 4 -d " " | \
   sed "s#.*#http://\0/centos/4/addons/i386/#"; > \
   /etc/centos-mirror-addons.list
host mirror.centos.org | grep " has address " | cut -f 4 -d " " | \
   sed "s#.*#http://\0/centos/4/extras/i386/#"; > \
   /etc/centos-mirror-extras.list
host mirror.centos.org | grep " has address " | cut -f 4 -d " " | \
   sed "s#.*#http://\0/centos/4/centosplus/i386/#"; > \
   /etc/centos-mirror-centosplus.list
---- end generation script ----

---- begin changed CentOS-Base.repo yum configuration ----
[base]
name=CentOS-$releasever - Base
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
mirrorlist=file:///etc/centos-mirror-base.list
gpgcheck=1

#released updates
[update]
name=CentOS-$releasever - Updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
mirrorlist=file:///etc/centos-mirror-updates.list
gpgcheck=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
mirrorlist=file:///etc/centos-mirror-addons.list
gpgcheck=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
mirrorlist=file:///etc/centos-mirror-extras.list
gpgcheck=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
mirrorlist=file:///etc/centos-mirror-centosplus.list
gpgcheck=1
enabled=0


NOTE: My hack with using IPs from mirror.centos.org has the flaw in that 
the http servers in the list files are referenced by IP.  If the mirror 
http server is using a Name Virtual Host and centos is not the default 
web site for that IP then it might try pulling the files from the wrong 
configured virtual host on that mirror.  This might make some mirrors 
not work.

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux