Lecture 3-1 Computer Science 425 Distributed Systems CS 425 / ECE 428 Fall 2013 Indranil Gupta (Indy) Sep 3, 2013 Lecture 3 Cloud Computing - 2  2013,

Slides:



Advertisements
Similar presentations
Lecture 12: MapReduce: Simplified Data Processing on Large Clusters Xiaowei Yang (Duke University)
Advertisements

Intro to Map-Reduce Feb 21, map-reduce? A programming model or abstraction. A novel way of thinking about designing a solution to certain problems…
LIBRA: Lightweight Data Skew Mitigation in MapReduce
Mapreduce and Hadoop Introduce Mapreduce and Hadoop
CS246 TA Session: Hadoop Tutorial Peyman kazemian 1/11/2011.
Intro to Map-Reduce Feb 4, map-reduce? A programming model or abstraction. A novel way of thinking about designing a solution to certain problems…
CS 525 Advanced Distributed Systems Spring 2015 Indranil Gupta (Indy) Lecture 3 Cloud Computing (Contd.) January 27, 2015 All slides © IG 1.
Distributed Computations
CS 345A Data Mining MapReduce. Single-node architecture Memory Disk CPU Machine Learning, Statistics “Classical” Data Mining.
Google’s Map Reduce. Commodity Clusters Web data sets can be very large – Tens to hundreds of terabytes Cannot mine on a single server Standard architecture.
An Introduction to MapReduce: Abstractions and Beyond! -by- Timothy Carlstrom Joshua Dick Gerard Dwan Eric Griffel Zachary Kleinfeld Peter Lucia Evan May.
MapReduce Dean and Ghemawat. MapReduce: Simplified Data Processing on Large Clusters. Communications of the ACM, Vol. 51, No. 1, January Shahram.
Homework 2 In the docs folder of your Berkeley DB, have a careful look at documentation on how to configure BDB in main memory. In the docs folder of your.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 3: Mapreduce and Hadoop All slides © IG.
Distributed Computations MapReduce
7/14/2015EECS 584, Fall MapReduce: Simplied Data Processing on Large Clusters Yunxing Dai, Huan Feng.
L22: SC Report, Map Reduce November 23, Map Reduce What is MapReduce? Example computing environment How it works Fault Tolerance Debugging Performance.
Introduction to Google MapReduce WING Group Meeting 13 Oct 2006 Hendra Setiawan.
Lecture 2 – MapReduce CPE 458 – Parallel Programming, Spring 2009 Except as otherwise noted, the content of this presentation is licensed under the Creative.
MapReduce : Simplified Data Processing on Large Clusters Hongwei Wang & Sihuizi Jin & Yajing Zhang
Google Distributed System and Hadoop Lakshmi Thyagarajan.
Lecture 3-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) Sep 4, 2012 Lecture 3 Cloud Computing -
Advanced Topics: MapReduce ECE 454 Computer Systems Programming Topics: Reductions Implemented in Distributed Frameworks Distributed Key-Value Stores Hadoop.
SIDDHARTH MEHTA PURSUING MASTERS IN COMPUTER SCIENCE (FALL 2008) INTERESTS: SYSTEMS, WEB.
Lecture 3-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2010 Indranil Gupta (Indy) August 31, 2010 Lecture 3  2010, I. Gupta.
MapReduce.
Introduction to Parallel Programming MapReduce Except where otherwise noted all portions of this work are Copyright (c) 2007 Google and are licensed under.
MapReduce. Web data sets can be very large – Tens to hundreds of terabytes Cannot mine on a single server Standard architecture emerging: – Cluster of.
Google MapReduce Simplified Data Processing on Large Clusters Jeff Dean, Sanjay Ghemawat Google, Inc. Presented by Conroy Whitney 4 th year CS – Web Development.
Jeffrey D. Ullman Stanford University. 2 Chunking Replication Distribution on Racks.
Map Reduce for data-intensive computing (Some of the content is adapted from the original authors’ talk at OSDI 04)
MapReduce: Simplified Data Processing on Large Clusters Jeffrey Dean and Sanjay Ghemawat.
MapReduce and Hadoop 1 Wu-Jun Li Department of Computer Science and Engineering Shanghai Jiao Tong University Lecture 2: MapReduce and Hadoop Mining Massive.
1 The Map-Reduce Framework Compiled by Mark Silberstein, using slides from Dan Weld’s class at U. Washington, Yaniv Carmeli and some other.
MapReduce: Hadoop Implementation. Outline MapReduce overview Applications of MapReduce Hadoop overview.
HAMS Technologies 1
Map Reduce: Simplified Processing on Large Clusters Jeffrey Dean and Sanjay Ghemawat Google, Inc. OSDI ’04: 6 th Symposium on Operating Systems Design.
MAP REDUCE : SIMPLIFIED DATA PROCESSING ON LARGE CLUSTERS Presented by: Simarpreet Gill.
MapReduce How to painlessly process terabytes of data.
MapReduce M/R slides adapted from those of Jeff Dean’s.
Benchmarking MapReduce-Style Parallel Computing Randal E. Bryant Carnegie Mellon University.
MapReduce Kristof Bamps Wouter Deroey. Outline Problem overview MapReduce o overview o implementation o refinements o conclusion.
CS 345A Data Mining MapReduce. Single-node architecture Memory Disk CPU Machine Learning, Statistics “Classical” Data Mining.
SECTION 5: PERFORMANCE CHRIS ZINGRAF. OVERVIEW: This section measures the performance of MapReduce on two computations, Grep and Sort. These programs.
By Jeff Dean & Sanjay Ghemawat Google Inc. OSDI 2004 Presented by : Mohit Deopujari.
MapReduce: Simplified Data Processing on Large Clusters Lim JunSeok.
Introduction to Hadoop Owen O’Malley Yahoo!, Grid Team Modified by R. Cook.
C-Store: MapReduce Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY May. 22, 2009.
Team3: Xiaokui Shu, Ron Cohen CS5604 at Virginia Tech December 6, 2010.
Map Reduce. Functional Programming Review r Functional operations do not modify data structures: They always create new ones r Original data still exists.
MapReduce: Simplified Data Processing on Large Clusters By Dinesh Dharme.
HADOOP Priyanshu Jha A.D.Dilip 6 th IT. Map Reduce patented[1] software framework introduced by Google to support distributed computing on large data.
MapReduce: Simplied Data Processing on Large Clusters Written By: Jeffrey Dean and Sanjay Ghemawat Presented By: Manoher Shatha & Naveen Kumar Ratkal.
11 Indranil Gupta (Indy) Lecture 3 Cloud Computing Continued January 22, 2013 CS 525 Advanced Distributed Systems Spring 2013 All Slides © IG.
Lecture 4: Mapreduce and Hadoop
Introduction to Google MapReduce
CS 525 Advanced Distributed Systems Spring 2017
Example: Rapid Atmospheric Modeling System, ColoState U
Large-scale file systems and Map-Reduce
Lecture 4: Mapreduce and Hadoop
MapReduce Computing Paradigm Basics Fall 2013 Elke A. Rundensteiner
CS 525 Advanced Distributed Systems Spring 2018
MapReduce Simplied Data Processing on Large Clusters
湖南大学-信息科学与工程学院-计算机与科学系
February 26th – Map/Reduce
Cse 344 May 4th – Map/Reduce.
CS 345A Data Mining MapReduce This presentation has been altered.
Lecture 4: Mapreduce and Hadoop
5/7/2019 Map Reduce Map reduce.
Presentation transcript:

Lecture 3-1 Computer Science 425 Distributed Systems CS 425 / ECE 428 Fall 2013 Indranil Gupta (Indy) Sep 3, 2013 Lecture 3 Cloud Computing - 2  2013, I. Gupta

Lecture 3-2 Recap Last Thursday’s Lecture –Clouds vs. Clusters »At least 3 differences –A Cloudy History of Time »Clouds are the latest in a long generation of distributed systems Today’s Lecture –Cloud Programming: MapReduce (the heart of Hadoop) –Grids

Lecture 3-3 Programming Cloud Applications - New Parallel Programming Paradigms: MapReduce Highly-Parallel Data-Processing Originally designed by Google (OSDI 2004 paper) Open-source version called Hadoop, by Yahoo! –Spun off into startup HortonWorks Hadoop written in Java. Your implementation could be in Java, or any executable Google (MapReduce) –Indexing: a chain of 24 MapReduce jobs –~200K jobs processing 50PB/month (in 2006) Yahoo! (Hadoop + Pig) –WebMap: a chain of 100 MapReduce jobs –280 TB of data, 2500 nodes, 73 hours Annual Hadoop Summit: 2008 had 300 attendees, now close to 1000 attendees

Lecture 3-4 What is MapReduce? Terms are borrowed from Functional Languages (e.g., Lisp) Sum of squares: (map square ‘( )) –Output: ( ) [processes each record sequentially and independently] (reduce + ‘( )) –(+ 16 (+ 9 (+ 4 1) ) ) –Output: 30 [processes set of all records in groups] Let’s consider a sample application: Wordcount –You are given a huge dataset (e.g., collection of webpages) and asked to list the count for each word appearing in the dataset

