Map reduce

26
MAP REDUCE PATTERN 아키텍트를 꿈꾸는 사람들 오전반 스터디 (cafe.naver.com/architect1) 전효성([email protected] ) 1 2010년 7월 17일 토요일

Transcript of Map reduce

Page 1: Map reduce

MAP REDUCE PATTERN아키텍트를 꿈꾸는 사람들 오전반 스터디

(cafe.naver.com/architect1)

전효성([email protected])

12010년 7월 17일 토요일

Page 2: Map reduce

정의

22010년 7월 17일 토요일

Page 3: Map reduce

주요 기능

• Automatic parallelization & distribution

• Fault-tolerant

• Provides status and monitoring tools

• Clean abstraction for programmers

32010년 7월 17일 토요일

Page 4: Map reduce

MAP REDUCE 구현사례• Google

• 최초로 Map reduce 패턴 제시

• Page rank, crawler, google map과 같은 다수의 서비스에 적용

• Hadoop

• 리눅스 환경의 오픈소스 구현

• 자바로 Map function, reduce function 구현

• Qizmt

• 윈도우 환경의 오픈소스 구현

• C# 스크립트로 Map function, reduce function 구현

• etc

• C++, C#, Java, Haskell으로 구현한 사례가 있음

• http://en.wikipedia.org/wiki/MapReduce 참조

42010년 7월 17일 토요일

Page 5: Map reduce

MAP 함수

map f lst: (’a->’b) -> (’a list) -> (’b list) 입력 리스트의 각 구성요소에 f함수를 적용하여 새로운 리스트를 만든다. 원래의 데이터를 가공하여 <key, value>형식으로 가공한다.

52010년 7월 17일 토요일

Page 6: Map reduce

REDUCE 함수(= fold, accumulate, compress, inject)

