Pivotal Knowledge Base

Follow

Ambari Metrics installation on a Pivotal HD cluster fails with the message "No more mirrors to try"

Environment

Product Version
Pivotal HD 3.x
Ambari 2.x

Symptom

When installing Ambari Metrics on a Pivotal HD cluster, the installation may fail on one or multiple hosts:

The error message is shown below:

Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py", line 58, in <module>
AmsMonitor().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 216, in execute
method(env)
File "/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py", line 28, in install
self.install_packages(env, exclude_packages = ['ambari-metrics-collector'])
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 392, in install_packages
Package(name)
File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 154, in __init__
self.env.run()
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 152, in run
self.run_action(resource, action)
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 118, in run_action
provider_action()
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 45, in action_install
self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
shell.checked_call(cmd, sudo=True, logoutput=self.get_logoutput())
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 70, in inner
result = function(command, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 92, in checked_call
tries=tries, try_sleep=try_sleep)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 140, in _call_wrapper
result = _call(command, **kwargs_copy)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 291, in _call
raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install ambari-metrics-monitor' returned 1. Error: failure: repodata/11bcf3233241e37e1a0e04d2fde8a609215059b5b0319fd660f796d462bbe6a8-primary.sqlite.bz2 from base: [Errno 256] No more mirrors to try.

Cause

There is an issue with the yum cache that is likely causing this issue.

Resolution

Follow the steps listed below for every affected host:

1. Log into the affected host as root via SSH.

2. Remove all yum caches and temporary files: 

[root@phd301 ~]# yum clean all
Loaded plugins: fastestmirror, security
Repository PHD-UTILS-1.1.0.20 is listed more than once in the configuration
Cleaning repos: AMBARI-2.1.2.2 PADS PHD-3.0 PHD-3.0.1.0 PHD-UTILS-1.1.0.20 base extras hawq-plugin-phd-1.3.1 updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@phd301 ~]#

3. Repopulate the cache and confirm that there are no errors:

[root@phd301 ~]# yum repolist
Loaded plugins: security
Repository PHD-UTILS-1.1.0.20 is listed more than once in the configuration
AMBARI-2.1.2.2 | 2.9 kB 00:00
AMBARI-2.1.2.2/primary_db | 5.0 kB 00:00
PADS | 951 B 00:00
PADS/primary | 3.7 kB 00:00
PADS 6/6
PHD-3.0 | 2.9 kB 00:00
PHD-3.0/primary_db | 47 kB 00:00
PHD-3.0.1.0 | 2.9 kB 00:00
PHD-3.0.1.0/primary_db | 47 kB 00:00
PHD-UTILS-1.1.0.20 | 2.9 kB 00:00
PHD-UTILS-1.1.0.20/primary_db | 27 kB 00:00
base | 3.7 kB 00:00
base/primary_db | 4.6 MB 00:02
extras | 3.4 kB 00:00
extras/primary_db | 37 kB 00:00
hawq-plugin-phd-1.3.1 | 2.9 kB 00:00
hawq-plugin-phd-1.3.1/primary_db | 1.7 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 5.2 MB 00:01
repo id repo name status
AMBARI-2.1.2.2 AMBARI-2.1.2.2 6
PADS PADS 6
PHD-3.0 PHD-3.0 143
PHD-3.0.1.0 PHD-3.0.1.0 143
PHD-UTILS-1.1.0.20 PHD-UTILS-1.1.0.20 41
base CentOS-6 - Base 6,575
extras CentOS-6 - Extras 62
hawq-plugin-phd-1.3.1 hawq-plugin-phd-1.3.1 1
updates CentOS-6 - Updates 1,607
repolist: 8,584
[root@phd301 ~]# yum repolist

4. If there are errors in steps 2 or 3, they may need to be attempted again.

5. If the steps fail a second time, disable the "fastestmirror" plugin for yum, by opening the file /etc/yum/pluginconf.d/fastestmirror.conf in a text editor:

Replace:

enabled=1

with 

enabled=0

6. Clean the yum files and refresh the cache once again:

yum clean all
yum reposlit

7. Once there are no errors in the above outputs, attempt the installation again by clicking on "Retry" in Ambari.

  

Comments

Powered by Zendesk