CS 345A Data Mining. MapReduce

Similar documents
CS 345A Data Mining. MapReduce

Outline. Distributed File System Map-Reduce The Computational Model Map-Reduce Algorithm Evaluation Computing Joins

Clustering Lecture 8: MapReduce

Programming Systems for Big Data

CmpE 138 Spring 2011 Special Topics L2

MapReduce. Stony Brook University CSE545, Fall 2016

PLATFORM AND SOFTWARE AS A SERVICE THE MAPREDUCE PROGRAMMING MODEL AND IMPLEMENTATIONS

Parallel Programming Principle and Practice. Lecture 10 Big Data Processing with MapReduce

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Introduction to MapReduce (cont.)

Big Data Management and NoSQL Databases

MapReduce: Recap. Juliana Freire & Cláudio Silva. Some slides borrowed from Jimmy Lin, Jeff Ullman, Jerome Simeon, and Jure Leskovec

Map Reduce. Yerevan.

Parallel Programming Concepts

Principles of Data Management. Lecture #16 (MapReduce & DFS for Big Data)

PARALLEL DATA PROCESSING IN BIG DATA SYSTEMS

CS246: Mining Massive Datasets Jure Leskovec, Stanford University

CS427 Multicore Architecture and Parallel Computing

Parallel Nested Loops

Parallel Partition-Based. Parallel Nested Loops. Median. More Join Thoughts. Parallel Office Tools 9/15/2011

CSE Lecture 11: Map/Reduce 7 October Nate Nystrom UTA

MI-PDB, MIE-PDB: Advanced Database Systems

Introduction to MapReduce

CS 61C: Great Ideas in Computer Architecture. MapReduce

Databases 2 (VU) ( )

CS 138: Google. CS 138 XVI 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

CS 138: Google. CS 138 XVII 1 Copyright 2016 Thomas W. Doeppner. All rights reserved.

Map Reduce Group Meeting

Systems Infrastructure for Data Science. Web Science Group Uni Freiburg WS 2013/14

Introduction to MapReduce

The Google File System. Alexandru Costan

Motivation. Map in Lisp (Scheme) Map/Reduce. MapReduce: Simplified Data Processing on Large Clusters

The amount of data increases every day Some numbers ( 2012):

Google File System (GFS) and Hadoop Distributed File System (HDFS)

2/26/2017. The amount of data increases every day Some numbers ( 2012):

The MapReduce Abstraction

MapReduce: Simplified Data Processing on Large Clusters 유연일민철기

CS370 Operating Systems

L22: SC Report, Map Reduce

CS6030 Cloud Computing. Acknowledgements. Today s Topics. Intro to Cloud Computing 10/20/15. Ajay Gupta, WMU-CS. WiSe Lab

Jeffrey D. Ullman Stanford University

Introduction to MapReduce

The Google File System

Introduction to Map Reduce

CS /5/18. Paul Krzyzanowski 1. Credit. Distributed Systems 18. MapReduce. Simplest environment for parallel processing. Background.

Yuval Carmel Tel-Aviv University "Advanced Topics in Storage Systems" - Spring 2013

CIS 601 Graduate Seminar Presentation Introduction to MapReduce --Mechanism and Applicatoin. Presented by: Suhua Wei Yong Yu

Map-Reduce. Marco Mura 2010 March, 31th

Introduction to MapReduce

Google File System. Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung Google fall DIP Heerak lim, Donghun Koo

MapReduce. U of Toronto, 2014

The Google File System

Systems Infrastructure for Data Science. Web Science Group Uni Freiburg WS 2012/13

Distributed Systems. 18. MapReduce. Paul Krzyzanowski. Rutgers University. Fall 2015

Announcements. Optional Reading. Distributed File System (DFS) MapReduce Process. MapReduce. Database Systems CSE 414. HW5 is due tomorrow 11pm

Parallel Computing: MapReduce Jin, Hai

