SlideShare a Scribd company logo
1 of 40
1
Hadoop File System
Presented
By
Reference
2
The Hadoop Distributed File System: Architecture and Design by
www.kellytechno.com
Basic Features: HDFS
3
Highly fault-tolerant
High throughput
Suitable for applications with large data sets
Streaming access to file system data
Can be built out of commodity hardware
www.kellytechno.com
Fault tolerance
4
Failure is the norm rather than exception
A HDFS instance may consist of thousands of server
machines, each storing part of the file system’s data.
Since we have huge number of components and that each
component has non-trivial probability of failure means that
there is always some component that is non-functional.
Detection of faults and quick, automatic recovery from them
is a core architectural goal of HDFS.
www.kellytechno.com
Data Characteristics
5
Streaming data access
Applications need streaming access to data
Batch processing rather than interactive user access.
Large data sets and files: gigabytes to terabytes size
High aggregate data bandwidth
Scale to hundreds of nodes in a cluster
Tens of millions of files in a single instance
Write-once-read-many: a file once created, written and closed
need not be changed – this assumption simplifies coherency
A map-reduce application or web-crawler application fits
perfectly with this model.
www.kellytechno.com
Cat
Bat
Dog
Other
Words
(size:
TByte)
map
map
map
map
split
split
split
split
combine
combine
combine
reduce
reduce
reduce
part0
part1
part2
MapReduce
6
www.kellytechno.com
Architecture
7
www.kellytechno.com
Namenode and Datanodes
8
Master/slave architecture
HDFS cluster consists of a single Namenode, a master server that
manages the file system namespace and regulates access to files by
clients.
There are a number of DataNodes usually one per node in a cluster.
The DataNodes manage storage attached to the nodes that they run on.
HDFS exposes a file system namespace and allows user data to be stored
in files.
A file is split into one or more blocks and set of blocks are stored in
DataNodes.
DataNodes: serves read, write requests, performs block creation,
deletion, and replication upon instruction from Namenode.
www.kellytechno.com
HDFS Architecture
9
Namenode
B
replication
Rack1 Rack2
Client
Blocks
Datanodes Datanodes
Client
Write
Read
Metadata ops
Metadata(Name, replicas..)
(/home/foo/data,6. ..
Block ops
www.kellytechno.com
File system Namespace
10
Hierarchical file system with directories and files
Create, remove, move, rename etc.
Namenode maintains the file system
Any meta information changes to the file system recorded by
the Namenode.
An application can specify the number of replicas of the file
needed: replication factor of the file. This information is
stored in the Namenode.
www.kellytechno.com
Data Replication
11
HDFS is designed to store very large files across machines in
a large cluster.
Each file is a sequence of blocks.
All blocks in the file except the last are of the same size.
Blocks are replicated for fault tolerance.
Block size and replicas are configurable per file.
The Namenode receives a Heartbeat and a BlockReport from
each DataNode in the cluster.
BlockReport contains all the blocks on a Datanode.
www.kellytechno.com
Replica Placement
12
 The placement of the replicas is critical to HDFS reliability and performance.
 Optimizing replica placement distinguishes HDFS from other distributed file systems.
 Rack-aware replica placement:
 Goal: improve reliability, availability and network bandwidth utilization
 Research topic
 Many racks, communication between racks are through switches.
 Network bandwidth between machines on the same rack is greater than those in different racks.
 Namenode determines the rack id for each DataNode.
 Replicas are typically placed on unique racks
 Simple but non-optimal
 Writes are expensive
 Replication factor is 3
 Another research topic?
 Replicas are placed: one on a node in a local rack, one on a different node in the local rack and one
on a node in a different rack.
 1/3 of the replica on a node, 2/3 on a rack and 1/3 distributed evenly across remaining racks.
www.kellytechno.com
Replica Selection
13
Replica selection for READ operation: HDFS tries to
minimize the bandwidth consumption and latency.
If there is a replica on the Reader node then that is preferred.
HDFS cluster may span multiple data centers: replica in the
local data center is preferred over the remote one.
www.kellytechno.com
Safemode Startup
14
On startup Namenode enters Safemode.
Replication of data blocks do not occur in Safemode.
Each DataNode checks in with Heartbeat and BlockReport.
Namenode verifies that each block has acceptable number of
replicas
After a configurable percentage of safely replicated blocks
check in with the Namenode, Namenode exits Safemode.
It then makes the list of blocks that need to be replicated.
Namenode then proceeds to replicate these blocks to other
Datanodes.
www.kellytechno.com
Filesystem Metadata
15
The HDFS namespace is stored by Namenode.
Namenode uses a transaction log called the EditLog to record
every change that occurs to the filesystem meta data.
For example, creating a new file.
Change replication factor of a file
EditLog is stored in the Namenode’s local filesystem
Entire filesystem namespace including mapping of blocks to
files and file system properties is stored in a file FsImage.
Stored in Namenode’s local filesystem.
www.kellytechno.com
Namenode
16
Keeps image of entire file system namespace and file
Blockmap in memory.
4GB of local RAM is sufficient to support the above data
structures that represent the huge number of files and
directories.
When the Namenode starts up it gets the FsImage and
Editlog from its local file system, update FsImage with
EditLog information and then stores a copy of the FsImage
on the filesytstem as a checkpoint.
Periodic checkpointing is done. So that the system can
recover back to the last checkpointed state in case of a crash.
www.kellytechno.com
Datanode
17
A Datanode stores data in files in its local file system.
Datanode has no knowledge about HDFS filesystem
It stores each block of HDFS data in a separate file.
Datanode does not create all files in the same directory.
It uses heuristics to determine optimal number of files per
directory and creates directories appropriately:
 Research issue?
When the filesystem starts up it generates a list of all HDFS
blocks and send this report to Namenode: Blockreport.
www.kellytechno.com
Protocol
18
www.kellytechno.com
The Communication Protocol
19
All HDFS communication protocols are layered on top of the
TCP/IP protocol
A client establishes a connection to a configurable TCP port on
the Namenode machine. It talks ClientProtocol with the
Namenode.
The Datanodes talk to the Namenode using Datanode protocol.
RPC abstraction wraps both ClientProtocol and Datanode
protocol.
Namenode is simply a server and never initiates a request; it only
responds to RPC requests issued by DataNodes or clients.
www.kellytechno.com
Robustness
20
www.kellytechno.com
Objectives
21
Primary objective of HDFS is to store data reliably in the
presence of failures.
Three common failures are: Namenode failure, Datanode
failure and network partition.
www.kellytechno.com
Objectives
22
Primary objective of HDFS is to store data reliably in the
presence of failures.
Three common failures are: Namenode failure, Datanode
failure and network partition.
www.kellytechno.com
Objectives
23
Primary objective of HDFS is to store data reliably in the
presence of failures.
Three common failures are: Namenode failure, Datanode
failure and network partition.
www.kellytechno.com
Objectives
24
Primary objective of HDFS is to store data reliably in the
presence of failures.
Three common failures are: Namenode failure, Datanode
failure and network partition.
www.kellytechno.com
DataNode failure and heartbeat
25
A network partition can cause a subset of Datanodes to lose
connectivity with the Namenode.
Namenode detects this condition by the absence of a
Heartbeat message.
Namenode marks Datanodes without Hearbeat and does not
send any IO requests to them.
Any data registered to the failed Datanode is not available to
the HDFS.
Also the death of a Datanode may cause replication factor of
some of the blocks to fall below their specified value.
www.kellytechno.com
Re-replication
26
The necessity for re-replication may arise due to:
A Datanode may become unavailable,
A replica may become corrupted,
A hard disk on a Datanode may fail, or
The replication factor on the block may be increased.
www.kellytechno.com
Cluster Rebalancing
27
HDFS architecture is compatible with data rebalancing schemes.
A scheme might move data from one Datanode to another if the
free space on a Datanode falls below a certain threshold.
In the event of a sudden high demand for a particular file, a scheme
might dynamically create additional replicas and rebalance other
data in the cluster.
These types of data rebalancing are not yet implemented: research
issue.
www.kellytechno.com
Data Integrity
28
Consider a situation: a block of data fetched from Datanode
arrives corrupted.
This corruption may occur because of faults in a storage
device, network faults, or buggy software.
A HDFS client creates the checksum of every block of its file
and stores it in hidden files in the HDFS namespace.
When a clients retrieves the contents of file, it verifies that
the corresponding checksums match.
If does not match, the client can retrieve the block from a
replica.
www.kellytechno.com
Metadata Disk Failure
29
FsImage and EditLog are central data structures of HDFS.
A corruption of these files can cause a HDFS instance to be non-
functional.
For this reason, a Namenode can be configured to maintain
multiple copies of the FsImage and EditLog.
Multiple copies of the FsImage and EditLog files are updated
synchronously.
Meta-data is not data-intensive.
The Namenode could be single point failure: automatic failover is
NOT supported! Another research topic.
www.kellytechno.com
Data Organization
30
www.kellytechno.com
Data Blocks
31
HDFS support write-once-read-many with reads at
streaming speeds.
A typical block size is 64MB (or even 128 MB).
A file is chopped into 64MB chunks and stored.
www.kellytechno.com
Staging
32
A client request to create a file does not reach Namenode
immediately.
HDFS client caches the data into a temporary file. When the
data reached a HDFS block size the client contacts the
Namenode.
Namenode inserts the filename into its hierarchy and
allocates a data block for it.
The Namenode responds to the client with the identity of the
Datanode and the destination of the replicas (Datanodes) for
the block.
Then the client flushes it from its local memory.
www.kellytechno.com
Staging (contd.)
33
The client sends a message that the file is closed.
Namenode proceeds to commit the file for creation
operation into the persistent store.
If the Namenode dies before file is closed, the file is lost.
This client side caching is required to avoid network
congestion; also it has precedence is AFS (Andrew file
system).
www.kellytechno.com
Replication Pipelining
34
When the client receives response from Namenode, it
flushes its block in small pieces (4K) to the first replica, that
in turn copies it to the next replica and so on.
Thus data is pipelined from Datanode to the next.
www.kellytechno.com
API (Accessibility)
35
www.kellytechno.com
Application Programming Interface
36
HDFS provides Java API for application to use.
Python access is also used in many applications.
A C language wrapper for Java API is also available.
A HTTP browser can be used to browse the files of a HDFS
instance.
www.kellytechno.com
FS Shell, Admin and Browser Interface
37
HDFS organizes its data in files and directories.
It provides a command line interface called the FS shell that lets the
user interact with data in the HDFS.
The syntax of the commands is similar to bash and csh.
Example: to create a directory /foodir
/bin/hadoop dfs –mkdir /foodir
There is also DFSAdmin interface available
Browser interface is also available to view the namespace.
www.kellytechno.com
Space Reclamation
38
When a file is deleted by a client, HDFS renames file to a file in be
the /trash directory for a configurable amount of time.
A client can request for an undelete in this allowed time.
After the specified time the file is deleted and the space is
reclaimed.
When the replication factor is reduced, the Namenode selects
excess replicas that can be deleted.
Next heartbeat(?) transfers this information to the Datanode that
clears the blocks for use.
www.kellytechno.com
Summary
39
We discussed the features of the Hadoop File System, a peta-
scale file system to handle big-data sets.
What discussed: Architecture, Protocol, API, etc.
Missing element: Implementation
The Hadoop file system (internals)
An implementation of an instance of the HDFS (for use by
applications such as web crawlers).
www.kellytechno.com
40
Presented
By

More Related Content

What's hot

Hadoop operations basic
Hadoop operations basicHadoop operations basic
Hadoop operations basic
Hafizur Rahman
 
Hadoop ecosystem
Hadoop ecosystemHadoop ecosystem
Hadoop ecosystem
Mohamed Ali Mahmoud khouder
 
Syncsort et le retour d'expérience ComScore
Syncsort et le retour d'expérience ComScoreSyncsort et le retour d'expérience ComScore
Syncsort et le retour d'expérience ComScore
Modern Data Stack France
 

What's hot (19)

Big data- HDFS(2nd presentation)
Big data- HDFS(2nd presentation)Big data- HDFS(2nd presentation)
Big data- HDFS(2nd presentation)
 
HDFS Internals
HDFS InternalsHDFS Internals
HDFS Internals
 
HDFS: Hadoop Distributed Filesystem
HDFS: Hadoop Distributed FilesystemHDFS: Hadoop Distributed Filesystem
HDFS: Hadoop Distributed Filesystem
 
Hadoop
HadoopHadoop
Hadoop
 
Hadoop Interview Questions and Answers by rohit kapa
Hadoop Interview Questions and Answers by rohit kapaHadoop Interview Questions and Answers by rohit kapa
Hadoop Interview Questions and Answers by rohit kapa
 
Asbury Hadoop Overview
Asbury Hadoop OverviewAsbury Hadoop Overview
Asbury Hadoop Overview
 
Introduction to HDFS and MapReduce
Introduction to HDFS and MapReduceIntroduction to HDFS and MapReduce
Introduction to HDFS and MapReduce
 
Hadoop operations basic
Hadoop operations basicHadoop operations basic
Hadoop operations basic
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
 
July 2010 Triangle Hadoop Users Group - Chad Vawter Slides
July 2010 Triangle Hadoop Users Group - Chad Vawter SlidesJuly 2010 Triangle Hadoop Users Group - Chad Vawter Slides
July 2010 Triangle Hadoop Users Group - Chad Vawter Slides
 
Apache hadoop technology : Beginners
Apache hadoop technology : BeginnersApache hadoop technology : Beginners
Apache hadoop technology : Beginners
 
6.hive
6.hive6.hive
6.hive
 
Hadoop Fundamentals
Hadoop FundamentalsHadoop Fundamentals
Hadoop Fundamentals
 
002 Introduction to hadoop v3
002   Introduction to hadoop v3002   Introduction to hadoop v3
002 Introduction to hadoop v3
 
Hadoop ecosystem
Hadoop ecosystemHadoop ecosystem
Hadoop ecosystem
 
A Basic Introduction to the Hadoop eco system - no animation
A Basic Introduction to the Hadoop eco system - no animationA Basic Introduction to the Hadoop eco system - no animation
A Basic Introduction to the Hadoop eco system - no animation
 
Introduction to Hadoop and Hadoop component
Introduction to Hadoop and Hadoop component Introduction to Hadoop and Hadoop component
Introduction to Hadoop and Hadoop component
 
Hadoop Overview kdd2011
Hadoop Overview kdd2011Hadoop Overview kdd2011
Hadoop Overview kdd2011
 
Syncsort et le retour d'expérience ComScore
Syncsort et le retour d'expérience ComScoreSyncsort et le retour d'expérience ComScore
Syncsort et le retour d'expérience ComScore
 

Similar to Hadoop training in hyderabad-kellytechnologies

Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...
Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...
Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...
Simplilearn
 
Fredrick Ishengoma - HDFS+- Erasure Coding Based Hadoop Distributed File System
Fredrick Ishengoma -  HDFS+- Erasure Coding Based Hadoop Distributed File SystemFredrick Ishengoma -  HDFS+- Erasure Coding Based Hadoop Distributed File System
Fredrick Ishengoma - HDFS+- Erasure Coding Based Hadoop Distributed File System
Fredrick Ishengoma
 

Similar to Hadoop training in hyderabad-kellytechnologies (20)

Hadoop-professional-software-development-course-in-mumbai
Hadoop-professional-software-development-course-in-mumbaiHadoop-professional-software-development-course-in-mumbai
Hadoop-professional-software-development-course-in-mumbai
 
Hadoop professional-software-development-course-in-mumbai
Hadoop professional-software-development-course-in-mumbaiHadoop professional-software-development-course-in-mumbai
Hadoop professional-software-development-course-in-mumbai
 
HDFS.ppt
HDFS.pptHDFS.ppt
HDFS.ppt
 
HDFS.ppt
HDFS.pptHDFS.ppt
HDFS.ppt
 
Hdfs
HdfsHdfs
Hdfs
 
Introduction_to_HDFS sun.pptx
Introduction_to_HDFS sun.pptxIntroduction_to_HDFS sun.pptx
Introduction_to_HDFS sun.pptx
 
Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...
Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...
Hadoop Interview Questions And Answers Part-1 | Big Data Interview Questions ...
 
Hadoop data management
Hadoop data managementHadoop data management
Hadoop data management
 
Hadoop and HDFS
Hadoop and HDFSHadoop and HDFS
Hadoop and HDFS
 
Hadoop distributed file system
Hadoop distributed file systemHadoop distributed file system
Hadoop distributed file system
 
HDFS Design Principles
HDFS Design PrinciplesHDFS Design Principles
HDFS Design Principles
 
Introduction to HDFS
Introduction to HDFSIntroduction to HDFS
Introduction to HDFS
 
Hadoop HDFS Architeture and Design
Hadoop HDFS Architeture and DesignHadoop HDFS Architeture and Design
Hadoop HDFS Architeture and Design
 
module 2.pptx
module 2.pptxmodule 2.pptx
module 2.pptx
 
Hadoop
HadoopHadoop
Hadoop
 
Fredrick Ishengoma - HDFS+- Erasure Coding Based Hadoop Distributed File System
Fredrick Ishengoma -  HDFS+- Erasure Coding Based Hadoop Distributed File SystemFredrick Ishengoma -  HDFS+- Erasure Coding Based Hadoop Distributed File System
Fredrick Ishengoma - HDFS+- Erasure Coding Based Hadoop Distributed File System
 
Hadoop Distributed File System for Big Data Analytics
Hadoop Distributed File System for Big Data AnalyticsHadoop Distributed File System for Big Data Analytics
Hadoop Distributed File System for Big Data Analytics
 
Hdfs architecture
Hdfs architectureHdfs architecture
Hdfs architecture
 
Big data interview questions and answers
Big data interview questions and answersBig data interview questions and answers
Big data interview questions and answers
 
Hadoop -HDFS.ppt
Hadoop -HDFS.pptHadoop -HDFS.ppt
Hadoop -HDFS.ppt
 

More from Kelly Technologies

Salesforce crm-training-in-bangalore
Salesforce crm-training-in-bangaloreSalesforce crm-training-in-bangalore
Salesforce crm-training-in-bangalore
Kelly Technologies
 

More from Kelly Technologies (20)

Hadoop trainting in hyderabad@kelly technologies
Hadoop trainting in hyderabad@kelly technologiesHadoop trainting in hyderabad@kelly technologies
Hadoop trainting in hyderabad@kelly technologies
 
Hadoop trainting-in-hyderabad@kelly technologies
Hadoop trainting-in-hyderabad@kelly technologiesHadoop trainting-in-hyderabad@kelly technologies
Hadoop trainting-in-hyderabad@kelly technologies
 
Hadoop training-in-hyderabad
Hadoop training-in-hyderabadHadoop training-in-hyderabad
Hadoop training-in-hyderabad
 
Data science training institute in hyderabad
Data science training institute in hyderabadData science training institute in hyderabad
Data science training institute in hyderabad
 
Data science institutes in hyderabad
Data science institutes in hyderabadData science institutes in hyderabad
Data science institutes in hyderabad
 
Data science training in hyderabad
Data science training in hyderabadData science training in hyderabad
Data science training in hyderabad
 
Hadoop training institute in hyderabad
Hadoop training institute in hyderabadHadoop training institute in hyderabad
Hadoop training institute in hyderabad
 
Hadoop institutes in hyderabad
Hadoop institutes in hyderabadHadoop institutes in hyderabad
Hadoop institutes in hyderabad
 
Sas training in hyderabad
Sas training in hyderabadSas training in hyderabad
Sas training in hyderabad
 
Websphere mb training in hyderabad
Websphere mb training in hyderabadWebsphere mb training in hyderabad
Websphere mb training in hyderabad
 
Hadoop institutes-in-bangalore
Hadoop institutes-in-bangaloreHadoop institutes-in-bangalore
Hadoop institutes-in-bangalore
 
Oracle training-institutes-in-hyderabad
Oracle training-institutes-in-hyderabadOracle training-institutes-in-hyderabad
Oracle training-institutes-in-hyderabad
 
Hadoop training institutes in bangalore
Hadoop training institutes in bangaloreHadoop training institutes in bangalore
Hadoop training institutes in bangalore
 
Hadoop training institute in bangalore
Hadoop training institute in bangaloreHadoop training institute in bangalore
Hadoop training institute in bangalore
 
Tableau training in bangalore
Tableau training in bangaloreTableau training in bangalore
Tableau training in bangalore
 
Salesforce crm-training-in-bangalore
Salesforce crm-training-in-bangaloreSalesforce crm-training-in-bangalore
Salesforce crm-training-in-bangalore
 
Oracle training in hyderabad
Oracle training in hyderabadOracle training in hyderabad
Oracle training in hyderabad
 
Qlikview training in hyderabad
Qlikview training in hyderabadQlikview training in hyderabad
Qlikview training in hyderabad
 
Spark training-in-bangalore
Spark training-in-bangaloreSpark training-in-bangalore
Spark training-in-bangalore
 
Project Management Planning training in hyderabad
Project Management Planning training in hyderabadProject Management Planning training in hyderabad
Project Management Planning training in hyderabad
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

Hadoop training in hyderabad-kellytechnologies

  • 2. Reference 2 The Hadoop Distributed File System: Architecture and Design by www.kellytechno.com
  • 3. Basic Features: HDFS 3 Highly fault-tolerant High throughput Suitable for applications with large data sets Streaming access to file system data Can be built out of commodity hardware www.kellytechno.com
  • 4. Fault tolerance 4 Failure is the norm rather than exception A HDFS instance may consist of thousands of server machines, each storing part of the file system’s data. Since we have huge number of components and that each component has non-trivial probability of failure means that there is always some component that is non-functional. Detection of faults and quick, automatic recovery from them is a core architectural goal of HDFS. www.kellytechno.com
  • 5. Data Characteristics 5 Streaming data access Applications need streaming access to data Batch processing rather than interactive user access. Large data sets and files: gigabytes to terabytes size High aggregate data bandwidth Scale to hundreds of nodes in a cluster Tens of millions of files in a single instance Write-once-read-many: a file once created, written and closed need not be changed – this assumption simplifies coherency A map-reduce application or web-crawler application fits perfectly with this model. www.kellytechno.com
  • 8. Namenode and Datanodes 8 Master/slave architecture HDFS cluster consists of a single Namenode, a master server that manages the file system namespace and regulates access to files by clients. There are a number of DataNodes usually one per node in a cluster. The DataNodes manage storage attached to the nodes that they run on. HDFS exposes a file system namespace and allows user data to be stored in files. A file is split into one or more blocks and set of blocks are stored in DataNodes. DataNodes: serves read, write requests, performs block creation, deletion, and replication upon instruction from Namenode. www.kellytechno.com
  • 9. HDFS Architecture 9 Namenode B replication Rack1 Rack2 Client Blocks Datanodes Datanodes Client Write Read Metadata ops Metadata(Name, replicas..) (/home/foo/data,6. .. Block ops www.kellytechno.com
  • 10. File system Namespace 10 Hierarchical file system with directories and files Create, remove, move, rename etc. Namenode maintains the file system Any meta information changes to the file system recorded by the Namenode. An application can specify the number of replicas of the file needed: replication factor of the file. This information is stored in the Namenode. www.kellytechno.com
  • 11. Data Replication 11 HDFS is designed to store very large files across machines in a large cluster. Each file is a sequence of blocks. All blocks in the file except the last are of the same size. Blocks are replicated for fault tolerance. Block size and replicas are configurable per file. The Namenode receives a Heartbeat and a BlockReport from each DataNode in the cluster. BlockReport contains all the blocks on a Datanode. www.kellytechno.com
  • 12. Replica Placement 12  The placement of the replicas is critical to HDFS reliability and performance.  Optimizing replica placement distinguishes HDFS from other distributed file systems.  Rack-aware replica placement:  Goal: improve reliability, availability and network bandwidth utilization  Research topic  Many racks, communication between racks are through switches.  Network bandwidth between machines on the same rack is greater than those in different racks.  Namenode determines the rack id for each DataNode.  Replicas are typically placed on unique racks  Simple but non-optimal  Writes are expensive  Replication factor is 3  Another research topic?  Replicas are placed: one on a node in a local rack, one on a different node in the local rack and one on a node in a different rack.  1/3 of the replica on a node, 2/3 on a rack and 1/3 distributed evenly across remaining racks. www.kellytechno.com
  • 13. Replica Selection 13 Replica selection for READ operation: HDFS tries to minimize the bandwidth consumption and latency. If there is a replica on the Reader node then that is preferred. HDFS cluster may span multiple data centers: replica in the local data center is preferred over the remote one. www.kellytechno.com
  • 14. Safemode Startup 14 On startup Namenode enters Safemode. Replication of data blocks do not occur in Safemode. Each DataNode checks in with Heartbeat and BlockReport. Namenode verifies that each block has acceptable number of replicas After a configurable percentage of safely replicated blocks check in with the Namenode, Namenode exits Safemode. It then makes the list of blocks that need to be replicated. Namenode then proceeds to replicate these blocks to other Datanodes. www.kellytechno.com
  • 15. Filesystem Metadata 15 The HDFS namespace is stored by Namenode. Namenode uses a transaction log called the EditLog to record every change that occurs to the filesystem meta data. For example, creating a new file. Change replication factor of a file EditLog is stored in the Namenode’s local filesystem Entire filesystem namespace including mapping of blocks to files and file system properties is stored in a file FsImage. Stored in Namenode’s local filesystem. www.kellytechno.com
  • 16. Namenode 16 Keeps image of entire file system namespace and file Blockmap in memory. 4GB of local RAM is sufficient to support the above data structures that represent the huge number of files and directories. When the Namenode starts up it gets the FsImage and Editlog from its local file system, update FsImage with EditLog information and then stores a copy of the FsImage on the filesytstem as a checkpoint. Periodic checkpointing is done. So that the system can recover back to the last checkpointed state in case of a crash. www.kellytechno.com
  • 17. Datanode 17 A Datanode stores data in files in its local file system. Datanode has no knowledge about HDFS filesystem It stores each block of HDFS data in a separate file. Datanode does not create all files in the same directory. It uses heuristics to determine optimal number of files per directory and creates directories appropriately:  Research issue? When the filesystem starts up it generates a list of all HDFS blocks and send this report to Namenode: Blockreport. www.kellytechno.com
  • 19. The Communication Protocol 19 All HDFS communication protocols are layered on top of the TCP/IP protocol A client establishes a connection to a configurable TCP port on the Namenode machine. It talks ClientProtocol with the Namenode. The Datanodes talk to the Namenode using Datanode protocol. RPC abstraction wraps both ClientProtocol and Datanode protocol. Namenode is simply a server and never initiates a request; it only responds to RPC requests issued by DataNodes or clients. www.kellytechno.com
  • 21. Objectives 21 Primary objective of HDFS is to store data reliably in the presence of failures. Three common failures are: Namenode failure, Datanode failure and network partition. www.kellytechno.com
  • 22. Objectives 22 Primary objective of HDFS is to store data reliably in the presence of failures. Three common failures are: Namenode failure, Datanode failure and network partition. www.kellytechno.com
  • 23. Objectives 23 Primary objective of HDFS is to store data reliably in the presence of failures. Three common failures are: Namenode failure, Datanode failure and network partition. www.kellytechno.com
  • 24. Objectives 24 Primary objective of HDFS is to store data reliably in the presence of failures. Three common failures are: Namenode failure, Datanode failure and network partition. www.kellytechno.com
  • 25. DataNode failure and heartbeat 25 A network partition can cause a subset of Datanodes to lose connectivity with the Namenode. Namenode detects this condition by the absence of a Heartbeat message. Namenode marks Datanodes without Hearbeat and does not send any IO requests to them. Any data registered to the failed Datanode is not available to the HDFS. Also the death of a Datanode may cause replication factor of some of the blocks to fall below their specified value. www.kellytechno.com
  • 26. Re-replication 26 The necessity for re-replication may arise due to: A Datanode may become unavailable, A replica may become corrupted, A hard disk on a Datanode may fail, or The replication factor on the block may be increased. www.kellytechno.com
  • 27. Cluster Rebalancing 27 HDFS architecture is compatible with data rebalancing schemes. A scheme might move data from one Datanode to another if the free space on a Datanode falls below a certain threshold. In the event of a sudden high demand for a particular file, a scheme might dynamically create additional replicas and rebalance other data in the cluster. These types of data rebalancing are not yet implemented: research issue. www.kellytechno.com
  • 28. Data Integrity 28 Consider a situation: a block of data fetched from Datanode arrives corrupted. This corruption may occur because of faults in a storage device, network faults, or buggy software. A HDFS client creates the checksum of every block of its file and stores it in hidden files in the HDFS namespace. When a clients retrieves the contents of file, it verifies that the corresponding checksums match. If does not match, the client can retrieve the block from a replica. www.kellytechno.com
  • 29. Metadata Disk Failure 29 FsImage and EditLog are central data structures of HDFS. A corruption of these files can cause a HDFS instance to be non- functional. For this reason, a Namenode can be configured to maintain multiple copies of the FsImage and EditLog. Multiple copies of the FsImage and EditLog files are updated synchronously. Meta-data is not data-intensive. The Namenode could be single point failure: automatic failover is NOT supported! Another research topic. www.kellytechno.com
  • 31. Data Blocks 31 HDFS support write-once-read-many with reads at streaming speeds. A typical block size is 64MB (or even 128 MB). A file is chopped into 64MB chunks and stored. www.kellytechno.com
  • 32. Staging 32 A client request to create a file does not reach Namenode immediately. HDFS client caches the data into a temporary file. When the data reached a HDFS block size the client contacts the Namenode. Namenode inserts the filename into its hierarchy and allocates a data block for it. The Namenode responds to the client with the identity of the Datanode and the destination of the replicas (Datanodes) for the block. Then the client flushes it from its local memory. www.kellytechno.com
  • 33. Staging (contd.) 33 The client sends a message that the file is closed. Namenode proceeds to commit the file for creation operation into the persistent store. If the Namenode dies before file is closed, the file is lost. This client side caching is required to avoid network congestion; also it has precedence is AFS (Andrew file system). www.kellytechno.com
  • 34. Replication Pipelining 34 When the client receives response from Namenode, it flushes its block in small pieces (4K) to the first replica, that in turn copies it to the next replica and so on. Thus data is pipelined from Datanode to the next. www.kellytechno.com
  • 36. Application Programming Interface 36 HDFS provides Java API for application to use. Python access is also used in many applications. A C language wrapper for Java API is also available. A HTTP browser can be used to browse the files of a HDFS instance. www.kellytechno.com
  • 37. FS Shell, Admin and Browser Interface 37 HDFS organizes its data in files and directories. It provides a command line interface called the FS shell that lets the user interact with data in the HDFS. The syntax of the commands is similar to bash and csh. Example: to create a directory /foodir /bin/hadoop dfs –mkdir /foodir There is also DFSAdmin interface available Browser interface is also available to view the namespace. www.kellytechno.com
  • 38. Space Reclamation 38 When a file is deleted by a client, HDFS renames file to a file in be the /trash directory for a configurable amount of time. A client can request for an undelete in this allowed time. After the specified time the file is deleted and the space is reclaimed. When the replication factor is reduced, the Namenode selects excess replicas that can be deleted. Next heartbeat(?) transfers this information to the Datanode that clears the blocks for use. www.kellytechno.com
  • 39. Summary 39 We discussed the features of the Hadoop File System, a peta- scale file system to handle big-data sets. What discussed: Architecture, Protocol, API, etc. Missing element: Implementation The Hadoop file system (internals) An implementation of an instance of the HDFS (for use by applications such as web crawlers). www.kellytechno.com