1

I want to cache RPM packets in my Nexus Repository. In repo file on client side I have two lines, both uncommented:

baseurl=http://nexus-ip/repository/bts-nexus-almalinux-base/$releasever/BaseOS/$basearch/os/
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos

Yum updates goes only to mirrorlist. If I comment mirrorlist, then everything working fine, but if nexus repo unavailable, then servers can't update packets. What I want in the end, that client goes first to baseurl and only if it's unavailable, uses mirrorlist. Is it possible? How can I prioritise baseurl over mirrorlist?

1 Answer 1

0

mirrorlist is just to give you more alternatives to download packages, from doc.

mirrorlist Specifies a URL to a file containing a list of baseurls. This can be used instead of or with the baseurl option. Substitution variables, described below, can be used with this option. As a special hack is the mirrorlist URL contains the word "metalink" then the value of mirrorlist is copied to metalink (if metalink is not set).

So you can put same baseurl in top of the mirrorlist and survive only with mirrorlist incase some packages are not part of baseurl url.

Edit 1:

You can try baseurl and failovermethod=priority combination, add urls based in priority you want in similar sequence.

failovermethod

It can be 'roundrobin' or 'priority'. 'roundrobin' randomly selects a URL from the list of URLs to start and then if it failes to contact the selected server it proceed with another selected similarly. 'priority' starts from the first one listed in baseurl and if it fails to contact the server, it continues sequentially with the next in the list. If not specified, the default is 'priority'.It can be 'roundrobin' or 'priority'. 'roundrobin'

You can give multiple baseurl like below,

baseurl=http://<service_node>/install/centos7.5/x86_64         
        http://<master_node>/install/centos7.5/x86_64
3
  • How to set the priority to use the baseurl, then the mirrorlist? I tried using failovermethod in .repo file, seems not working tho. Commented Feb 6, 2023 at 10:37
  • Updated my answer,
    – asktyagi
    Commented Feb 11, 2023 at 15:58
  • are the baseurl entries space-separated or newline ?I can't tell from looking at the answer.
    – majorgear
    Commented May 15 at 16:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .