Support Questions
Find answers, ask questions, and share your expertise

How to install packages without proxy using yum hdp2.3 to 2.4

New Contributor

Hello,

I have the following Problem: I'd like to install HDP2.4 and followed the instructions. I had to use a local repo (addresses are fine). I have a very strong Proxy.

I solved this for the ambari upgrade by adding "Proxy=_None_" to the ambari.repo

Tried the same with the Hdp-2.4.0.0.repo. If I execute "yum repolist" there is a Connection, but if I try to reinstall the packages with ambari, it can not get the Connection

Output:

stderr: /var/lib/ambari-agent/data/errors-9253.txt
2016-04-25 10:34:52,429 - Package Manager failed to install packages. Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install '--disablerepo=HDP-*' --enablerepo=HDP-2.4.0.0,HDP-UTILS-2.4.0.0 'pig_2_4_*'' returned 1. Error: Cannot retrieve repository metadata (repomd.xml) for repository: HDP-2.4.0.0. Please verify its path and try again
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/install_packages.py", line 376, in install_packages
    skip_repos=[self.REPO_FILE_NAME_PREFIX + "*"] if OSCheck.is_redhat_family() else [])
  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 158, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 121, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 49, 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)
Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install '--disablerepo=HDP-*' --enablerepo=HDP-2.4.0.0,HDP-UTILS-2.4.0.0 'pig_2_4_*'' returned 1. Error: Cannot retrieve repository metadata (repomd.xml) for repository: HDP-2.4.0.0. Please verify its path and try again
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/install_packages.py", line 497, in <module>
    InstallPackages().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/install_packages.py", line 163, in actionexecute
    raise Fail("Failed to distribute repositories/install packages")
resource_management.core.exceptions.Fail: Failed to distribute repositories/install packages

stdout: /var/lib/ambari-agent/data/output-9253.txt
2016-04-25 10:34:51,346 - Will install packages for repository version 2.4.0.0
2016-04-25 10:34:51,347 - Repository['HDP-2.4.0.0'] {'append_to_file': False, 'base_url': 'http://namenode.hadoop.gsv/hdp/centos6/HDP-2.4/HDP/centos6/2.x/updates/2.4.0.0/', 'action': ['create'], 'components': ['HDP', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'HDP-2.4.0.0', 'mirror_list': None}
2016-04-25 10:34:51,355 - File['/etc/yum.repos.d/HDP-2.4.0.0.repo'] {'content': '[HDP-2.4.0.0]\nname=HDP-2.4.0.0\nbaseurl=http://namenode.hadoop.gsv/hdp/centos6/HDP-2.4/HDP/centos6/2.x/updates/2.4.0.0/\n\npath=/\nenabled=1\ngpgcheck=0'}
2016-04-25 10:34:51,355 - Writing File['/etc/yum.repos.d/HDP-2.4.0.0.repo'] because contents don't match
2016-04-25 10:34:51,356 - Repository['HDP-UTILS-2.4.0.0'] {'append_to_file': True, 'base_url': 'http://namenode.hadoop.gsv/hdp/centos6/HDP-UTILS-1.1.0.20/repos/centos6/', 'action': ['create'], 'components': ['HDP-UTILS', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'HDP-2.4.0.0', 'mirror_list': None}
2016-04-25 10:34:51,360 - File['/etc/yum.repos.d/HDP-2.4.0.0.repo'] {'content': '[HDP-2.4.0.0]\nname=HDP-2.4.0.0\nbaseurl=http://namenode.hadoop.gsv/hdp/centos6/HDP-2.4/HDP/centos6/2.x/updates/2.4.0.0/\n\npath=/\nenabled=1\ngpgcheck=0\n[HDP-UTILS-2.4.0.0]\nname=HDP-UTILS-2.4.0.0\nbaseurl=http://namenode.hadoop.gsv/hdp/centos6/HDP-UTILS-1.1.0.20/repos/centos6/\n\npath=/\nenabled=1\ngpgcheck=0'}
2016-04-25 10:34:51,360 - Writing File['/etc/yum.repos.d/HDP-2.4.0.0.repo'] because contents don't match
2016-04-25 10:34:51,390 - Execute[('/usr/bin/yum', 'clean', 'metadata')] {'logoutput': False, 'sudo': True}
2016-04-25 10:34:51,572 - Package['fuse'] {}
2016-04-25 10:34:51,661 - Skipping installation of existing package fuse
2016-04-25 10:34:51,661 - Package['fuse-libs'] {}
2016-04-25 10:34:51,672 - Skipping installation of existing package fuse-libs
2016-04-25 10:34:51,682 - Package['pig_2_4_*'] {'use_repos': ['HDP-2.4.0.0', 'HDP-UTILS-2.4.0.0'], 'skip_repos': ['HDP-*']}
2016-04-25 10:34:51,683 - Installing package pig_2_4_* ('/usr/bin/yum -d 0 -e 0 -y install '--disablerepo=HDP-*' --enablerepo=HDP-2.4.0.0,HDP-UTILS-2.4.0.0 'pig_2_4_*'')
2016-04-25 10:34:52,429 - Package Manager failed to install packages. Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install '--disablerepo=HDP-*' --enablerepo=HDP-2.4.0.0,HDP-UTILS-2.4.0.0 'pig_2_4_*'' returned 1. Error: Cannot retrieve repository metadata (repomd.xml) for repository: HDP-2.4.0.0. Please verify its path and try again
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/install_packages.py", line 376, in install_packages
    skip_repos=[self.REPO_FILE_NAME_PREFIX + "*"] if OSCheck.is_redhat_family() else [])
  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 158, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 121, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 49, 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)
Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install '--disablerepo=HDP-*' --enablerepo=HDP-2.4.0.0,HDP-UTILS-2.4.0.0 'pig_2_4_*'' returned 1. Error: Cannot retrieve repository metadata (repomd.xml) for repository: HDP-2.4.0.0. Please verify its path and try again
2016-04-25 10:34:52,430 - Installation of packages failed. Checking if installation was partially complete
2016-04-25 10:34:52,430 - Old versions: ['2.3.0.0-2557']
2016-04-25 10:34:52,451 - New versions: ['2.3.0.0-2557']
2016-04-25 10:34:52,451 - Deltas: set([])

Any ideas how I can prevent ambari from replacing my nicely needed repofile?

Thanks

4 REPLIES 4

Expert Contributor

Hi @Petra Zimmer,

You can test the repo with wget from your Ambari server node:

wget <HDP-Base-URL>/repodata/repomd.xml
wget <HDP-UTILS-Base-URL>/repodata/repomd.xml

If one of them is wrong, or not accessible then the upgrade will fail.

Cloudera Employee

@Petra Zimmer,

So I better understand your question.

Are you setting the HDP Repo on the host prior to installing with ambari, but Ambari is overwriting it when it deploys packages to that host?

And you're looking for a way to modify how Ambari writes the HDP-<version>.repo template to include your "Proxy=_None_"?

New Contributor

Hey Davide,

thanks for your help. As I mentíoned or tried to do, until I ask Ambari to install it, the wgets are possible, afterwards not, because Ambari replaces my hdp.repo file

Cloudera Employee