fold f x0 lst: ('a*'b->'b)->'b->('a list)->'b 리스트를 순회하면서, f 함수를 적용하여

accumulator에 값을 갱신하는 것. 동일한 key값을 가진 value들을 reduce함수를 통하여 가공한다.

62010년 7월 17일 토요일

Page 7: Map reduce

MAPREDUCE를 사용한다는 것은?

•아래와 같은 부분을 정의하고 구현한다는 것.

• Input format

• Input location

• Map function

• Reduce function

• Output format

• Output location

CHAPTER 2 THE BASICS OF A MAPREDUCE JOB28

Shuffle, Partition/Sortper Map Output

Merge Sort forMap Outputs for Each

Reduce Task

Start of IndividualReduce Tasks

Collection of Final Output

Start of Individual Map Tasks

Input Splitting &Distribution

Job Configuration

Provided by UserProvided by Hadoop

Framework

Input Format

Input Locations

Map Function

Reduce Function

Output Format

Output Location

Number ofReduce Tasks

OutputKey Type

OutputValue Type

Figure 2-1. Parts of a MapReduce job

The user is responsible for handling the job setup, specifying the input location(s), speci-fying the input, and ensuring the input is in the expected format and location. The framework is responsible for distributing the job among the TaskTracker nodes of the cluster; running the map, shuffle, sort, and reduce phases; placing the output in the output directory; and inform-ing the user of the job-completion status.

All the examples in this chapter are based on the file , shown in Listing 2-1. The job created by the code in will read all of its textual input line by line, and sort the lines based on that portion of the line before the first tab char-acter. If there are no tab characters in the line, the sort will be based on the entire line. The

file is structured to provide a simple example of configuring and running a MapReduce job.

72010년 7월 17일 토요일

Page 8: Map reduce

MAP REDUCE 논리적 흐름

Key에 의해 정렬

Input Shuffle OutputMap Reduce

1. 각각의 조각마다 map()적용

2. map()안에서 중간값(key,val) pairs를 전달

같은 key에 속하는 데이터 리스트에 reduce()적용

Reduce된 결과들의 리스트 모음데이터 조각들

Logical Flow

82010년 7월 17일 토요일

Page 9: Map reduce

MAP REDUCE 물리적 흐름

Physical Flow

92010년 7월 17일 토요일

Page 10: Map reduce

MAP REDUCE 물리적 흐름

Physical FlowJob

92010년 7월 17일 토요일

Page 11: Map reduce

어떠한 문제를 풀 수 있을까?

PROGRAM Map function Reduce function

Distributed Grep matched lines pass

Reverse Web link graph <target, source> <target, list(src)>

URL접근빈도 세기 <URL, 1> <URL, total count>

Term-Vector per Host <hostname, term-vector> <hostname, all-term-vector>

Inverted Index <word, doc id> <word, list(doc id)>

Distributed Sort <key,value> pass

102010년 7월 17일 토요일

Page 12: Map reduce

내부 매커니즘112010년 7월 17일 토요일

Page 13: Map reduce

CLUSTER 구성 - HADOOP

• Master

• Name node

• Job tracker

• Slave( =Worker )

• Data node

• Task tracker

CHAPTER 3 THE BASICS OF MULTIMACHINE CLUSTERS80

Enable Job Control Options on the Web InterfacesBoth the JobTracker and the NameNode provide a web interface for monitoring and con-trol. By default, the JobTracker provides web service on and the NameNode provides web service on . If the

parameter is set to , the JobTracker web interface will add Kill This Job and Change Job Priority options to the per-job detail page. The default location of these addi-tional options is the bottom-left corner of the page (so you usually need to scroll down the page to see them).

A Sample Cluster ConfigurationIn this section, we will walk through a simple configuration of a six-node Hadoop cluster. The cluster will be composed of six machines: , , , , , and

. The JobTracker and NameNode will reside on the machine , and a secondary NameNode will be placed on . The DataNodes and TaskTrackers will be colocated on the same machines, and the nodes will be named through . Figure 3-2 shows this setup.

NameNodehttp://master:50070/

JobTrackerhttp://master:50030/

Master Slave01

Datanode

Tasktracker

Slave02

Datanode

Tasktracker

Slave03

Datanode

Tasktracker

Slave04

Datanode

Tasktracker

Slave05

DataNode

TaskTracker

Figure 3-2. A simple six-node cluster

The standard machine configuration is usually an eight-CPU machine with 8GB of RAM, and a hardware RAID controller presenting a single partition to the operating system. This configuration is the favorite of IT departments. The single partition presentation is not ideal for Hadoop Core, as there is no opportunity to segregate the I/O for MapReduce and for HDFS.

Configuration RequirementsThis configuration will require the customization of several files in the directory and com-pliance with some simple network requirements. The user that will own the Hadoop processes must also be determined.

Network RequirementsHadoop Core uses Secure Shell (SSH) to launch the server processes on the slave nodes. Hadoop Core requires that passwordless SSH work between the master machines and all of the slave and secondary machines.

122010년 7월 17일 토요일

Page 14: Map reduce

MAP REDUCE 실행 흐름 - GOOGLE

1. 입력파일을 16MB ~ 64MB로 분할한다. 분할된 조각들은 각각의 클러스터로 복사된다.

2. 분할된 조각들은 하나의 Master조각과 나머지 조각들로 구성된다. Worker클러스터들은 Master노드에 의해 작업 지시(map task, reduce task)를 받는다. master는 idle worker를 찾아내서 일을 시킨다.

3. Map task를 할당받은 worker는 받은 조각 파일을 사용자가 정의한 map 함수에 의해 처리하여 immediate key/value pair로 변환하여 버퍼에 저장한다.

4. 버퍼에 들어간 pair는 주기적으로 로컬 디스크에 저장이 되고, 분할 함수에 의해 Reduce 영역으로 분할된다. 로컬 디스크에 보관된 pair들은 master로 위치가 넘겨진다. master는 map worker와 가장 가까운 거리에 있는 reduce worker에게 위치를 포워딩 한다.

5. reduce worker가 master로부터 위치를 통보 받으면, RPC를 이용하여 map worker의 buffered data( immediate key/value pairs )를 읽는다. 읽은 데이터들은 immediate key에 의해 정렬된다. 이 데이터들은 메모리에 전부 안 올라갈 정도로 용량이 크기 때문에 external sort를 사용한다.

6. reduce worker는 정렬된 중간 데이터들을 순회하고, 각각의 유니크한 중간 키를 센다. 이 과정에서 중간 키와 대응되는 값들이 reduce 함수를 통과한다. reduce함수의 출력값은 최종 출력 파일에 더해진다( 여전히 조각난 상태 )

7. 모든 map 작업과 reduce작업이 끝나면, 마스터는 user program을 깨우고, 이 시점에 사용자프로그램 내의 MapReduce호출은 끝이난다.

132010년 7월 17일 토요일

Page 15: Map reduce

데이터의 분배는 누가 담당하나?

•분산 파일 시스템(DFS)

• Google Map reduce - Bigtable

• Hadoop - HBase

• Hypertable ( commercial )

142010년 7월 17일 토요일

Page 16: Map reduce

EXAMPLE SOURCE CODEGoogle Mapreduce example

Word count

152010년 7월 17일 토요일

Page 17: Map reduce

EXAMPLE - WORDCOUNT

[9] S. Gorlatch. Systematic efficient parallelization of scanand other list homomorphisms. In L. Bouge, P. Fraigni-aud, A. Mignotte, and Y. Robert, editors, Euro-Par’96.Parallel Processing, Lecture Notes in Computer Science1124, pages 401–408. Springer-Verlag, 1996.

[10] Jim Gray. Sort benchmark home page.http://research.microsoft.com/barc/SortBenchmark/.

[11] William Gropp, Ewing Lusk, and Anthony Skjellum.Using MPI: Portable Parallel Programming with theMessage-Passing Interface. MIT Press, Cambridge, MA,1999.

[12] L. Huston, R. Sukthankar, R. Wickremesinghe, M. Satya-narayanan, G. R. Ganger, E. Riedel, and A. Ailamaki. Di-amond: A storage architecture for early discard in inter-active search. In Proceedings of the 2004 USENIX Fileand Storage Technologies FAST Conference, April 2004.

[13] Richard E. Ladner and Michael J. Fischer. Parallel prefixcomputation. Journal of the ACM, 27(4):831–838, 1980.

[14] Michael O. Rabin. Efficient dispersal of information forsecurity, load balancing and fault tolerance. Journal ofthe ACM, 36(2):335–348, 1989.

[15] Erik Riedel, Christos Faloutsos, Garth A. Gibson, andDavid Nagle. Active disks for large-scale data process-ing. IEEE Computer, pages 68–74, June 2001.

[16] Douglas Thain, Todd Tannenbaum, and Miron Livny.Distributed computing in practice: The Condor experi-ence. Concurrency and Computation: Practice and Ex-perience, 2004.

[17] L. G. Valiant. A bridging model for parallel computation.Communications of the ACM, 33(8):103–111, 1997.

[18] Jim Wyllie. Spsort: How to sort a terabyte quickly.http://alme1.almaden.ibm.com/cs/spsort.pdf.

A Word Frequency

This section contains a program that counts the numberof occurrences of each unique word in a set of input filesspecified on the command line.

#include "mapreduce/mapreduce.h"

// User’s map functionclass WordCounter : public Mapper {public:virtual void Map(const MapInput& input) {const string& text = input.value();const int n = text.size();for (int i = 0; i < n; ) {// Skip past leading whitespacewhile ((i < n) && isspace(text[i]))i++;

// Find word endint start = i;while ((i < n) && !isspace(text[i]))i++;

if (start < i)Emit(text.substr(start,i-start),"1");

}}

};REGISTER_MAPPER(WordCounter);

