SlideShare una empresa de Scribd logo
1 de 21
www.protechskills.com
Protechskills
HDFS
Hadoop Distributed File System
www.protechskills.com
Protechskills
Topics Covered
 Design Goals
 Hadoop Blocks
 Rack Awareness, Replica Placement & Selection
 Permissions Model
 Anatomy of a File Write / Read on HDFS
 FileSystem Image and Edit Logs
 HDFS Check Pointing Process
 Directory Structure - NameNode, Secondary NameNode , DataNode
 Safe Mode
www.protechskills.com
Protechskills
HDFS Design Goals
 Hardware Failure - Detection of faults and quick, automatic recovery
 Streaming Data Access - High throughput of data access (Batch Processing of data)
 Large Data Sets - Gigabytes to terabytes in size.
 Simple Coherency Model – Write once read many access model for files
 Moving computation is cheaper than moving data
www.protechskills.com
Protechskills
NameNode
Datanode_1 Datanode_2 Datanode_3
HDFS
Block 1
HDFS
Block 2
HDFS
Block 3 Block 4
Storage & Replication of Blocks in HDFS
Filedividedintoblocks
Block 1
Block 2
Block 3
Block 4
www.protechskills.com
Protechskills
Blocks
 Minimum amount of data that can be read or write - 64 MB by default
 Minimize the cost of seeks
 A file can be larger than any single disk in the network
 Simplifies the storage subsystem – Same size & eliminating metadata concerns
 Provides fault tolerance and availability
www.protechskills.com
Protechskills
Hadoop Rack Awareness
 Get maximum performance out of Hadoop
cluster
 To provide reliable storage when dealing with
DataNode failure issues.
 Resolution of the slave's DNS name (also IP
address) to a rack id.
 Interface provided in Hadoop
DNSToSwitchMapping, Default implementation
is ScriptBasedMapping
Rack Topology - /rack1 & /rack2
www.protechskills.com
Protechskills
HADOOP_CONF={${HADOOP_HOME}/conf
while [ $# -gt 0 ] ; do
nodeArg=$1
exec< ${HADOOP_CONF}/topology.data
result=""
while read line ; do
ar=( $line )
if [ "${ar[0]}" = "$nodeArg" ] ; then
result="${ar[1]}"
fi
done
shift
if [ -z "$result" ] ; then
echo -n "/default/rack "
else
echo -n "$result "
fi
done
Sample Script
192.168.56.101 /dc1/rack1
192.168.56.102 /dc1/rack2
192.168.56.103 /dc1/rack2
Sample Data (topology.data)
Rack Awareness Configuration
File : hdfs-site.xml
Property : topology.node.switch.mapping.impl
Default Value : ScriptBasedMapping class
Property : topology.script.file.name
Value : <Absolute path to script file>
Sample Command : ./topology.sh 192.168.56.101
Output : /dc1/rack1
Ref Hadoop Wiki
http://wiki.apache.org/hadoop/topology_rack_awareness_scripts
www.protechskills.com
Protechskills
Replica Placement
 Critical to HDFS reliability and
performance
 Improve data reliability,
availability, and network
bandwidth utilization
Distance b/w Hadoop
Client and DataNode
Same Node : d=0
Same Rack : d=2
Same Data Centre
different rack
: d=4
Different Data Centre : d=6
www.protechskills.com
Protechskills
Replica Placement cont..
Default Strategy :
a) First replica on the same node as the client.
b) Second replica is placed on a different rack from the first (off-rack) chosen at random
c) Third replica is placed on the same rack as the second, but on a different node chosen at random.
d) Further replicas are placed on random nodes on the cluster
Replica Selection - HDFS tries to satisfy a read request from a replica that is closest to the
reader.
www.protechskills.com
Protechskills
Permissions Model
 Directory or file flag, permissions, replication, owner, group, file size, modification date,
and full path.
 User Name : ‘whoami’
 Group List : ‘bash -c groups’
 Super-User & Web Server
