Question? Leave a message!




Hadoop Technical Introduction

Hadoop Technical Introduction 31
LottieBarners Profile Pic
LottieBarners,Hawaii,Researcher
Published Date:12-07-2017
Website URL
Comment
Lecture 3 – Hadoop Technical Introduction CSE 490HAnnouncements  My office hours: M 2:30—3:30 in CSE 212  Cluster is operational; instructions in assignment 1 heavily rewritten  Eclipse plugin is “deprecated”  Students who already created accounts: let me know if you have troubleBreaking news  Hadoop tested on 4,000 node cluster 32K cores (8 / node) 16 PB raw storage (4 x 1 TB disk / node) (about 5 PB usable storage)  http://developer.yahoo.com/blogs/hadoop/2008/09/ scaling_hadoop_to_4000_nodes_a.htmlYou Say, “tomato…” Google calls it: Hadoop equivalent: MapReduce Hadoop GFS HDFS Bigtable HBase Chubby ZookeeperSome MapReduce Terminology  Job – A “full program” - an execution of a Mapper and Reducer across a data set  Task – An execution of a Mapper or a Reducer on a slice of data a.k.a. Task-In-Progress (TIP)  Task Attempt – A particular instance of an attempt to execute a task on a machineTerminology Example  Running “Word Count” across 20 files is one job  20 files to be mapped imply 20 map tasks + some number of reduce tasks  At least 20 map task attempts will be performed… more if a machine crashes, etc.Task Attempts  A particular task will be attempted at least once, possibly more times if it crashes  If the same input causes crashes over and over, that input will eventually be abandoned  Multiple attempts at one task may occur in parallel with speculative execution turned on  Task ID from TaskInProgress is not a unique identifier; don’t use it that wayMapReduce: High Level                             Node-to-Node Communication  Hadoop uses its own RPC protocol  All communication begins in slave nodes Prevents circular-wait deadlock Slaves periodically poll for “status” message  Classes must provide explicit serialization Nodes, Trackers, Tasks  Master node runs JobTracker instance, which accepts Job requests from clients  TaskTracker instances run on slave nodes  TaskTracker forks separate Java process for task instancesJob Distribution  MapReduce programs are contained in a Java “jar” file + an XML file containing serialized program configuration options  Running a MapReduce job places these files into the HDFS and notifies TaskTrackers where to retrieve the relevant program code  … Where’s the data distribution?Data Distribution  Implicit in design of MapReduce All mappers are equivalent; so map whatever data is local to a particular node in HDFS  If lots of data does happen to pile up on the same node, nearby nodes will map instead Data transfer is handled implicitly by HDFSConfiguring With JobConf  MR Programs have many configurable options  JobConf objects hold (key, value) components mapping String  ’a  e.g., “mapred.map.tasks” 20  JobConf is serialized and distributed before running the job  Objects implementing JobConfigurable can retrieve elements from a JobConfWhat Happens In MapReduce? Depth FirstJob Launch Process: Client  Client program creates a JobConf Identify classes implementing Mapper and Reducer interfaces  JobConf.setMapperClass(), setReducerClass() Specify inputs, outputs  FileInputFormat.addInputPath(),  FileOutputFormat.setOutputPath() Optionally, other options too:  JobConf.setNumReduceTasks(), JobConf.setOutputFormat()…Job Launch Process: JobClient  Pass JobConf to JobClient.runJob() or submitJob() runJob() blocks, submitJob() does not  JobClient: Determines proper division of input into InputSplits Sends job data to master JobTracker serverJob Launch Process: JobTracker  JobTracker: Inserts jar and JobConf (serialized to XML) in shared location Posts a JobInProgress to its run queueJob Launch Process: TaskTracker  TaskTrackers running on slave nodes periodically query JobTracker for work  Retrieve job-specific jar and config  Launch task in separate instance of Java main() is provided by HadoopJob Launch Process: Task  TaskTracker.Child.main(): Sets up the child TaskInProgress attempt Reads XML configuration Connects back to necessary MapReduce components via RPC Uses TaskRunner to launch user processJob Launch Process: TaskRunner  TaskRunner, MapTaskRunner, MapRunner work in a daisy-chain to launch your Mapper Task knows ahead of time which InputSplits it should be mapping Calls Mapper once for each record retrieved from the InputSplit  Running the Reducer is much the same