What are differences between NameNode and Secondary NameNode

0 votes

Is Secondary NameNode back up of NameNode. If NameNode goes down will secondary NameNode take over the responsibilities of NameNode? What are the differences between NameNode & secondary NameNode?

Mar 23, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
15,459 views

3 answers to this question.

0 votes

No, Secondary NameNode is not a backup of NameNode. You can call it a helper of NameNode.

NameNode is the master daemon which maintains and manages the DataNodes. It regularly receives a Heartbeat and a block report from all the DataNodes in the cluster to ensure that the DataNodes are live.

In case of the DataNode failure, the NameNode chooses new DataNodes for new replicas, balance disk usage and manages the communication traffic to the DataNodes.

It stores the metadata of all the files stored in HDFS, e.g. The location of blocks stored, the size of the files, permissions, hierarchy, etc.

It maintains 2 files:

  • FsImage: Contains the complete state of the file system namespace since the start of the NameNode.
  • EditLogs: Contains all the recent modifications made to the file system with respect to the most recent FsImage.

Whereas the Secondary NameNode is one which constantly reads all the file systems and metadata from the RAM of the NameNode and writes it into the hard disk or the file system.

It is responsible for combining the EditLogs with FsImage from the NameNode.

answered Mar 23, 2018 by Shubham
• 13,490 points
0 votes

Name node is the one which stores the information of HDFS filesystem in a file called FSimage.

Any changes that you make in your HDFS are never logged directly into FSimage. instead, they are logged into a separate temporary file.

The name node reads the FSimage file and then reads the temporary file and updates the memory.

This temporary file which stores the intermediate data is called Secondary name node. This secodary name node is used just to speed up the memory accessing process of Name node. since the process of updating the minute data changes directly to the name node consumes a lot of time and is not efficient.

Image result for hdfs architecture

I hope my answer was informative, if not, please read this article which will elaborate more about HDFS and its architecture.

answered Mar 26, 2019 by nitinrawat895
• 11,380 points
+1 vote

File metadata information is stored by Namenode in form of two files-

fsimage – Contains the snapshot of the file system metadata and used by Namenode when it is started.
edit log – Any change made to the filesystem, after the Namenode is started, is recorded in edit logs.

When the Namenode is eventually restarted it has to first consult the fsimage and then apply all the changes recorded in edit logs which means taking more time for namenode to restart.

Secondary Namenode merges the fsimage and the edits log files periodically and Copies the newly created fsimage file back to Namenode. 

answered Apr 8, 2019 by anonymous

Related Questions In Big Data Hadoop

+1 vote
1 answer

What is difference between Hadoop Namenode HA and HDFS federation?

The main difference between HDFS High Availability ...READ MORE

answered Oct 31, 2018 in Big Data Hadoop by Frankie
• 9,830 points
3,397 views
0 votes
10 answers

What is the difference between Mongodb and Hadoop?

MongoDB is a NoSQL database, whereas Hadoop is ...READ MORE

answered Jun 20, 2018 in Big Data Hadoop by jenny_code
12,168 views
0 votes
1 answer
0 votes
1 answer

Differences between Hadoop-common, Hadoop-core and Hadoop-client?

To help provide some additional details regarding ...READ MORE

answered Mar 29, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
3,207 views
0 votes
1 answer

What is difference between Oozie workflow, coordinator and bundle ?

Workflow does not have time specifications to ...READ MORE

answered Mar 29, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
3,141 views
0 votes
1 answer
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,642 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,077 views
0 votes
1 answer

How to get started with Hadoop?

Well, hadoop is actually a framework that ...READ MORE

answered Mar 21, 2018 in Big Data Hadoop by coldcode
• 2,090 points
1,207 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
109,073 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP