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.

Datanode installation fails with import error

Datanode installation fails with import error

New Contributor

I have a 5 node physical cluster with RH 7.4 installed. All five are configured as data nodes. One of them is ambari server. On that machine, ambari server, ambari agent, name node and data node services are installed. But data node installation via Ambari is failing. This is for HDP 2.6.1.5. The same kind of configuration works fine on my VM cluster with 4 nodes and CentOS 7.4 on each node. Note that Datanode installation on other nodes of the cluster succeeded. Only this one node has a problem.

The site-packages seem to be fine:

{noformat}

[root@hdp11061 site-packages]# pwd /usr/lib/python2.6/site-packages

[root@hdp11061 site-packages]#

[root@hdp11061 site-packages]# ls -la

total 20

drwxr-xr-x 5 root root 169 Oct 19 01:36 .

drwxr-xr-x 3 root root 27 Oct 18 09:34 ..

drwxr-xr-x 4 root root 8192 Oct 19 01:36 ambari_agent

lrwxrwxrwx 1 root root 41 Oct 18 23:42 ambari_commons -> /usr/lib/ambari-server/lib/ambari_commons

lrwxrwxrwx 1 root root 40 Oct 18 23:42 ambari_jinja2 -> /usr/lib/ambari-server/lib/ambari_jinja2

drwxr-xr-x 2 root root 4096 Oct 18 23:48 ambari_server

lrwxrwxrwx 1 root root 44 Oct 18 23:42 ambari_simplejson -> /usr/lib/ambari-server/lib/ambari_simplejson

lrwxrwxrwx 1 root root 46 Oct 18 23:48 resource_management -> /usr/lib/ambari-server/lib/resource_management

drwxr-xr-x 3 1005 hadoop 20 Oct 18 23:13 resource_monitoring

[root@hdp11061 site-packages]# ls resource_management/core/

base.py environment.pyc exceptions.pyo global_lock.pyo logger.py resources signal_utils.py source.pyc sudo.pyo utils.py base.pyc environment.pyo files __init__.py logger.pyc shell.py signal_utils.pyc source.pyo system.py utils.pyc base.pyo exceptions.py global_lock.py __init__.pyc logger.pyo shell.pyc signal_utils.pyo sudo.py system.pyc utils.pyo environment.py exceptions.pyc global_lock.pyc __init__.pyo providers shell.pyo source.py sudo.pyc system.pyo

{noformat}

As we can see above, the shell.py file exists. So not sure why the import is failing. And I haven't changed the code in datanode.py at all.

This is the error that Ambari shows:

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py", line 24, in <module>
    from resource_management import Script, Fail, shell, Logger
ImportError: cannot import name shell