The reason why Ambari is unable to start Namenode smoothly is
bug and below is the workaround. Issue got fixed permanently in Ambari 2.5.x.
Few lines of Error message from Ambari Ops logs:
File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/decorator.py",
line 55, in wrapper return function(*args,
**kwargs) File
"/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py",
line 562, in is_this_namenode_active raise Fail(format("The
NameNode {namenode_id} is not listed as Active or Standby, waiting..."))resource_management.core.exceptions.Fail: The
NameNode nn2 is not listed as Active or Standby, waiting...