Lightning-fast cluster computing
Problem
이런데가 있어요.
Problem
게다가 전 세계에 이런 게 퍼져있다고 합시다
● 왜 저런 환경을 만들었을까?
Problem
Problem
● 이런 서비스를 저런 환경에서 돌릴라면 어떻
게 해야 해야 하지?
o SQL도 돌려야 하고
o 실시간으로 데이타 흐름도 파악해야 하고
o 하다보면 그런저런 데이타 분석도 자동화 해야 하고
…..
Problem
Solution
공밀레 공밀레?
Solution
MapReduce?
● 참고자료
모든 일을 MapReduce화 하라!
근데 이런 SQL을 어떻
게 MapReduce로 만들
지?
SELECT LAT_N, CITY,
TEMP_F
FROM STATS, STATION
WHERE MONTH = 7
AND STATS.ID =
STATION.ID
ORDER BY TEMP_F;
모든 일을 MapReduce화 하라!
이런 Machine
learning/Data 분석 업
무는?
“지난 2007년부터 매월 나
오는 전국 부동산 실거래가
정보에서 영향을 미칠 수 있
는 변수 140개중에 의미있
는 변수 5개만 뽑아.”
“아, 마감은 내일이다.”
코드도 이정도면 뭐? (단순히 단어 세는 코드가…)
package org.myorg;
import java.io.IOException;
import java.util.*;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
public class WordCount {
public static class Map extends Mapper<LongWritable, Text, Text, IntWritable> {
private final static IntWritable one = new IntWritable(1);
private Text word = new Text();
public void map(LongWritable key, Text value, Context context) throws IOException,
InterruptedException {
String line = value.toString();
StringTokenizer tokenizer = new StringTokenizer(line);
while (tokenizer.hasMoreTokens()) {
word.set(tokenizer.nextToken());
context.write(word, one);
}
}
}
public static class Reduce extends Reducer<Text, IntWritable, Text, IntWritable> {
public void reduce(Text key, Iterable<IntWritable> values, Context context)
throws IOException, InterruptedException {
int sum = 0;
for (IntWritable val : values) {
sum += val.get();
}
context.write(key, new IntWritable(sum));
}
}
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
Job job = new Job(conf, "wordcount");
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
job.waitForCompletion(true);
}
근데 너 이 코드 저 서버실에 다 깔아야 한다.
신도 울고 나도 울었다…..
원래 세월이 가면 연장은 좋아지는 법
Spark등장
“그냥 있는 대로 일 주
세요. 처리는 제가 알
아서 할께요.”
SQL도
“그냥 있는 대로 일 주
세요. 처리는 제가 알
아서 할께요.”
실시간 데이타 처리
“그냥 있는 대로 일 주
세요. 처리는 제가 알
아서 할께요.”
Machine learning도
“그냥 있는 대로 일 주
세요. 처리는 제가 알
아서 할께요.”
Generality
High-level tool들 아래
에서 모든 일들을 있는
그대로 하게 해줍니다.
쓰기 쉽습니다.
Java, Scala, Python을
지원합니다.
text_file =
spark.textFile("hdfs://...")
text_file.flatMap(lambda line:
line.split())
.map(lambda word: (word,
1))
.reduceByKey(lambda a, b:
a+b)
Word count in Spark's Python API
온갖 분산처리 환경에서 다 돌아갑니다.
● Hadoop, Mesos, 혼
자서도, Cloud에서
도 돌아요.
● HDFS, Cassandra,
HBase, S3등에서
데이타도 가져올 수
있어요.
속도도 빠릅니다.
Hadoop MapReduce
를 Memory에서 올렸
을 때보다 100배, Disk
에서 돌렸을 때의 10배
빠릅니다.
Logistic regression in
Hadoop and Spark
자체 Web UI까지 있어요….
Zeppelin
아예 Reporting
tool까지… [Video]
Spark은 말이죠
● Tool이에요, Library 아닙니다.
o 이 Tool위에 하고 싶은 일들을 정의하고
o 실행시키는 겁니다.
Spark 설치하기
● 일일이 말하기 귀찮아요. 아래 보세요.
o 설치방법
 http://bcho.tistory.com/1024
o 아예 Vagrant로 만들어 놨어요. 빌드도 다
해요.
 https://bitbucket.org/JinhoYoo_Nomad
Connection/spark_test_vm
근데 이거 가지고 뭐할라고?
이런거 만들게요.
http://engineering.vcnc.co.kr
/2015/05/data-analysis-with-
spark/
Line+게임보안 시스템
https://www.imaso.co.
kr/news/article_view.p
hp?article_idx=20150
519094003
Small demo
오늘은 여기까지
다음번에 실체를 보여드릴께요. 질문!

More Related Content