Lecture 3-5 Map Process individual records to generate intermediate key/value pairs. Welcome Everyone Hello Everyone Welcome1 Everyone1 Hello1 Everyone1 Input KeyValue

Lecture 3-6 Map Parallelly Process individual records to generate intermediate key/value pairs. Welcome Everyone Hello Everyone Welcome1 Everyone1 Hello1 Everyone1 Input MAP TASK 1 MAP TASK 2

Lecture 3-7 Map Parallelly Process a large number of individual records to generate intermediate key/value pairs. Welcome Everyone Hello Everyone Why are you here I am also here They are also here Yes, it’s THEM! The same people we were thinking of ……. Welcome1 Everyone1 Hello1 Everyone1 Why 1 Are1 You1 Here1 ……. Input MAP TASKS

Lecture 3-8 Reduce Processes and merges all intermediate values associated per key (that’s the group) Welcome1 Everyone1 Hello1 Everyone1 Everyone2 Hello1 Welcome1 KeyValue

Lecture 3-9 Reduce Parallelly Processes and merges all intermediate values by partitioning keys Welcome1 Everyone1 Hello1 Everyone1 Everyone2 Hello1 Welcome1 REDUCE TASK 1 REDUCE TASK 2

Lecture 3-10 Hadoop Code - Map public static class MapClass extends MapReduceBase implements Mapper { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); public void map( LongWritable key, Text value, OutputCollector output, Reporter reporter) throws IOException { String line = value.toString(); StringTokenizer itr = new StringTokenizer(line); while (itr.hasMoreTokens()) { word.set(itr.nextToken()); output.collect(word, one); } } // Source:

Lecture 3-11 Hadoop Code - Reduce public static class ReduceClass extends MapReduceBase implements Reducer { public void reduce( Text key, Iterator values, OutputCollector output, Reporter reporter) throws IOException { int sum = 0; while (values.hasNext()) { sum += values.next().get(); } output.collect(key, new IntWritable(sum)); }

Lecture 3-12 Hadoop Code - Driver // Tells Hadoop how to run your Map-Reduce job public void run (String inputPath, String outputPath) throws Exception { // The job. WordCount contains MapClass and Reduce. JobConf conf = new JobConf(WordCount.class); conf.setJobName(”mywordcount"); // The keys are words (strings) conf.setOutputKeyClass(Text.class); // The values are counts (ints) conf.setOutputValueClass(IntWritable.class); conf.setMapperClass(MapClass.class); conf.setReducerClass(ReduceClass.class); FileInputFormat.addInputPath( conf, newPath(inputPath)); FileOutputFormat.setOutputPath( conf, new Path(outputPath)); JobClient.runJob(conf); }

Lecture 3-13 Some Other Applications of MapReduce Distributed Grep: –Input: large set of files –Output: lines that match pattern –Map – Emits a line if it matches the supplied pattern –Reduce – Simply copies the intermediate data (key- value pairs) to output –Partitioner – Default (hash-based)

Lecture 3-14 Some Other Applications of MapReduce (2) Reverse Web-Link Graph –Input: Web graph: tuples (a, b) where (page a  page b) –Output: For each page, list of pages that link to it –Map – process web log and for each it outputs –Reduce - emits –Partitioner – Default (hash-based)

Lecture 3-15 Some Other Applications of MapReduce (3) Count of URL access frequency –Input: Log of accessed URLs from proxy server –Output: For each URL, % of total accesses for that URL (all use default partitioners) –Map – Process web log and outputs –Multiple Reducers - Emits (So far, like Wordcount. But still need %) –Chain another MapReduce job after above one –Map – Processes and outputs )> –1 Reducer task – Sums up URL_count’s to calculate overall_count. Outputs pairs

