Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

About Ambari 2.2 restart ambari-agent with python2.7 failed

About Ambari 2.2 restart ambari-agent with python2.7 failed

Rising Star

Hey all

Environment: Centos6.7 Ambari2.2.0 HDP 2.2

I have to configure server default python(/usr/bin/python) point to python2.7 base on business requirement. But after I did that. restard ambari-agent failed.

I tried to modify /usr/lib/python2.6/site-packages/yum/__init__.py python to default(python2.6) then restart, but failed.

Is there any workaround for this purpose?

3 REPLIES 3

Re: About Ambari 2.2 restart ambari-agent with python2.7 failed

@henryon wen Can you paste error logs in detail for ambari

For CentOS 6 and SLES 11: Hortonworks supporst Python 2.6.* (which is what is installed by default). Hortnworks do not support switching to Python 2.7.* on these OSs.

For all other supported OSs (CentOS 7, Ubuntu 12 + 14, Debian 7): Hortonworks support Python 2.7.* (which is what is installed by default). As of Ambari 2.2, there is no longer an issue with 2.7.9 (therefore, you can use 2.7.*).

Re: About Ambari 2.2 restart ambari-agent with python2.7 failed

Rising Star

yes, I know this. but I have to change default python to 2.7 per application requirement. I thought on ambari 2.0.1 it works. but for 2.2.0 doesn't work.

Highlighted

Re: About Ambari 2.2 restart ambari-agent with python2.7 failed

Rising Star

@Sagar Shimpi

below log is starting datanode################

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py", line 167, in <module>
    DataNode().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/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py", line 61, in start
    self.configure(env)
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py", line 55, in configure
    hdfs("datanode")
  File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line 89, in thunk
    return fn(*args, **kwargs)
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py", line 120, in hdfs
    Package(params.lzo_packages)
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 113, in __new__
    cls(name.pop(0), env, provider, **kwargs)
  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 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 104, 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
Don't have an account?
Coming from Hortonworks? Activate your account here