Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Failed to install HDP 2.3 using ambari

avatar
Expert Contributor
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py", line 38, in <module>
    BeforeInstallHook().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 218, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/hook.py", line 34, in hook
    install_packages()
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py", line 87, in install_packages
    Package(packages)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 116, in __new__
    cls(name.pop(0), env, provider, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 157, 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 41, in install_package
    if use_repos or not self._check_existence(name):
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 84, in _check_existence
    return self.yum_check_package_available(name)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 69, in yum_check_package_available
    import yum # Python Yum API is much faster then other check methods. (even then "import rpm")
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 23, in <module>
    import rpm
ImportError: No module named rpm
stdout: /var/lib/ambari-agent/data/output-109.txt
2016-08-09 14:21:07,077 - Directory['/var/lib/ambari-agent/data/tmp/AMBARI-artifacts/'] {'recursive': True}
2016-08-09 14:21:07,079 - File['/var/lib/ambari-agent/data/tmp/AMBARI-artifacts//jce_policy-8.zip'] {'content': DownloadSource('http://Manager:8080/resources//jce_policy-8.zip')}
2016-08-09 14:21:07,079 - Not downloading the file from http://Manager:8080/resources//jce_policy-8.zip, because /var/lib/ambari-agent/data/tmp/jce_policy-8.zip already exists
2016-08-09 14:21:07,080 - Group['hadoop'] {'ignore_failures': False}
2016-08-09 14:21:07,080 - Group['users'] {'ignore_failures': False}
2016-08-09 14:21:07,081 - User['zookeeper'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,082 - User['ams'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,083 - User['ambari-qa'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['users']}
2016-08-09 14:21:07,084 - User['hdfs'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,085 - User['yarn'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,086 - User['mapred'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,087 - File['/var/lib/ambari-agent/data/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2016-08-09 14:21:07,088 - Execute['/var/lib/ambari-agent/data/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2016-08-09 14:21:07,093 - Skipping Execute['/var/lib/ambari-agent/data/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] due to not_if
2016-08-09 14:21:07,094 - Group['hdfs'] {'ignore_failures': False}
2016-08-09 14:21:07,094 - User['hdfs'] {'ignore_failures': False, 'groups': ['hadoop', 'hdfs']}
2016-08-09 14:21:07,095 - Directory['/etc/hadoop'] {'mode': 0755}
2016-08-09 14:21:07,096 - Creating directory Directory['/etc/hadoop']
2016-08-09 14:21:07,158 - Repository['HDP-2.3'] {'base_url': 'http://manager/REDHAT/HDP/HDP/centos6/2.x/updates/2.3.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', 'mirror_list': None}
2016-08-09 14:21:07,170 - File['/etc/yum.repos.d/HDP.repo'] {'content': InlineTemplate(...)}
2016-08-09 14:21:07,171 - Writing File['/etc/yum.repos.d/HDP.repo'] because it doesn't exist
2016-08-09 14:21:07,172 - Repository['HDP-UTILS-1.1.0.20'] {'base_url': 'http://manager/REDHAT/HDP/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-UTILS', 'mirror_list': None}
2016-08-09 14:21:07,176 - File['/etc/yum.repos.d/HDP-UTILS.repo'] {'content': InlineTemplate(...)}
2016-08-09 14:21:07,176 - Writing File['/etc/yum.repos.d/HDP-UTILS.repo'] because contents don't match
2016-08-09 14:21:07,177 - Package['unzip'] {}
1 ACCEPTED SOLUTION

avatar
Expert Contributor

i found the solution , using redhat without register is the problem its limit you to install yum utilities package so i change de OS and install the yum utilities needed by python 2.6 and its work .

View solution in original post

19 REPLIES 19

avatar
Master Mentor

what is the version of Ambari are you using?

avatar
Expert Contributor

Please help me

avatar
Contributor

The error you're getting (ImportError: No module named rpm) is usually due to not having rpm-python installed. See the thread here for instructions on how to check and see if it is installed, and how to force a re-installation if necessary.

avatar
Expert Contributor

i didnt find any answer here please give me a correct answer or ssh command to do this

avatar

Looks like you are missing the rpm-python package. If yum is working you can try re-installing rpm-python with yum. Alternatively, depending on the version of CentOS or RHEL that you are using, you can find the appropriate RPM in the OS archives. For example, CentOS 6 RPMs are here. Ctrl-f and search for rpm-python to find the package.

avatar
Expert Contributor

im using REDHAT 6.8 can you give me from where can i download this package ?

avatar
Master Mentor

@Mourad Chahri can you run the following command

repoquery --requires --resolve ambari-agent | grep rpm-python

and also provide the version of ambari-agent and server you're running

rpm -qa | grep ambari

if you're missing rpm-python module then you can install it using

yum install rpm-python

I am curious though how you have agent running and missing this module?

avatar
Expert Contributor

ok @Artem Ervits i will try tomorrow on the office

avatar
Expert Contributor

when i execute :

repoquery --requires --resolve ambari-agent | grep rpm-python

i have this :

[root@Manager ~]# repoquery --requires --resolve ambari-agent | grep rpm-python Traceback (most recent call last): File "/usr/bin/repoquery", line 34, in <module> import yum ImportError: No module named yum

[root@Manager ~]# rpm -qa | grep ambari ambari-agent-2.1.0-1470.x86_64 ambari-server-2.1.0-1470.x86_64 [root@Manager ~]# yum install rpm-python bash: /usr/bin/yum: /usr/bin/python2.6: bad interpreter: No such file or directory