Lecture 3-16 Some Other Applications of MapReduce (4) Sort –Input: Series of (key, value) pairs –Need Output: Sorted s –Map – -> (identity) –Reducer – -> (identity) –Partitioner – identity. For load-balance, assign equal number of keys to each reduce »Take data distribution into account to split key ranges across reduce tasks Why does this work? –Map task’s output is (always) auto-sorted (e.g., quicksort) –Reduce task’s input is (always) auto-sorted (e.g., mergesort)

Lecture 3-17 Programming MapReduce Externally: For user 1.Write a Map program (short), write a Reduce program (short) 2.Specifiy number of tasks and submit job in configuration; wait for result 3.Need to know practically nothing about parallel/distributed programming! Internally: For the cloud (and for us distributed systems researchers) 1.Parallelize Map 2.Transfer data from Map to Reduce 3.Parallelize Reduce 4.Implement Storage for Map input, Map output, Reduce input, and Reduce output

Lecture 3-18 Inside MapReduce For the cloud (and for us distributed systems researchers) 1.Parallelize Map: easy! Shard the data equally into requested map tasks. 2.Transfer data from Map to Reduce: »All Map output tuples with same key assigned to same Reduce task »use partitioning function: example is to hash the key of the tuple, modulo number of reduce jobs, or identity function for sort 3.Parallelize Reduce: easy! Assign keys uniformly across requested reduce tasks. Reduce task knows its assigned keys (through master). 4.Implement Storage for Map input, Map output, Reduce input, and Reduce output »Map input: from distributed file system »Intermediate data - Map output: to local disk (at Map node); uses local file system »Intermediate data - Reduce input: from (multiple) remote disks; uses local file systems »Reduce output: to distributed file system local file system = Linux FS, etc. distributed file system = GFS (Google File System), HDFS (Hadoop Distributed File System)

Lecture 3-19 Internal Workings of MapReduce - Example From the original MapReduce paper (OSDI 2004)

Lecture 3-20 Barriers and Speculation Hadoop’s internal scheduler runs at master A Reduce task cannot start until all Map tasks done, and all its (Reduce’s) data has been fetched »Barrier between Map phase and Reduce phase »As a result, the slowest Map slows down the entire Map phase (and thus the entire job) »The slowest Reduce slows down the entire Reduce phase (and thus the entire job) Stragglers (slow nodes) –The slowest machine slows the entire job down –Due to Bad Disk, Network Bandwidth, CPU, or Memory –Solution: Speculative Execution. »Keep track of “progress” of each task (% done) »Replicate straggler task on other available machines – fastest machine wins (and other task replicas are then killed)

Lecture 3-21 Etcetera Locality –Needed to avoid network traffic bottlenecks, since cloud has hierarchical topology (e.g., racks) –GFS stores 3 replicas of each of 64MB chunks »Maybe on different racks, e.g., 2 on a rack, 1 on a different rack –Scheduler attempts to schedule a map task on a machine that contains a replica of corresponding input data: why? »Failing this, it tries scheduling map on the same rack as data »Failing this, schedule map task anywhere Failures –Master tracks progress of each task –Similar to speculative execution, reschedules task with stopped progress or on failed machine –Highly simplified explanation here – failure-handling is more sophisticated (next lecture!)