www.protechskills.com
Protechskills
Anatomy of a File Write
 Client creates the file by calling create()
method
 NameNode validates & processes the
create request
 Spilt file into packets (DataQueue)
 DataStreamer asks NameNode for
block / node mapping & pipelines are
created among nodes.
www.protechskills.com
Protechskills
Anatomy of a File Write (cont..)
 DataStreamer streams the packets to
the first DataNode
 DataNode forwards the copied packet
to the next DataNode in the pipeline
 DFSOutputStream also maintains the
ack queue and removes the packets
after receiving acknowledgement from
the DataNodes
 Client calls close() on the stream
www.protechskills.com
Protechskills
Anatomy of a File Read
 Client calls open() on the FileSystem
object
 DistributedFileSystem calls the
NameNode to determine the locations of
the blocks
 NameNode validates request & for each
block returns the list of DataNodes.
 DistributedFileSystem returns an input
stream that supports file seeks to the
client
www.protechskills.com
Protechskills
Anatomy of a File Read (cont..)
 Client calls read() on the stream
 When the end of the block is reached,
DFSInputStream will close the connection
to the DataNode, then find the best
DataNode for the next block.
 Client calls close() on the stream
www.protechskills.com
Protechskills
FileSystem Image and Edit Logs
 fsimage file is a persistent checkpoint of the file-system metadata
 When a client performs a write operation, it is first recorded in the edit log.
 The NameNode also has an in-memory representation of the files-ystem
metadata, which it updates after the edit log has been modified
 Secondary NameNode is used to produce checkpoints of the primary’s in-
memory files-ystem metadata
www.protechskills.com
Protechskills
Check Pointing Process
 Secondary NameNode asks the primary to roll its edits file,
so new edits go to a new file.
 NameNode sends the fsimage and edits (using HTTP GET).
 Secondary NameNode loads fsimage into memory, applies
each operation from edits, then creates a new consolidated
fsimage file.
 Secondary NameNode sends the new fsimage back to the
primary (using HTTP POST).
 Primary replaces the old fsimage with the new one.
Updates the fstime file to record the time for checkpoint.
www.protechskills.com
Protechskills
Directory Structure
NameNode (On NameNode only)
${dfs.name.dir}/current/VERSION
/edits
/fsimage
/fstime
Secondary NameNode (On SecNameNode Only)
${fs.checkpoint.dir}/current/VERSION
/edits
/fsimage
/fstime
/previous.checkpoint/VERSION
/edits
/fsimage
/fstime
DataNode (On all DataNodes)
${dfs.data.dir}/current/VERSION
/blk_<id_1>
/blk_<id_1>.meta
/blk_<id_2>
/blk_<id_2>.meta
/...
/blk_<id_64>
/blk_<id_64>.meta
/subdir0/
/subdir1/
/...
Block Count for a directory
dfs.datanode.numblocks property
www.protechskills.com
Protechskills
Safe Mode
 On start-up, NameNode loads its image file (fsimage) into memory and applies the edits from the edit
log (edits).
 It does the check pointing process itself. without recourse to the Secondary NameNode.
 Namenode is running in safe mode (offers only a read-only view to clients)
 The locations of blocks in the system are not persisted by the NameNode - this information resides with
the DataNodes, in the form of a list of the blocks it is storing.
 Safe mode is needed to give the DataNodes time to check in to the NameNode with their block lists
 Safe mode is exited when the minimal replication condition is reached, plus an extension time of 30
seconds.
www.protechskills.com
Protechskills
Safe Mode Properties
Property Type Default Value Description
dfs.safemode.threshold.pct float 0.999
The proportion of blocks in the system that must meet the minimum
replication level defined by dfs.replication.min before the namenode will exit
safe mode. Setting this value to 0 or less forces the namenode not to start in
safe mode. Setting this value to more than 1 means the namenode never exits
safe mode.
dfs.safemode.extension int 30, 000
The time, in milliseconds, to extend safe mode by after the minimum
replication condition defined by dfs.safemode.threshold.pct has been
satisfied. For small clusters (tens of nodes), it can be set to 0.
Syntax : hadoop dfsadmin –safemode [Options]
Options : get / wait / enter / leave
Safe Mode
Commands Options
www.protechskills.com
Protechskills
References
 Hadoop Apache Website – http://hadoop.apache.org/
 Hadoop The Definitive Guide 3rd Edition By Oreilly
