Cannot retrieve repository metadata (repomd.xml) for repository
Category : HDFS
When you upgrade your hdp cluster through satellite server or local repository and you start your cluster via ambari or add some new services to your cluster then you may see following error.
resource_management.core.exceptions.Fail: Execution of ‘/usr/bin/yum -d 0 -e 0 -y install ambari-metrics-collector’ returned 1. Error: Cannot retrieve repository metadata (repomd.xml) for repository: HDP-2.3.0.0-2557. Please verify its path and try again.
[root@m1 ~]# yum -d 0 -e 0 -y install slider_2_5_3_0_37
Error: Cannot retrieve repository metadata (repomd.xml) for repository: HDP-2.3.0.0-2557. Please verify its path and try again
Root Cause: It is because of two different version repository file in your yum dir.
[root@m1 yum.repos.d]# ll
total 48
-rw-r–r– 1 root root 286 Sep 20 14:01 ambari.repo
-rw-r–r–. 1 root root 1991 Oct 23 2014 CentOS-Base.repo
-rw-r–r–. 1 root root 647 Oct 23 2014 CentOS-Debuginfo.repo
-rw-r–r–. 1 root root 289 Oct 23 2014 CentOS-fasttrack.repo
-rw-r–r–. 1 root root 630 Oct 23 2014 CentOS-Media.repo
-rw-r–r–. 1 root root 5394 Oct 23 2014 CentOS-Vault.repo
-rw-r–r– 1 root root 274 Oct 4 10:16 HDP-2.3.0.0-2557.repo
-rw-r–r– 1 root root 286 Oct 4 03:50 HDP-2.3.0.0.repo
-rw-r–r– 1 root root 234 Feb 1 11:05 HDP-2.5.3.0.repo
-rw-r–r– 1 root root 92 Feb 3 12:29 HDP.repo
-rw-r–r– 1 root root 135 Feb 3 12:29 HDP-UTILS.repo
Resolution:
Step 1: You need to disable your repo file for old version or need to move/delete them from /etc/yum.repo.d dir.
[root@w1 yum.repos.d]# mv HDP-2.3.0.0* /tmp/
[root@w1 yum.repos.d]# ls -ltr
total 40
-rw-r–r–. 1 root root 5394 Oct 23 2014 CentOS-Vault.repo
-rw-r–r–. 1 root root 630 Oct 23 2014 CentOS-Media.repo
-rw-r–r–. 1 root root 289 Oct 23 2014 CentOS-fasttrack.repo
-rw-r–r–. 1 root root 647 Oct 23 2014 CentOS-Debuginfo.repo
-rw-r–r–. 1 root root 1991 Oct 23 2014 CentOS-Base.repo
-rw-r–r– 1 root root 286 Sep 20 14:01 ambari.repo
-rw-r–r– 1 root root 234 Feb 1 11:05 HDP-2.5.3.0.repo
-rw-r–r– 1 root root 92 Feb 3 12:29 HDP.repo
-rw-r–r– 1 root root 135 Feb 3 12:29 HDP-UTILS.repo
Step 2: Now clean all old repo and then update it again with new repo metadata.
[root@w3 yum.repos.d]# yum info all
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirror.vcu.edu
* extras: mirror.cs.uwp.edu
* updates: mirror.nodesdirect.com
HDP-2.5 | 2.9 kB 00:00
HDP-2.5/primary_db | 69 kB 00:00
HDP-2.5.3.0 | 2.9 kB 00:00
HDP-2.5.3.0/primary_db | 69 kB 00:00
HDP-UTILS-1.1.0.21 | 2.9 kB 00:00
HDP-UTILS-1.1.0.21/primary_db | 33 kB 00:00
HDP-UTILS-2.5.3.0 | 2.9 kB 00:00
HDP-UTILS-2.5.3.0/primary_db | 33 kB 00:00
Updates-ambari-2.4.1.0 | 2.9 kB 00:00
Updates-ambari-2.4.1.0/primary_db | 8.3 kB 00:00
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:36
extras | 3.4 kB 00:00
extras/primary_db | 37 kB 00:00
updates | 3.4 kB 00:00
http://mirror.nodesdirect.com/centos/6.8/updates/x86_64/repodata/b02ecfdd926546ba78f0f52d424e06c6a9b7da60cee4b9bf83a54a892b9efd06-primary.sqlite.bz2: [Errno 12] Timeout on http://mirror.nodesdirect.com/centos/6.8/updates/x86_64/repodata/b02ecfdd926546ba78f0f52d424e06c6a9b7da60cee4b9bf83a54a892b9efd06-primary.sqlite.bz2: (28, ‘Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds’)
Trying other mirror.
updates/primary_db | 4.3 MB 00:01
Installed Packages
Name : MAKEDEV
Arch : x86_64
Version : 3.24
Release : 6.el6
Size : 222 k
Repo : installed
From repo : anaconda-CentOS-201410241409.x86_64
Summary : A program used for creating device files in /dev
URL : http://www.lanana.org/docs/device-list/
License : GPLv2
Description : This package contains the MAKEDEV program, which makes it easier to create
: and maintain the files in the /dev directory. /dev directory files
: correspond to a particular device supported by Linux (serial or printer
: ports, scanners, sound cards, tape drives, CD-ROM drives, hard drives,
: etc.) and interface with the drivers in the kernel.
: You should install the MAKEDEV package because the MAKEDEV utility makes
: it easy to manage the /dev directory device files.
Please feel free to give your valuable feedback.