Lecture Grep Workload: 10^ byte records to extract records matching a rare pattern (92K matching records) Testbed: 1800 servers each with 4GB RAM, dual 2GHz Xeon, dual 169 GB IDE disk, 100 Gbps, Gigabit ethernet per machine Locality optimization helps: 1800 machines read 1 TB at peak ~31 GB/s W/out this, rack switches would limit to 10 GB/s Startup overhead is significant for short jobs

Lecture Timesharing Companies & Data Processing Industry 2010 Grids Peer to peer systems Clusters The first datacenters! PCs (not distributed!) Clouds and datacenters “A Cloudy History of Time” © IG 2010

Lecture 3-24 Clouds are data-intensive while … Grids are/were computation-intensive What is a Grid?

Lecture 3-25 Example: Rapid Atmospheric Modeling System, ColoState U Hurricane Georges, 17 days in Sept 1998 –“RAMS modeled the mesoscale convective complex that dropped so much rain, in good agreement with recorded data” –Used 5 km spacing instead of the usual 10 km –Ran on 256+ processors Computation-intensive application rather than data-intensive Can one run such a program without access to a supercomputer?

Lecture 3-26 Wisconsin MIT NCSA Distributed Computing Resources

Lecture 3-27 Output of Job 2 Input to Job 3 An Application Coded by a Physicist Job 0 Job 2 Job 1 Job 3 Output files of Job 0 Input to Job 2 Jobs 1 and 2 can be concurrent

Lecture 3-28 Job 2 Output files of Job 0 Input to Job 2 May take several hours-days 4 stages of a job Init Stage in Execute Stage out Publish Computation Intensive, so Massively Parallel Several GBs An Application Coded by a Physicist Output of Job 2 Input to Job 3

Lecture 3-29 Wisconsin MIT NCSA Job 0 Job 2Job 1 Job 3

Lecture 3-30 Job 0 Job 2Job 1 Job 3 Wisconsin MIT Condor Protocol NCSA Globus Protocol

Lecture 3-31 Job 0 Job 2 Job 1 Job 3 Wisconsin MIT NCSA Globus Protocol Internal structure of different sites invisible to Globus External Allocation & Scheduling Stage in & Stage out of Files

Lecture 3-32 Job 0 Job 3 Wisconsin Condor Protocol Internal Allocation & Scheduling Monitoring Distribution and Publishing of Files

Lecture 3-33 The Grid Recently Some are 40Gbps links. (The TeraGrid links) “A parallel Internet”

Lecture 3-34 Cloud computing vs. Grid computing: what are the differences? Question to Ponder

Lecture 3-35 MP1, HW1 MP1, HW1 out today –MP1 due 9/15 (Sun midnight). Demos soon after (likely Monday 9/16) –HW1 due 9/19 (hand-in at beginning of class) Effort –For HW: Individual effort only. You are allowed to discuss the problem and concepts (e.g., in study groups), but you cannot discuss the solution. –For MP: Groups of 2 students (pair up with someone taking class for same # credits) »If you don’t have an MP partner, hang around after class today (or use Piazza) »Please report groups to us by this Thursday 9/15. Subject line: “425 MP group” to cs425- –Please read instructions carefully! –Start NOW

Lecture 3-36 MP1: Logging + Testing Distributed Systems hard to debug (you’ll know soon!) Creating log files at each machine to tabulate important messages/errors/status is critical to debugging MP1: Write a distributed program that lets you grep (+ regexp’s) all the log files across a set of machines (from any of those machines) Each line is a key-value pair Read the doc – it is very detailed How do you know your program works? –Write unit tests –E.g., Generate non-identical logs at each machine, then run grep from one of them and automatically verify that you receive the answer you expect –Writing tests can be hard work, but it is industry standard –We encourage (but don’t require) that you write tests for MP2 onwards

Lecture 3-37 Readings For next lecture –Failure Detection –Readings: Section 15.1, parts of Section 2.4.2