// User’s reduce functionclass Adder : public Reducer {virtual void Reduce(ReduceInput* input) {// Iterate over all entries with the// same key and add the valuesint64 value = 0;while (!input->done()) {value += StringToInt(input->value());input->NextValue();

}

// Emit sum for input->key()Emit(IntToString(value));

}};REGISTER_REDUCER(Adder);

int main(int argc, char** argv) {ParseCommandLineFlags(argc, argv);

MapReduceSpecification spec;

// Store list of input files into "spec"for (int i = 1; i < argc; i++) {MapReduceInput* input = spec.add_input();input->set_format("text");input->set_filepattern(argv[i]);input->set_mapper_class("WordCounter");

}

// Specify the output files:// /gfs/test/freq-00000-of-00100// /gfs/test/freq-00001-of-00100// ...MapReduceOutput* out = spec.output();out->set_filebase("/gfs/test/freq");out->set_num_tasks(100);out->set_format("text");out->set_reducer_class("Adder");

// Optional: do partial sums within map// tasks to save network bandwidthout->set_combiner_class("Adder");

// Tuning parameters: use at most 2000// machines and 100 MB of memory per taskspec.set_machines(2000);spec.set_map_megabytes(100);spec.set_reduce_megabytes(100);

// Now run itMapReduceResult result;if (!MapReduce(spec, &result)) abort();

// Done: ’result’ structure contains info// about counters, time taken, number of// machines used, etc.

return 0;}

To appear in OSDI 2004 13

[9] S. Gorlatch. Systematic efficient parallelization of scanand other list homomorphisms. In L. Bouge, P. Fraigni-aud, A. Mignotte, and Y. Robert, editors, Euro-Par’96.Parallel Processing, Lecture Notes in Computer Science1124, pages 401–408. Springer-Verlag, 1996.

[10] Jim Gray. Sort benchmark home page.http://research.microsoft.com/barc/SortBenchmark/.

[11] William Gropp, Ewing Lusk, and Anthony Skjellum.Using MPI: Portable Parallel Programming with theMessage-Passing Interface. MIT Press, Cambridge, MA,1999.

[12] L. Huston, R. Sukthankar, R. Wickremesinghe, M. Satya-narayanan, G. R. Ganger, E. Riedel, and A. Ailamaki. Di-amond: A storage architecture for early discard in inter-active search. In Proceedings of the 2004 USENIX Fileand Storage Technologies FAST Conference, April 2004.

[13] Richard E. Ladner and Michael J. Fischer. Parallel prefixcomputation. Journal of the ACM, 27(4):831–838, 1980.

[14] Michael O. Rabin. Efficient dispersal of information forsecurity, load balancing and fault tolerance. Journal ofthe ACM, 36(2):335–348, 1989.

[15] Erik Riedel, Christos Faloutsos, Garth A. Gibson, andDavid Nagle. Active disks for large-scale data process-ing. IEEE Computer, pages 68–74, June 2001.

[16] Douglas Thain, Todd Tannenbaum, and Miron Livny.Distributed computing in practice: The Condor experi-ence. Concurrency and Computation: Practice and Ex-perience, 2004.

[17] L. G. Valiant. A bridging model for parallel computation.Communications of the ACM, 33(8):103–111, 1997.

[18] Jim Wyllie. Spsort: How to sort a terabyte quickly.http://alme1.almaden.ibm.com/cs/spsort.pdf.

A Word Frequency

This section contains a program that counts the numberof occurrences of each unique word in a set of input filesspecified on the command line.

#include "mapreduce/mapreduce.h"

// User’s map functionclass WordCounter : public Mapper {public:virtual void Map(const MapInput& input) {const string& text = input.value();const int n = text.size();for (int i = 0; i < n; ) {// Skip past leading whitespacewhile ((i < n) && isspace(text[i]))i++;

// Find word endint start = i;while ((i < n) && !isspace(text[i]))i++;

if (start < i)Emit(text.substr(start,i-start),"1");

}}

};REGISTER_MAPPER(WordCounter);

// User’s reduce functionclass Adder : public Reducer {virtual void Reduce(ReduceInput* input) {// Iterate over all entries with the// same key and add the valuesint64 value = 0;while (!input->done()) {value += StringToInt(input->value());input->NextValue();

}

// Emit sum for input->key()Emit(IntToString(value));

}};REGISTER_REDUCER(Adder);

