Date post: | 26-Jan-2015 |
Category: |
Technology |
Upload: | kms-technology |
View: | 113 times |
Download: | 1 times |
AN INTRODUCTION OF
APACHE HADOOP
WHO AM I?
Minh Tran
KMS Technology
Current: Software Architect at KMS Technology
Past: Technical at Yahoo!
Senior Engineer at MobiVi, Sciant, ELCA
Admin at JavaVietnam
OBJECTIVES
• Understand what Apache Hadoop is
• Understand problems Hadoop aims to solve
• Explore Hadoop architecture and its
ecosystem
AGENDA
• Hadoop Overview
• Haddop Architecture at a glance
• Hadoop Ecosystem
• A demo of using Hadoop
AGENDA – HADOOP OVERVIEW
• Big Data & Challenges
• What is Hadoop?
• Hadoop Benefits
• Which problem can Hadoop solve?
• Hadoop Installation
WHY DO WE HAVE SO MUCH
DATA?
• Every single day
– Twitter processes 340 million messages
– Facebook stores 2.7 billion comments and
“Likes”
– Google processes about 24 petabytes of data
• And every single minute
– More than 200 million e-mails are sent
– Foursquare processes more than 2,000
check-ins
WHERE DOES DATA COME FROM?
• Science: medical imaging, sensor data,
genome sequencing, weather data,
satellite feeds, etc.
• Legacy: Sales data, customer behavior,
product databases, accounting data, etc.
• System Data: Log files, network messages,
Web Analytics, intrusion detection, spam
filters • (Not all of this maps cleanly to the relational model)
DATA ANALYSIS CHALLENGE
• Huge volumes of data
• Mixed sources result in many different formats
– XML
– CSV
– EDI
– Log files
– Objects
– SQL
– Text
– JSON
– Binary
– etc.
WHAT IS HADOOP?
• Scalable data storage and processing
– Open source Apache project
– Harnesses the power of commodity servers
– Distributed and fault-tolerant
• “Core” Hadoop consists of two main parts
– HDFS (storage)
– MapReduce (processing)
WHO USES HADOOP?
BENEFITS OF ANALYZING WITH
HADOOP
• Previously impossible/impractical
to do this analysis
• Analysis conducted at lower cost
• Analysis conducted in less time
• Greater flexibility
• Linear scalability
WHICH PROBLEM CAN
HADOOP SOLVE?
• Nature of the data
– Complex & multiple data sources
– Lots of it
• Nature of the analysis
– Batch processing
– Parallel execution
– Spread data over a cluster of servers and take the computation
to the data
• Common Hadoop Problems:
– Customer churn analysis
– Recommendation engine
– PoS transaction analysis
– Threat analysis
– Search quality
– Data “sandbox”
HADOOP INSTALLATION
1. Install a Linux machine, for e.g.: Ubuntu
2. Install latest JDK
3. Install Hadoop package, download at
http://hadoop.apache.org/
AGENDA
• Hadoop Overview
• Haddop Architecture at a glance
• Hadoop Ecosystem
• A demo of using Hadoop
AGENDA - HADDOP ARCHITECTURE
AT A GLANCE
• Hadoop Distributed File System
• How MapReduce works
COLLOCATED STORAGE
AND PROCESSING
• Because 10,000 hard disks are better than one
• Solution: store and process data on the same nodes
– Data locality: “Bring the computation to the data”
– Reduces I/O and boosts performance
HARD DISK LATENCY
• Disk seeks are expensive
• Solution: Read lots of data at once to amortize the cost
HDFS BLOCKS
• When a file is added to HDFS, it’s split into blocks
• This is a similar concept to native file systems
– HDFS uses a much larger block size (64 MB), for
performance
Client application
Hadoop file system client
DataNode 1
C
D
B
DataNode 2
A
C
D
DataNode 3
B
A
C
NameNode
/tmp/file1.txt
Block A
Block B
DataNode 3
DataNode 2
DataNode 1
DataNode 3
Block C DataNode 1
DataNode 2
DataNode 3
HDFS High Level Architecture
HOW MAPREDUCE WORKS?
ANOTHER EXAMPLE ABOUT
BUILDING INVERTED INDEX
• Input: a number of text files
• Output: a list of tuples, where each tuple is a word and a list of files
that contain the word
doc1.txt
cat sat mat
doc2.txt
cat sat dog
Input filenames and contents
Mappers Intermediate
output Reducers
cat, doc1.txt
sat, doc1.txt
mat, doc1.txt
cat, doc2.txt
sat, doc2.txt
dog, doc2.txt
part-r-00000
cat: doc1.txt, doc2.txt
part-r-00001
sat: doc1.txt, doc2.txt dog: doc2.txt
part-r-00002
mat: doc1.txt
Output filenames and contents
AGENDA
• Hadoop Overview
• Haddop Architecture at a glance
• Hadoop Ecosystem
• A demo of using Hadoop
HADOOP ECOSYSTEM
AGENDA
• Hadoop Overview
• Haddop Architecture at a glance
• Hadoop Ecosystem
• A demo of using Hadoop
REFERENCES
• Hadoop In Practice – Alex Homes
• Hadoop Real World Solutions Cookbook – Jonathan R. Owens, Jon
Lentz, Brian Femiano
• Hadoop In Action – Chuck Lam
• Hadoop The Definitive Guide – Tom White
• MapReduce Design Patterns – Donald Miner, Adam Shook
• An Introduction to Hadoop – Mark Fei
• http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-
linux-single-node-cluster/
• http://www.crobak.org/2011/12/getting-started-with-apache-hadoop-
0-23-0/
© 2013 KMS Technology
THANK YOU