NameNode and secondary Namenode

242 Views Asked by At

What is the role of a Secondary namenode, if at all Namenode fails ?

3

There are 3 best solutions below

0
On

Perfect answer by @mobin-ranjbar

Also, this link will help you understand "For what purpose the Secondary Namenode is NOT meant?" ;)

0
On

Before going into this, i will explain about roles of NN and SNN.

NameNode: It contains metadata of datanodes, directory tree structure, fsimage and edit logs related to your entire cluster

SecondaryNameNode: It periodically collect fsimage and edit logs from NN and then merge those into new fsimage file, again it will push back into NN to decrease the size of NN metadata

So if NN fails

  1. SNN won't receive any updates from NN
  2. Your entire cluster go down
  3. With the help of SNN you can start another node as NN but SNN won't do NN works. It is just to collect fsimage and editlogs from NameNode
0
On

Its role will be accelerate the startup progress. It is a helper node for NameNode and It is not the replacement or backup for the Namenode.