int main(int argc, char** argv) {ParseCommandLineFlags(argc, argv);

MapReduceSpecification spec;

// Store list of input files into "spec"for (int i = 1; i < argc; i++) {MapReduceInput* input = spec.add_input();input->set_format("text");input->set_filepattern(argv[i]);input->set_mapper_class("WordCounter");

}

// Specify the output files:// /gfs/test/freq-00000-of-00100// /gfs/test/freq-00001-of-00100// ...MapReduceOutput* out = spec.output();out->set_filebase("/gfs/test/freq");out->set_num_tasks(100);out->set_format("text");out->set_reducer_class("Adder");

// Optional: do partial sums within map// tasks to save network bandwidthout->set_combiner_class("Adder");

// Tuning parameters: use at most 2000// machines and 100 MB of memory per taskspec.set_machines(2000);spec.set_map_megabytes(100);spec.set_reduce_megabytes(100);

// Now run itMapReduceResult result;if (!MapReduce(spec, &result)) abort();

// Done: ’result’ structure contains info// about counters, time taken, number of// machines used, etc.

return 0;}

To appear in OSDI 2004 13

[9] S. Gorlatch. Systematic efficient parallelization of scanand other list homomorphisms. In L. Bouge, P. Fraigni-aud, A. Mignotte, and Y. Robert, editors, Euro-Par’96.Parallel Processing, Lecture Notes in Computer Science1124, pages 401–408. Springer-Verlag, 1996.

[10] Jim Gray. Sort benchmark home page.http://research.microsoft.com/barc/SortBenchmark/.

[11] William Gropp, Ewing Lusk, and Anthony Skjellum.Using MPI: Portable Parallel Programming with theMessage-Passing Interface. MIT Press, Cambridge, MA,1999.

[12] L. Huston, R. Sukthankar, R. Wickremesinghe, M. Satya-narayanan, G. R. Ganger, E. Riedel, and A. Ailamaki. Di-amond: A storage architecture for early discard in inter-active search. In Proceedings of the 2004 USENIX Fileand Storage Technologies FAST Conference, April 2004.

[13] Richard E. Ladner and Michael J. Fischer. Parallel prefixcomputation. Journal of the ACM, 27(4):831–838, 1980.

[14] Michael O. Rabin. Efficient dispersal of information forsecurity, load balancing and fault tolerance. Journal ofthe ACM, 36(2):335–348, 1989.

[15] Erik Riedel, Christos Faloutsos, Garth A. Gibson, andDavid Nagle. Active disks for large-scale data process-ing. IEEE Computer, pages 68–74, June 2001.

[16] Douglas Thain, Todd Tannenbaum, and Miron Livny.Distributed computing in practice: The Condor experi-ence. Concurrency and Computation: Practice and Ex-perience, 2004.

[17] L. G. Valiant. A bridging model for parallel computation.Communications of the ACM, 33(8):103–111, 1997.

[18] Jim Wyllie. Spsort: How to sort a terabyte quickly.http://alme1.almaden.ibm.com/cs/spsort.pdf.

A Word Frequency

This section contains a program that counts the numberof occurrences of each unique word in a set of input filesspecified on the command line.

#include "mapreduce/mapreduce.h"

// User’s map functionclass WordCounter : public Mapper {public:virtual void Map(const MapInput& input) {const string& text = input.value();const int n = text.size();for (int i = 0; i < n; ) {// Skip past leading whitespacewhile ((i < n) && isspace(text[i]))i++;

// Find word endint start = i;while ((i < n) && !isspace(text[i]))i++;

if (start < i)Emit(text.substr(start,i-start),"1");

}}

};REGISTER_MAPPER(WordCounter);

// User’s reduce functionclass Adder : public Reducer {virtual void Reduce(ReduceInput* input) {// Iterate over all entries with the// same key and add the valuesint64 value = 0;while (!input->done()) {value += StringToInt(input->value());input->NextValue();

}

// Emit sum for input->key()Emit(IntToString(value));

}};REGISTER_REDUCER(Adder);