www.protechskills.com
Protechskills

Más contenido relacionado

La actualidad más candente

Introduction to Hadoop and Hadoop component
Introduction to Hadoop and Hadoop component Introduction to Hadoop and Hadoop component
Introduction to Hadoop and Hadoop component rebeccatho
 
Hadoop, mapreduce and yarn networks
Hadoop, mapreduce and yarn networksHadoop, mapreduce and yarn networks
Hadoop, mapreduce and yarn networksHariniA7
 
Introducing Technologies for Handling Big Data by Jaseela
Introducing Technologies for Handling Big Data by JaseelaIntroducing Technologies for Handling Big Data by Jaseela
Introducing Technologies for Handling Big Data by JaseelaStudent
 
Hadoop & MapReduce
Hadoop & MapReduceHadoop & MapReduce
Hadoop & MapReduceNewvewm
 
BigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-ReduceBigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-ReduceLilia Sfaxi
 
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...Simplilearn
 
Testing Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitTesting Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitEric Wendelin
 
Map reduce presentation
Map reduce presentationMap reduce presentation
Map reduce presentationateeq ateeq
 
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Simplilearn
 
database recovery techniques
database recovery techniques database recovery techniques
database recovery techniques Kalhan Liyanage
 
Hadoop And Their Ecosystem ppt
 Hadoop And Their Ecosystem ppt Hadoop And Their Ecosystem ppt
Hadoop And Their Ecosystem pptsunera pathan
 
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability | Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability | Edureka!
 

La actualidad más candente (20)

Map Reduce
Map ReduceMap Reduce
Map Reduce
 
Consistency in NoSQL
Consistency in NoSQLConsistency in NoSQL
Consistency in NoSQL
 
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, mapreduce and yarn networks
Hadoop, mapreduce and yarn networksHadoop, mapreduce and yarn networks
Hadoop, mapreduce and yarn networks
 
Introducing Technologies for Handling Big Data by Jaseela
Introducing Technologies for Handling Big Data by JaseelaIntroducing Technologies for Handling Big Data by Jaseela
Introducing Technologies for Handling Big Data by Jaseela
 
Introduction to HDFS
Introduction to HDFSIntroduction to HDFS
Introduction to HDFS
 
Apache Flume
Apache FlumeApache Flume
Apache Flume
 
Hadoop & MapReduce
Hadoop & MapReduceHadoop & MapReduce
Hadoop & MapReduce
 
BigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-ReduceBigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-Reduce
 
Introduction to Hadoop Administration
Introduction to Hadoop AdministrationIntroduction to Hadoop Administration
Introduction to Hadoop Administration
 
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
Hive Tutorial | Hive Architecture | Hive Tutorial For Beginners | Hive In Had...
 
Testing Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnitTesting Hadoop jobs with MRUnit
Testing Hadoop jobs with MRUnit
 
Map reduce presentation
Map reduce presentationMap reduce presentation
Map reduce presentation
 
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
Hadoop Architecture | HDFS Architecture | Hadoop Architecture Tutorial | HDFS...
 
Unit 3
Unit 3Unit 3
Unit 3
 
database recovery techniques
database recovery techniques database recovery techniques
database recovery techniques
 
Hadoop And Their Ecosystem ppt
 Hadoop And Their Ecosystem ppt Hadoop And Their Ecosystem ppt
Hadoop And Their Ecosystem ppt
 
Apache hive introduction
Apache hive introductionApache hive introduction
Apache hive introduction
 
Map Reduce
Map ReduceMap Reduce
Map Reduce
 
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability | Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
Hadoop 2.0 Architecture | HDFS Federation | NameNode High Availability |
 

