To add a NameNode HA to a federation, you must format each new active NameNode that you want to add to the federation. In addition, you must bootstrap the standby NameNode.
Ensure that you format only those NameNodes that are associated with newly created namespaces for the federation. Formatting any NameNode with already existing namespaces could result in data loss.
Format the active NameNode by specifying the Cluster ID.
The Cluster ID must be the same as that of the existing namespaces.
hdfs namenode -format [-clusterId <cluster_id>]
Bootstrap the standby NameNode as specified.
hdfs namenode -bootstrapStandby