int main(int argc, char** argv) {ParseCommandLineFlags(argc, argv);

MapReduceSpecification spec;

// Store list of input files into "spec"for (int i = 1; i < argc; i++) {MapReduceInput* input = spec.add_input();input->set_format("text");input->set_filepattern(argv[i]);input->set_mapper_class("WordCounter");

}

// Specify the output files:// /gfs/test/freq-00000-of-00100// /gfs/test/freq-00001-of-00100// ...MapReduceOutput* out = spec.output();out->set_filebase("/gfs/test/freq");out->set_num_tasks(100);out->set_format("text");out->set_reducer_class("Adder");

// Optional: do partial sums within map// tasks to save network bandwidthout->set_combiner_class("Adder");

// Tuning parameters: use at most 2000// machines and 100 MB of memory per taskspec.set_machines(2000);spec.set_map_megabytes(100);spec.set_reduce_megabytes(100);

// Now run itMapReduceResult result;if (!MapReduce(spec, &result)) abort();

// Done: ’result’ structure contains info// about counters, time taken, number of// machines used, etc.

return 0;}

To appear in OSDI 2004 13

[9] S. Gorlatch. Systematic efficient parallelization of scanand other list homomorphisms. In L. Bouge, P. Fraigni-aud, A. Mignotte, and Y. Robert, editors, Euro-Par’96.Parallel Processing, Lecture Notes in Computer Science1124, pages 401–408. Springer-Verlag, 1996.

[10] Jim Gray. Sort benchmark home page.http://research.microsoft.com/barc/SortBenchmark/.

[11] William Gropp, Ewing Lusk, and Anthony Skjellum.Using MPI: Portable Parallel Programming with theMessage-Passing Interface. MIT Press, Cambridge, MA,1999.

[12] L. Huston, R. Sukthankar, R. Wickremesinghe, M. Satya-narayanan, G. R. Ganger, E. Riedel, and A. Ailamaki. Di-amond: A storage architecture for early discard in inter-active search. In Proceedings of the 2004 USENIX Fileand Storage Technologies FAST Conference, April 2004.

[13] Richard E. Ladner and Michael J. Fischer. Parallel prefixcomputation. Journal of the ACM, 27(4):831–838, 1980.

[14] Michael O. Rabin. Efficient dispersal of information forsecurity, load balancing and fault tolerance. Journal ofthe ACM, 36(2):335–348, 1989.

[15] Erik Riedel, Christos Faloutsos, Garth A. Gibson, andDavid Nagle. Active disks for large-scale data process-ing. IEEE Computer, pages 68–74, June 2001.

[16] Douglas Thain, Todd Tannenbaum, and Miron Livny.Distributed computing in practice: The Condor experi-ence. Concurrency and Computation: Practice and Ex-perience, 2004.

[17] L. G. Valiant. A bridging model for parallel computation.Communications of the ACM, 33(8):103–111, 1997.

[18] Jim Wyllie. Spsort: How to sort a terabyte quickly.http://alme1.almaden.ibm.com/cs/spsort.pdf.

A Word Frequency

This section contains a program that counts the numberof occurrences of each unique word in a set of input filesspecified on the command line.

#include "mapreduce/mapreduce.h"

// User’s map functionclass WordCounter : public Mapper {public:virtual void Map(const MapInput& input) {const string& text = input.value();const int n = text.size();for (int i = 0; i < n; ) {// Skip past leading whitespacewhile ((i < n) && isspace(text[i]))i++;

// Find word endint start = i;while ((i < n) && !isspace(text[i]))i++;

if (start < i)Emit(text.substr(start,i-start),"1");

}}

};REGISTER_MAPPER(WordCounter);

// User’s reduce functionclass Adder : public Reducer {virtual void Reduce(ReduceInput* input) {// Iterate over all entries with the// same key and add the valuesint64 value = 0;while (!input->done()) {value += StringToInt(input->value());input->NextValue();

}

// Emit sum for input->key()Emit(IntToString(value));

}};REGISTER_REDUCER(Adder);