Similar a Hadoop HDFS Concepts

Hadoop HDFS Architeture and Design
Hadoop HDFS Architeture and DesignHadoop HDFS Architeture and Design
Hadoop HDFS Architeture and Designsudhakara st
 
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-mumbaiUnmesh Baile
 
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-mumbaiUnmesh Baile
 
Introduction to hadoop and hdfs
Introduction to hadoop and hdfsIntroduction to hadoop and hdfs
Introduction to hadoop and hdfsshrey mehrotra
 
Hadoop training in hyderabad-kellytechnologies
Hadoop training in hyderabad-kellytechnologiesHadoop training in hyderabad-kellytechnologies
Hadoop training in hyderabad-kellytechnologiesKelly Technologies
 
Big data interview questions and answers
Big data interview questions and answersBig data interview questions and answers
Big data interview questions and answersKalyan Hadoop
 
Apache hadoop and hive
Apache hadoop and hiveApache hadoop and hive
Apache hadoop and hivesrikanthhadoop
 
Hadoop distributed file system
Hadoop distributed file systemHadoop distributed file system
Hadoop distributed file systemsrikanthhadoop
 
Hadoop training in bangalore-kellytechnologies
Hadoop training in bangalore-kellytechnologiesHadoop training in bangalore-kellytechnologies
Hadoop training in bangalore-kellytechnologiesappaji intelhunt
 
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...DataStax
 
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 AnalyticsDrPDShebaKeziaMalarc
 
Big data with HDFS and Mapreduce
Big data  with HDFS and MapreduceBig data  with HDFS and Mapreduce
Big data with HDFS and Mapreducesenthil0809
 

Similar a Hadoop HDFS Concepts (20)

Hadoop HDFS Architeture and Design
Hadoop HDFS Architeture and DesignHadoop HDFS Architeture and Design
Hadoop HDFS Architeture and Design
 
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
 
Introduction to hadoop and hdfs
Introduction to hadoop and hdfsIntroduction to hadoop and hdfs
Introduction to hadoop and hdfs
 
HDFS Design Principles
HDFS Design PrinciplesHDFS Design Principles
HDFS Design Principles
 
Hadoop training in hyderabad-kellytechnologies
Hadoop training in hyderabad-kellytechnologiesHadoop training in hyderabad-kellytechnologies
Hadoop training in hyderabad-kellytechnologies
 
DFSNov1.pptx
DFSNov1.pptxDFSNov1.pptx
DFSNov1.pptx
 
Big data interview questions and answers
Big data interview questions and answersBig data interview questions and answers
Big data interview questions and answers
 
Apache hadoop and hive
Apache hadoop and hiveApache hadoop and hive
Apache hadoop and hive
 
Hadoop distributed file system
Hadoop distributed file systemHadoop distributed file system
Hadoop distributed file system
 
HDFS.ppt
HDFS.pptHDFS.ppt
HDFS.ppt
 
Hadoop architecture by ajay
Hadoop architecture by ajayHadoop architecture by ajay
Hadoop architecture by ajay
 
Hadoop training in bangalore-kellytechnologies
Hadoop training in bangalore-kellytechnologiesHadoop training in bangalore-kellytechnologies
Hadoop training in bangalore-kellytechnologies
 
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
DataStax | Building a Spark Streaming App with DSE File System (Rocco Varela)...
 
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
 
Big data with HDFS and Mapreduce
Big data  with HDFS and MapreduceBig data  with HDFS and Mapreduce
Big data with HDFS and Mapreduce
 
Hadoop -HDFS.ppt
Hadoop -HDFS.pptHadoop -HDFS.ppt
Hadoop -HDFS.ppt
 
Hdfs architecture
Hdfs architectureHdfs architecture
Hdfs architecture
 
HDFS.ppt
HDFS.pptHDFS.ppt
HDFS.ppt
 
Hadoop
HadoopHadoop
Hadoop
 

Último

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 

Último (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 

Hadoop HDFS Concepts

  • 2. www.protechskills.com Protechskills Topics Covered  Design Goals  Hadoop Blocks  Rack Awareness, Replica Placement & Selection  Permissions Model  Anatomy of a File Write / Read on HDFS  FileSystem Image and Edit Logs  HDFS Check Pointing Process  Directory Structure - NameNode, Secondary NameNode , DataNode  Safe Mode
  • 3. www.protechskills.com Protechskills HDFS Design Goals  Hardware Failure - Detection of faults and quick, automatic recovery  Streaming Data Access - High throughput of data access (Batch Processing of data)  Large Data Sets - Gigabytes to terabytes in size.  Simple Coherency Model – Write once read many access model for files  Moving computation is cheaper than moving data
  • 4. www.protechskills.com Protechskills NameNode Datanode_1 Datanode_2 Datanode_3 HDFS Block 1 HDFS Block 2 HDFS Block 3 Block 4 Storage & Replication of Blocks in HDFS Filedividedintoblocks Block 1 Block 2 Block 3 Block 4
  • 5. www.protechskills.com Protechskills Blocks  Minimum amount of data that can be read or write - 64 MB by default  Minimize the cost of seeks  A file can be larger than any single disk in the network  Simplifies the storage subsystem – Same size & eliminating metadata concerns  Provides fault tolerance and availability
  • 6. www.protechskills.com Protechskills Hadoop Rack Awareness  Get maximum performance out of Hadoop cluster  To provide reliable storage when dealing with DataNode failure issues.  Resolution of the slave's DNS name (also IP address) to a rack id.  Interface provided in Hadoop DNSToSwitchMapping, Default implementation is ScriptBasedMapping Rack Topology - /rack1 & /rack2
  • 7. www.protechskills.com Protechskills HADOOP_CONF={${HADOOP_HOME}/conf while [ $# -gt 0 ] ; do nodeArg=$1 exec< ${HADOOP_CONF}/topology.data result="" while read line ; do ar=( $line ) if [ "${ar[0]}" = "$nodeArg" ] ; then result="${ar[1]}" fi done shift if [ -z "$result" ] ; then echo -n "/default/rack " else echo -n "$result " fi done Sample Script 192.168.56.101 /dc1/rack1 192.168.56.102 /dc1/rack2 192.168.56.103 /dc1/rack2 Sample Data (topology.data) Rack Awareness Configuration File : hdfs-site.xml Property : topology.node.switch.mapping.impl Default Value : ScriptBasedMapping class Property : topology.script.file.name Value : <Absolute path to script file> Sample Command : ./topology.sh 192.168.56.101 Output : /dc1/rack1 Ref Hadoop Wiki http://wiki.apache.org/hadoop/topology_rack_awareness_scripts
  • 8. www.protechskills.com Protechskills Replica Placement  Critical to HDFS reliability and performance  Improve data reliability, availability, and network bandwidth utilization Distance b/w Hadoop Client and DataNode Same Node : d=0 Same Rack : d=2 Same Data Centre different rack : d=4 Different Data Centre : d=6
  • 9. www.protechskills.com Protechskills Replica Placement cont.. Default Strategy : a) First replica on the same node as the client. b) Second replica is placed on a different rack from the first (off-rack) chosen at random c) Third replica is placed on the same rack as the second, but on a different node chosen at random. d) Further replicas are placed on random nodes on the cluster Replica Selection - HDFS tries to satisfy a read request from a replica that is closest to the reader.
  • 10. www.protechskills.com Protechskills Permissions Model  Directory or file flag, permissions, replication, owner, group, file size, modification date, and full path.  User Name : ‘whoami’  Group List : ‘bash -c groups’  Super-User & Web Server
  • 11. www.protechskills.com Protechskills Anatomy of a File Write  Client creates the file by calling create() method  NameNode validates & processes the create request  Spilt file into packets (DataQueue)  DataStreamer asks NameNode for block / node mapping & pipelines are created among nodes.
  • 12. www.protechskills.com Protechskills Anatomy of a File Write (cont..)  DataStreamer streams the packets to the first DataNode  DataNode forwards the copied packet to the next DataNode in the pipeline  DFSOutputStream also maintains the ack queue and removes the packets after receiving acknowledgement from the DataNodes  Client calls close() on the stream
  • 13. www.protechskills.com Protechskills Anatomy of a File Read  Client calls open() on the FileSystem object  DistributedFileSystem calls the NameNode to determine the locations of the blocks  NameNode validates request & for each block returns the list of DataNodes.  DistributedFileSystem returns an input stream that supports file seeks to the client
  • 14. www.protechskills.com Protechskills Anatomy of a File Read (cont..)  Client calls read() on the stream  When the end of the block is reached, DFSInputStream will close the connection to the DataNode, then find the best DataNode for the next block.  Client calls close() on the stream
  • 15. www.protechskills.com Protechskills FileSystem Image and Edit Logs  fsimage file is a persistent checkpoint of the file-system metadata  When a client performs a write operation, it is first recorded in the edit log.  The NameNode also has an in-memory representation of the files-ystem metadata, which it updates after the edit log has been modified  Secondary NameNode is used to produce checkpoints of the primary’s in- memory files-ystem metadata
  • 16. www.protechskills.com Protechskills Check Pointing Process  Secondary NameNode asks the primary to roll its edits file, so new edits go to a new file.  NameNode sends the fsimage and edits (using HTTP GET).  Secondary NameNode loads fsimage into memory, applies each operation from edits, then creates a new consolidated fsimage file.  Secondary NameNode sends the new fsimage back to the primary (using HTTP POST).  Primary replaces the old fsimage with the new one. Updates the fstime file to record the time for checkpoint.
  • 17. www.protechskills.com Protechskills Directory Structure NameNode (On NameNode only) ${dfs.name.dir}/current/VERSION /edits /fsimage /fstime Secondary NameNode (On SecNameNode Only) ${fs.checkpoint.dir}/current/VERSION /edits /fsimage /fstime /previous.checkpoint/VERSION /edits /fsimage /fstime DataNode (On all DataNodes) ${dfs.data.dir}/current/VERSION /blk_<id_1> /blk_<id_1>.meta /blk_<id_2> /blk_<id_2>.meta /... /blk_<id_64> /blk_<id_64>.meta /subdir0/ /subdir1/ /... Block Count for a directory dfs.datanode.numblocks property
  • 18. www.protechskills.com Protechskills Safe Mode  On start-up, NameNode loads its image file (fsimage) into memory and applies the edits from the edit log (edits).  It does the check pointing process itself. without recourse to the Secondary NameNode.  Namenode is running in safe mode (offers only a read-only view to clients)  The locations of blocks in the system are not persisted by the NameNode - this information resides with the DataNodes, in the form of a list of the blocks it is storing.  Safe mode is needed to give the DataNodes time to check in to the NameNode with their block lists  Safe mode is exited when the minimal replication condition is reached, plus an extension time of 30 seconds.
  • 19. www.protechskills.com Protechskills Safe Mode Properties Property Type Default Value Description dfs.safemode.threshold.pct float 0.999 The proportion of blocks in the system that must meet the minimum replication level defined by dfs.replication.min before the namenode will exit safe mode. Setting this value to 0 or less forces the namenode not to start in safe mode. Setting this value to more than 1 means the namenode never exits safe mode. dfs.safemode.extension int 30, 000 The time, in milliseconds, to extend safe mode by after the minimum replication condition defined by dfs.safemode.threshold.pct has been satisfied. For small clusters (tens of nodes), it can be set to 0. Syntax : hadoop dfsadmin –safemode [Options] Options : get / wait / enter / leave Safe Mode Commands Options
  • 20. www.protechskills.com Protechskills References  Hadoop Apache Website – http://hadoop.apache.org/  Hadoop The Definitive Guide 3rd Edition By Oreilly