YUM fastestmirror is not picking up closer mirrors
YUM fastestmirror is not picking up closer mirrors
Any idea on how YUM/fastermirror plugin/mirrorlist determines closest mirror?
I tried to reset using 'yum clean all' several times, but 'yum update' is always pickup up mirrors which are far from my server's location.
Is it determined by server's IP address?
The IP address is 103.113.28.12 .. checked using https://www.iplocation.net/ ... it shows that the IP is located in Indonesia, but yum always pick mirror from japan instead of indonesia.
CB
I tried to reset using 'yum clean all' several times, but 'yum update' is always pickup up mirrors which are far from my server's location.
Is it determined by server's IP address?
The IP address is 103.113.28.12 .. checked using https://www.iplocation.net/ ... it shows that the IP is located in Indonesia, but yum always pick mirror from japan instead of indonesia.
CB
Re: YUM fastestmirror is not picking up closer mirrors
Yes, you should indeed get Indonesian mirrors with that IP address. What does this output:
mirrorlist.centos.org will return 10 mirrors that it thinks are close to you, and fastestmirror will pick the fastest among those. If the mirrorlist.centos.org output points to the wrong country, fastestmirror is usually not able to help.
Code: Select all
curl 'http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7'
Re: YUM fastestmirror is not picking up closer mirrors
It is returning various non-Indonesia mirrors:
curl 'http://mirrorlist.centos.org/?repo=os&a ... &release=7'
http://mirror.as24220.net/pub/centos/7/os/x86_64/
http://centos.mirror.iweb.ca/7/os/x86_64/
http://mirror.centos.org/centos/7/os/x86_64/
http://ftp.hosteurope.de/mirror/centos.org/7/os/x86_64/
http://mirror.steadfast.net/centos/7/os/x86_64/
ftp://mirror.us.oneandone.net/linux/dis ... os/x86_64/
ftp://mirror.vtti.vt.edu/centos/7/os/x86_64/
ftp://mirror.bytemark.co.uk/centos/7/os/x86_64/
http://ftp.jaist.ac.jp/pub/Linux/CentOS/7/os/x86_64/
http://mirror.us.leaseweb.net/centos/7/os/x86_64/
I guess, fastestmirror is failed in my case, so i must manually use baseurl
curl 'http://mirrorlist.centos.org/?repo=os&a ... &release=7'
http://mirror.as24220.net/pub/centos/7/os/x86_64/
http://centos.mirror.iweb.ca/7/os/x86_64/
http://mirror.centos.org/centos/7/os/x86_64/
http://ftp.hosteurope.de/mirror/centos.org/7/os/x86_64/
http://mirror.steadfast.net/centos/7/os/x86_64/
ftp://mirror.us.oneandone.net/linux/dis ... os/x86_64/
ftp://mirror.vtti.vt.edu/centos/7/os/x86_64/
ftp://mirror.bytemark.co.uk/centos/7/os/x86_64/
http://ftp.jaist.ac.jp/pub/Linux/CentOS/7/os/x86_64/
http://mirror.us.leaseweb.net/centos/7/os/x86_64/
I guess, fastestmirror is failed in my case, so i must manually use baseurl
Re: YUM fastestmirror is not picking up closer mirrors
That looks like you are using IPv6. What is your IPv6 address? If you are not sure, run curl ipv6.miuku.net which will return your IPv6 address.
Re: YUM fastestmirror is not picking up closer mirrors
No, i am not using IPv6
curl ipv6.miuku.net
curl: (7) Failed to connect to 2a01:51c0:1000:23:80:69:163:42: Network is unreachable
curl ipv6.miuku.net
curl: (7) Failed to connect to 2a01:51c0:1000:23:80:69:163:42: Network is unreachable
Re: YUM fastestmirror is not picking up closer mirrors
I stand corrected -- the default IPv6 list looks similar, but you get that kind of output also when the country of the IPv4 address is unknown.
All the GeoIP databases I looked at seem to point to Indonesia. Perhaps it is a new IP address assignment to your ISP, and the GeoIP data at CentOS needs to be refreshed. This may take a month or so.
In any case, instead of using baseurl= I would suggest adding &cc=id to the end of your mirrorlist= lines, e.g. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra&cc=id
This will override the GeoIP detection and use the specified country code.
All the GeoIP databases I looked at seem to point to Indonesia. Perhaps it is a new IP address assignment to your ISP, and the GeoIP data at CentOS needs to be refreshed. This may take a month or so.
In any case, instead of using baseurl= I would suggest adding &cc=id to the end of your mirrorlist= lines, e.g. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra&cc=id
This will override the GeoIP detection and use the specified country code.
Re: YUM fastestmirror is not picking up closer mirrors
@avij: your suggestion works perfectly.
sorry for the late report:)
thanks a lot
sorry for the late report:)
thanks a lot
Re: YUM fastestmirror is not picking up closer mirrors
For the record, it's likely that this will now work properly even without that &cc=id at the end of the URL.
Re: YUM fastestmirror is not picking up closer mirrors
By which criteria CentOS choose fastest mirror? For me it always choose mirror with much slower ping response then mirror of my internet provider. Example:
As you can see response time for choosed fastest mirror is much slower the mirror of my ISP. I'm from Macedonia, but it always choose mirrors in Bulgaria.
Code: Select all
yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.uni-ruse.bg
* epel: mirrors.uni-ruse.bg
* extras: mirrors.uni-ruse.bg
* updates: mirrors.uni-ruse.bg
# cat /var/cache/yum/x86_64/7/timedhosts.txt | grep mirrors.uni-ruse.bg
mirrors.uni-ruse.bg 0.0469510555267
cat /var/cache/yum/x86_64/7/timedhosts.txt | grep mirror.onevip.mk
mirror.onevip.mk 0.0777509212494
ping mirrors.uni-ruse.bg
PING mirrors.uni-ruse.bg (91.210.88.42) 56(84) bytes of data.
64 bytes from mirrors.uni-ruse.bg (91.210.88.42): icmp_seq=1 ttl=55 time=14.8 ms
64 bytes from mirrors.uni-ruse.bg (91.210.88.42): icmp_seq=2 ttl=55 time=15.1 ms
64 bytes from mirrors.uni-ruse.bg (91.210.88.42): icmp_seq=3 ttl=55 time=14.6 ms
^C
--- mirrors.uni-ruse.bg ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 14.678/14.870/15.133/0.238 ms
ping mirror.onevip.mk
PING mirror.onevip.mk (146.255.69.2) 56(84) bytes of data.
64 bytes from 146.255.69.2 (146.255.69.2): icmp_seq=1 ttl=58 time=0.751 ms
64 bytes from 146.255.69.2 (146.255.69.2): icmp_seq=2 ttl=58 time=0.748 ms
64 bytes from 146.255.69.2 (146.255.69.2): icmp_seq=3 ttl=58 time=0.734 ms
64 bytes from 146.255.69.2 (146.255.69.2): icmp_seq=4 ttl=58 time=0.725 ms
^C
--- mirror.onevip.mk ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 0.725/0.739/0.751/0.029 ms
Re: YUM fastestmirror is not picking up closer mirrors
As you can see, fastestmirror has determined that it was faster to connect to mirrors.uni-ruse.bg than to mirror.onevip.mk. Fastestmirror does not use ICMP echo requests (pings) to determine the speed, but it measures the time it takes to look up the DNS name and open a TCP connection to the mirror.vladoboss wrote: ↑2018/12/26 22:24:38By which criteria CentOS choose fastest mirror? For me it always choose mirror with much slower ping response then mirror of my internet provider.Code: Select all
... mirrors.uni-ruse.bg 0.0469510555267 mirror.onevip.mk 0.0777509212494
http://miuku.net/tmp/testconnectiontime.py.txt is essentially the code that gets executed when measuring the speed of a mirror.
These are the results for these two mirrors from Finland (I don't have a closer server available):
Code: Select all
$ python testconnectiontime.py.txt mirrors.uni-ruse.bg
mirrors.uni-ruse.bg: 216.744900 ms
$ python testconnectiontime.py.txt mirror.onevip.mk
mirror.onevip.mk: 150.221825 ms
... retrying the tests, cached DNS:
$ python testconnectiontime.py.txt mirrors.uni-ruse.bg
mirrors.uni-ruse.bg: 66.222906 ms
$ python testconnectiontime.py.txt mirror.onevip.mk
mirror.onevip.mk: 68.807840 ms
mirrorlist.centos.org returns a list of 10 nearby mirrors, and the assumption is that the fastestmirror plugin would select one of the nearest mirrors, if not the nearest. As of now, the list looks like this:
Code: Select all
$ curl -4 'http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7&cc=mk'
http://mirror.onevip.mk/centos/7.6.1810/os/x86_64/
http://mirror.t-home.mk/centos/7.6.1810/os/x86_64/
http://centos.uni-sofia.bg/centos/7.6.1810/os/x86_64/
http://centos.telecoms.bg/7.6.1810/os/x86_64/
http://mirrors.neterra.net/centos/7.6.1810/os/x86_64/
http://mirror.host.ag/centos/7.6.1810/os/x86_64/
http://mirrors.uni-ruse.bg/centos/7.6.1810/os/x86_64/
http://mirrors.netix.net/centos/7.6.1810/os/x86_64/
http://ftp.ntua.gr/pub/linux/centos/7.6.1810/os/x86_64/
http://ftp.cc.uoc.gr/mirrors/linux/centos/7.6.1810/os/x86_64/