You may need to recreate your Secondary NameNode.
To check to see if you need to recreate the Secondary NameNode, on the Ambari Server host:
curl -u ${AMBARI_USER}:${AMBARI_PW} -H "X-Requested-By: ambari" -i -X GET ${AMBARI_PROTO}://localhost:${AMBARI_PORT}/api/v1/clusters/${CLUSTER_NAME}/host_components?HostRoles/component_name=SECONDARY_NAMENODE
If this returns an empty
items
array, you must recreate your Secondary NameNode. Otherwise you can go on to Re-enable Secondary NameNode.Recreate your Secondary NameNode. On the Ambari Server host:
curl -u ${AMBARI_USER}:${AMBARI_PW} -H "X-Requested-By: ambari" -i -X POST -d '{"host_components" : [{"HostRoles":{"component_name":"SECONDARY_NAMENODE"}}] }' ${AMBARI_PROTO}://localhost:${AMBARI_PORT}/api/v1/clusters/${CLUSTER_NAME}/hosts?Hosts/host_name=${SECONDARY_NAMENODE_HOSTNAME}
Verify that the Secondary NameNode now exists. On the Ambari Server host:
curl -u ${AMBARI_USER}:${AMBARI_PW} -H "X-Requested-By: ambari" -i -X GET ${AMBARI_PROTO}://localhost:${AMBARI_PORT}/api/v1/clusters/${CLUSTER_NAME}/host_components?HostRoles/component_name=SECONDARY_NAMENODE
This should return a non-empty
items
array containing the Secondary NameNode.