int main(int argc, char** argv) {ParseCommandLineFlags(argc, argv);

MapReduceSpecification spec;

// Store list of input files into "spec"for (int i = 1; i < argc; i++) {MapReduceInput* input = spec.add_input();input->set_format("text");input->set_filepattern(argv[i]);input->set_mapper_class("WordCounter");

}

// Specify the output files:// /gfs/test/freq-00000-of-00100// /gfs/test/freq-00001-of-00100// ...MapReduceOutput* out = spec.output();out->set_filebase("/gfs/test/freq");out->set_num_tasks(100);out->set_format("text");out->set_reducer_class("Adder");

// Optional: do partial sums within map// tasks to save network bandwidthout->set_combiner_class("Adder");

// Tuning parameters: use at most 2000// machines and 100 MB of memory per taskspec.set_machines(2000);spec.set_map_megabytes(100);spec.set_reduce_megabytes(100);

// Now run itMapReduceResult result;if (!MapReduce(spec, &result)) abort();

// Done: ’result’ structure contains info// about counters, time taken, number of// machines used, etc.

return 0;}

To appear in OSDI 2004 13

162010년 7월 17일 토요일

Page 18: Map reduce

QIZMTQizmt - Map reduce framework on Windows

172010년 7월 17일 토요일

Page 19: Map reduce

QIZMT FEATURES

182010년 7월 17일 토요일

Page 20: Map reduce

CORE MYSPACE QIZMT FEATURES• C# 스크립트로 mapreducer job 개발• 쉬운 설치• Built-in IDE/Debugger• 모든 클러스터의 머신에서 mapreducer job을 수정/디버깅/실행/관리 가능• Delta-only exchange option for Mapreduce jobs• 특정 데이터 / 머신이 장애를 일으켰을 때 예외 처리 가능• Easily add machines to a cluster to increase processing power and capacity• CAC (Cluster Assembly Cache) for exposing .Net DLLs to mapreduce jobs• 세 종류의 Job지원

◦ Mapreduce - 대용량의 데이터를 처리하는 로직◦ Remote - 문제 상황 발생시 처리 방법( 데이터 형식이 맞지 않는 경우 )◦ Local - For orchestrating a pipeline of Mapreducer and Remote jobs

• 노드 교환시 데이터 정렬 방법들◦ Sorted - Shuffle단계에서 Key로 정렬( 다른 노드로 데이터 이동시 )◦ Grouped - 정렬 안함◦ Hashsorted - core수에 맞게 hashtable 구성, Key가 랜덤일때 빠르다.

Sorted / Grouped / Hashsorted

Input Shuffle OutputMap Reduce

1. 각각의 조각마다 map()적용

2. map()안에서 중간값(key,val) pairs를 전달

같은 key에 속하는 데이터 리스트에 reduce()적용

Reduce된 결과들의 리스트 모음데이터 조각들

192010년 7월 17일 토요일

Page 21: Map reduce

EXAMPLE - WORD COUNT

202010년 7월 17일 토요일

Page 22: Map reduce

QIZMT EXAMPLE

WORDCOUNT

212010년 7월 17일 토요일

Page 23: Map reduce

222010년 7월 17일 토요일

Page 24: Map reduce

느낀점• Hadoop

• 리눅스 환경에 적합

• 자바와 C++로 map, reduce함수 작성 가능

• But, cygwin환경에서 불안정하다는 말이 있음

• Qizmt

• 처음 설치시 계정이름이 ‘컴퓨터이름\아이디’인줄 모르고 삽질함.

• 커맨드라인 기반

• Master노드가 없다. 모든 노드가 관리자

• 간단한 IDE를 제공한다. 약간의 디버깅도 가능

• 분산파일시스템 탐색기가 있었으면 좋겠다.

• 개인적인 학습의 용도로 적당함 - 튜토리얼 풍부

232010년 7월 17일 토요일

Page 25: Map reduce

Q&A

242010년 7월 17일 토요일

Page 26: Map reduce

252010년 7월 17일 토요일