PDF
Spark 소개 2부
PPTX
Map reduce 기본 설명
PDF
Spark은 왜 이렇게 유명해지고 있을까?
PDF
하둡 맵리듀스 훑어보기
PDF
스사모 테크톡 - Apache Flink 둘러보기
PDF
Zeppelin notebook 만들기
PDF
Storm 훑어보기
PPT
Hadoop Introduction (1.0)
Spark 소개 2부
Map reduce 기본 설명
Spark은 왜 이렇게 유명해지고 있을까?
하둡 맵리듀스 훑어보기
스사모 테크톡 - Apache Flink 둘러보기
Zeppelin notebook 만들기
Storm 훑어보기
Hadoop Introduction (1.0)

What's hot (20)

PDF
하둡 좋은약이지만 만병통치약은 아니다
PPTX
[113]how can realm_make_efficient_mobile_database
PDF
Java 초보자를 위한 hadoop 설정
PPTX
20140522 uc집계 정민철_발표자료_최종
PPTX
introduce of Hadoop map reduce
PDF
Hive begins
PDF
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)
PPTX
하둡 설치(의사분산모드)
PPTX
하둡 타입과 포맷
PPTX
Data pipeline and data lake
PDF
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
PDF
Mapreduce tuning
PDF
스타트업사례로 본 로그 데이터분석 : Tajo on AWS
PDF
[244] 분산 환경에서 스트림과 배치 처리 통합 모델
PDF
Apache sqoop
PDF
Spark Day 2017@Seoul(Spark Bootcamp)
PDF
Chapter3 - learning spark
PDF
Pair RDD - Spark
PDF
엘라스틱서치 클러스터로 수십억 건의 데이터 운영하기
KEY
Distributed Programming Framework, hadoop
하둡 좋은약이지만 만병통치약은 아니다
[113]how can realm_make_efficient_mobile_database
Java 초보자를 위한 hadoop 설정
20140522 uc집계 정민철_발표자료_최종
introduce of Hadoop map reduce
Hive begins
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)
하둡 설치(의사분산모드)
하둡 타입과 포맷
Data pipeline and data lake
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
Mapreduce tuning
스타트업사례로 본 로그 데이터분석 : Tajo on AWS
[244] 분산 환경에서 스트림과 배치 처리 통합 모델
Apache sqoop
Spark Day 2017@Seoul(Spark Bootcamp)
Chapter3 - learning spark
Pair RDD - Spark
엘라스틱서치 클러스터로 수십억 건의 데이터 운영하기
Distributed Programming Framework, hadoop
Ad

Similar to Spark 소개 1부 (20)

PPTX
불어오는 변화의 바람, From c++98 to c++11, 14
PDF
miss_pattern_v2
PDF
KTH_Detail day_화성에서 온 개발자 금성에서 온 기획자 시리즈_5차_데이터분석_조범석_20120613
PDF
함수적 사고 2장
PDF
[SOPT] 데이터 구조 및 알고리즘 스터디 - #01 : 개요, 점근적 복잡도, 배열, 연결리스트
PPTX
Pyconkr2019 features for using python like matlab
PPTX
Java8 람다
PPTX
함수형 프로그래밍
PPTX
Java mentoring of samsung scsc 2
PPTX
온라인 게임에서 사례로 살펴보는 디버깅 in NDC10
PPTX
온라인 게임에서 사례로 살펴보는 디버깅 in NDC2010
PDF
[Main Session] 미래의 Java 미리보기 - 앰버와 발할라 프로젝트를 중심으로
PDF
Java.next
PDF
한국 커뮤니티 데이 트랙2, 세션2 JavaScript 성능향상과 Sencha
PPTX
11_빠른 개발 가능한 레벨 편집 시스템
PPTX
Startup JavaScript 5 - 객체(Date, RegExp, Object, Global)
PDF
Node.js 현재와 미래
PDF
[WELC] 22. I Need to Change a Monster Method and I Can’t Write Tests for It
PDF
7가지 동시성 모델 - 데이터 병렬성
PDF
HI-ARC PS 101
불어오는 변화의 바람, From c++98 to c++11, 14
miss_pattern_v2
KTH_Detail day_화성에서 온 개발자 금성에서 온 기획자 시리즈_5차_데이터분석_조범석_20120613
함수적 사고 2장
[SOPT] 데이터 구조 및 알고리즘 스터디 - #01 : 개요, 점근적 복잡도, 배열, 연결리스트
Pyconkr2019 features for using python like matlab
Java8 람다
함수형 프로그래밍
Java mentoring of samsung scsc 2
온라인 게임에서 사례로 살펴보는 디버깅 in NDC10
온라인 게임에서 사례로 살펴보는 디버깅 in NDC2010
[Main Session] 미래의 Java 미리보기 - 앰버와 발할라 프로젝트를 중심으로
Java.next
한국 커뮤니티 데이 트랙2, 세션2 JavaScript 성능향상과 Sencha
11_빠른 개발 가능한 레벨 편집 시스템
Startup JavaScript 5 - 객체(Date, RegExp, Object, Global)
Node.js 현재와 미래
[WELC] 22. I Need to Change a Monster Method and I Can’t Write Tests for It
7가지 동시성 모델 - 데이터 병렬성
HI-ARC PS 101
Ad