Distributed File Systems II

Database Systems CSE 414

CLOUD-SCALE FILE SYSTEMS

The Google File System

The Google File System

Introduction to MapReduce. Adapted from Jimmy Lin (U. Maryland, USA)

CA485 Ray Walshe Google File System

Distributed Filesystem

MapReduce & BigTable

MapReduce Simplified Data Processing on Large Clusters

Map-Reduce (PFP Lecture 12) John Hughes

MapReduce. Cloud Computing COMP / ECPE 293A

ΕΠΛ 602:Foundations of Internet Technologies. Cloud Computing

Where We Are. Review: Parallel DBMS. Parallel DBMS. Introduction to Data Management CSE 344

18-hdfs-gfs.txt Thu Oct 27 10:05: Notes on Parallel File Systems: HDFS & GFS , Fall 2011 Carnegie Mellon University Randal E.

Authors : Sanjay Ghemawat, Howard Gobioff, Shun-Tak Leung Presentation by: Vijay Kumar Chalasani

Map Reduce.

BigData and Map Reduce VITMAC03

TI2736-B Big Data Processing. Claudia Hauff

GOOGLE FILE SYSTEM: MASTER Sanjay Ghemawat, Howard Gobioff and Shun-Tak Leung

Distributed Computations MapReduce. adapted from Jeff Dean s slides

Improving the MapReduce Big Data Processing Framework

CS MapReduce. Vitaly Shmatikov

Map-Reduce. John Hughes

Distributed File Systems. Directory Hierarchy. Transfer Model

MapReduce: Simplified Data Processing on Large Clusters

Google File System. By Dinesh Amatya

Introduction to Hadoop. Owen O Malley Yahoo!, Grid Team

Batch Processing Basic architecture

Introduction to MapReduce

ECE5610/CSC6220 Introduction to Parallel and Distribution Computing. Lecture 6: MapReduce in Parallel Computing

Introduction to MapReduce

1. Introduction to MapReduce

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Distributed Systems 16. Distributed File Systems II

MapReduce & Resilient Distributed Datasets. Yiqing Hua, Mengqi(Mandy) Xia

Hadoop/MapReduce Computing Paradigm

Map-Reduce and Related Systems

The Google File System

MapReduce-style data processing

goals monitoring, fault tolerance, auto-recovery (thousands of low-cost machines) handle appends efficiently (no random writes & sequential reads)

Distributed Systems. Lec 10: Distributed File Systems GFS. Slide acks: Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung

PSON: A Parallelized SON Algorithm with MapReduce for Mining Frequent Sets

Cloud Programming. Programming Environment Oct 29, 2015 Osamu Tatebe

Transcription:

CS 345A Data Mining MapReduce

Single-node architecture CPU Machine Learning, Statistics Memory Classical Data Mining Disk

Commodity Clusters Web data sets can be very large Tens to hundreds of terabytes Cannot mine on a single server (why?) Standard architecture emerging: Cluster of commodity Linux nodes Gigabit ethernet interconnect How to organize computations on this architecture? Mask issues such as hardware failure

Cluster Architecture 1 Gbps between any pair of nodes in a rack Switch 2-10 Gbps backbone between racks Switch Switch CPU CPU CPU CPU Mem Mem Mem Mem Disk Disk Disk Disk Each rack contains 16-64 nodes

Stable storage First order problem: if nodes can fail, how can we store data persistently? Answer: Distributed File System Provides global file namespace Google GFS; Hadoop HDFS; Kosmix KFS Typical usage pattern Huge files (100s of GB to TB) Data is rarely updated in place Reads and appends are common

Distributed File System Chunk Servers File is split into contiguous chunks Typically each chunk is 16-64MB Each chunk replicated (usually 2x or 3x) Try to keep replicas in different racks Master node a.k.a. Name Nodes in HDFS Stores metadata Might be replicated Client library for file access Talks to master to find chunk servers Connects directly to chunkservers to access data

Warm up: Word Count We have a large file of words, one word to a line Count the number of times each distinct word appears in the file Sample application: analyze web server logs to find popular URLs

Word Count (2) Case 1: Entire file fits in memory Case 2: File too large for mem, but all <word, count> pairs fit in mem Case 3: File on disk, too many distinct words to fit in memory sort datafile uniq c

Word Count (3) To make it slightly harder, suppose we have a large corpus of documents Count the number of times each distinct word occurs in the corpus words(docs/*) sort uniq -c where words takes a file and outputs the words in it, one to a line The above captures the essence of MapReduce Great thing is it is naturally parallelizable

MapReduce Input: a set of key/value pairs User supplies two functions: map(k,v) list(k1,v1) reduce(k1, list(v1)) v2 (k1,v1) is an intermediate key/value pair Output is the set of (k1,v2) pairs

Word Count using MapReduce map(key, value): // key: document name; value: text of document for each word w in value: emit(w, 1) reduce(key, values): // key: a word; value: an iterator over counts result = 0 for each count v in values: result += v emit(result)

Distributed Execution Overview User Program fork fork fork assign map Master assign reduce Input Data Split 0 Split 1 Split 2 read Worker Worker Worker local write remote read, sort Worker Worker write Output File 0 Output File 1

Data flow Input, final output are stored on a distributed file system Scheduler tries to schedule map tasks close to physical storage location of input data Intermediate results are stored on local FS of map and reduce workers Output is often input to another map reduce task

Coordination Master data structures Task status: (idle, in-progress, completed) Idle tasks get scheduled as workers become available When a map task completes, it sends the master the location and sizes of its R intermediate files, one for each reducer Master pushes this info to reducers Master pings workers periodically to detect failures

Failures Map worker failure Map tasks completed or in-progress at worker are reset to idle Reduce workers are notified when task is rescheduled on another worker Reduce worker failure Only in-progress tasks are reset to idle Master failure MapReduce task is aborted and client is notified

How many Map and Reduce jobs? M map tasks, R reduce tasks Rule of thumb: Make M and R much larger than the number of nodes in cluster One DFS chunk per map is common Improves dynamic load balancing and speeds recovery from worker failure Usually R is smaller than M, because output is spraed across R files

Combiners Often a map task will produce many pairs of the form (k,v1), (k,v2), for the same key k E.g., popular words in Word Count Can save network time by preaggregating at mapper combine(k1, list(v1)) v2 Usually same as reduce function Works only if reduce function is commutative and associative

Partition Function Inputs to map tasks are created by contiguous splits of input file For reduce, we need to ensure that records with the same intermediate key end up at the same worker System uses a default partition function e.g., hash(key) mod R Sometimes useful to override E.g., hash(hostname(url)) mod R ensures URLs from a host end up in the same output file

Exercise 1: Host size Suppose we have a large web corpus Let s look at the metadata file Lines of the form (URL, size, date, ) For each host, find the total number of bytes i.e., the sum of the page sizes for all URLs from that host

Exercise 2: Distributed Grep Find all occurrences of the given pattern in a very large set of files

Exercise 3: Graph reversal Given a directed graph as an adjacency list: src1: dest11, dest12, src2: dest21, dest22, Construct the graph in which all the links are reversed

Exercise 4: Frequent Pairs Given a large set of market baskets, find all frequent pairs Remember definitions from Association Rules lectures

Hadoop An open-source implementation of Map Reduce in Java Uses HDFS for stable storage Download from: http://lucene.apache.org/hadoop/

Reading Jeffrey Dean and Sanjay Ghemawat, MapReduce: Simplified Data Processing on Large Clusters http://labs.google.com/papers/mapreduce.html Sanjay Ghemawat, Howard Gobioff, and Shun- Tak Leung, The Google File System http://labs.google.com/papers/gfs.html