Apache Ambari Operations
Also available as:
PDF
loading table of contents...

Re-create the Secondary NameNode

You may need to recreate your secondary NameNode.

Prerequisites

Check whether 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 proceed to re-enable your secondary NameNode.

To recreate your secondary NameNode:

Steps

  1. On the Ambari Server host, run the following command:

    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>

  2. Verify that the secondary NameNode now exists. On the Ambari Server host, run the following command:

    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.

More Information

Re-enable the Secondary NameNode