Spark 소개 1부

  • 3. Problem 게다가 전 세계에 이런 게 퍼져있다고 합시다
  • 4. ● 왜 저런 환경을 만들었을까? Problem
  • 6. ● 이런 서비스를 저런 환경에서 돌릴라면 어떻 게 해야 해야 하지? o SQL도 돌려야 하고 o 실시간으로 데이타 흐름도 파악해야 하고 o 하다보면 그런저런 데이타 분석도 자동화 해야 하고 ….. Problem
  • 9. 모든 일을 MapReduce화 하라! 근데 이런 SQL을 어떻 게 MapReduce로 만들 지? SELECT LAT_N, CITY, TEMP_F FROM STATS, STATION WHERE MONTH = 7 AND STATS.ID = STATION.ID ORDER BY TEMP_F;
  • 10. 모든 일을 MapReduce화 하라! 이런 Machine learning/Data 분석 업 무는? “지난 2007년부터 매월 나 오는 전국 부동산 실거래가 정보에서 영향을 미칠 수 있 는 변수 140개중에 의미있 는 변수 5개만 뽑아.” “아, 마감은 내일이다.”
  • 11. 코드도 이정도면 뭐? (단순히 단어 세는 코드가…) package org.myorg; import java.io.IOException; import java.util.*; import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.*; import org.apache.hadoop.io.*; import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; public class WordCount { public static class Map extends Mapper<LongWritable, Text, Text, IntWritable> { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { String line = value.toString(); StringTokenizer tokenizer = new StringTokenizer(line); while (tokenizer.hasMoreTokens()) { word.set(tokenizer.nextToken()); context.write(word, one); } } } public static class Reduce extends Reducer<Text, IntWritable, Text, IntWritable> { public void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException { int sum = 0; for (IntWritable val : values) { sum += val.get(); } context.write(key, new IntWritable(sum)); } } public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Job job = new Job(conf, "wordcount"); job.setOutputKeyClass(Text.class); job.setOutputValueClass(IntWritable.class); job.setMapperClass(Map.class); job.setReducerClass(Reduce.class); job.setInputFormatClass(TextInputFormat.class); job.setOutputFormatClass(TextOutputFormat.class); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); job.waitForCompletion(true); }
  • 12. 근데 너 이 코드 저 서버실에 다 깔아야 한다.
  • 13. 신도 울고 나도 울었다…..
  • 14. 원래 세월이 가면 연장은 좋아지는 법
  • 15. Spark등장 “그냥 있는 대로 일 주 세요. 처리는 제가 알 아서 할께요.”
  • 16. SQL도 “그냥 있는 대로 일 주 세요. 처리는 제가 알 아서 할께요.”
  • 17. 실시간 데이타 처리 “그냥 있는 대로 일 주 세요. 처리는 제가 알 아서 할께요.”
  • 18. Machine learning도 “그냥 있는 대로 일 주 세요. 처리는 제가 알 아서 할께요.”
  • 19. Generality High-level tool들 아래 에서 모든 일들을 있는 그대로 하게 해줍니다.
  • 20. 쓰기 쉽습니다. Java, Scala, Python을 지원합니다. text_file = spark.textFile("hdfs://...") text_file.flatMap(lambda line: line.split()) .map(lambda word: (word, 1)) .reduceByKey(lambda a, b: a+b) Word count in Spark's Python API
  • 21. 온갖 분산처리 환경에서 다 돌아갑니다. ● Hadoop, Mesos, 혼 자서도, Cloud에서 도 돌아요. ● HDFS, Cassandra, HBase, S3등에서 데이타도 가져올 수 있어요.
  • 22. 속도도 빠릅니다. Hadoop MapReduce 를 Memory에서 올렸 을 때보다 100배, Disk 에서 돌렸을 때의 10배 빠릅니다. Logistic regression in Hadoop and Spark
  • 23. 자체 Web UI까지 있어요….
  • 25. Spark은 말이죠 ● Tool이에요, Library 아닙니다. o 이 Tool위에 하고 싶은 일들을 정의하고 o 실행시키는 겁니다.
  • 26. Spark 설치하기 ● 일일이 말하기 귀찮아요. 아래 보세요. o 설치방법  http://bcho.tistory.com/1024 o 아예 Vagrant로 만들어 놨어요. 빌드도 다 해요.  https://bitbucket.org/JinhoYoo_Nomad Connection/spark_test_vm
  • 27. 근데 이거 가지고 뭐할라고? 이런거 만들게요. http://engineering.vcnc.co.kr /2015/05/data-analysis-with- spark/
  • 30. 오늘은 여기까지 다음번에 실체를 보여드릴께요. 질문!