Mainly SecondaryNameNode server is used as a backup of NameNode server in Hadoop Distributed File system to recreate the NameNode server if it goes down. As total HDFS depends on the NameNode we have to recover it.
NameNode actually holds the edit log which contains the metadata information of the NameNode. In every few second the edit log is sent to the Secondary NameNode. Secondary NameNode can not become actual NameNode itself, because after some time gap the edit log is sent to the SecondaryNameNode. If the NameNode goes down the Secondary NameNode lost few data but it has a persistent copy of the Namenode server’s metadata. So we can recreate the NameNode.