GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: Tajo와 SQL-on-HadoopGruter
- 관련 기술 트렌드 소개
- Tajo의 아키텍쳐와 로드맵
Tajo는 Big Data 분석 처리 엔진 분야에서 핫이슈로 부상하고 있는 SQL-on-Hadoop의 차세대 핵심 기술로 Apache Incubation 프로젝트로 등록되어 있는 오픈소스이며, Gruter가 개발을 주도하고 있는 프로젝트입니다.
대형 병원의 교양 세미나에서 발표한 자료입니다.
이미 기술 지식은 충분하셨고 사례를 많이 궁금해 하셨습니다. 그래서 제 경험을 통해 얻었던 인사이트를 많이 나누었습니다. 하지만 의료현장은 플랫폼이나 기술보다는 의료기기로 접근하지 않으면 사용되기 힘들다는 생각이 들었습니다.
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: Tajo와 SQL-on-HadoopGruter
- 관련 기술 트렌드 소개
- Tajo의 아키텍쳐와 로드맵
Tajo는 Big Data 분석 처리 엔진 분야에서 핫이슈로 부상하고 있는 SQL-on-Hadoop의 차세대 핵심 기술로 Apache Incubation 프로젝트로 등록되어 있는 오픈소스이며, Gruter가 개발을 주도하고 있는 프로젝트입니다.
대형 병원의 교양 세미나에서 발표한 자료입니다.
이미 기술 지식은 충분하셨고 사례를 많이 궁금해 하셨습니다. 그래서 제 경험을 통해 얻었던 인사이트를 많이 나누었습니다. 하지만 의료현장은 플랫폼이나 기술보다는 의료기기로 접근하지 않으면 사용되기 힘들다는 생각이 들었습니다.
영문교정업체 에디티지의 친절한 에디박사가 왔습니다.
쉼표의 사용 여부에 따라서 큰 의미 변화가 올 수 있다는 것, 알고 계셨나요? 형용사를 나열한 명사구에서 쉼표 사용에 대해 알아보기 위해 다음의 예시들을 먼저 살펴봅시다.
쉼표가 있는 경우
• a fertile, well-drained, and level piece of land (비옥하고, 배수가 잘 되며, 평평한 토지)
쉼표가 없는 경우
• the cheapest technically feasible solution (가장 저렴하며 기술적으로 실현 가능한 해법)
위 예시들의 공통점은 모두 형용사의 나열을 통해 수식한 명사로 끝나는 구(phrases)라는 점입니다.
그런데, 앞에 나온 예시에서는 쉼표를 사용했지만, 뒤에 나온 예시들에는 쉼표가 없습니다. 왜 그럴까요?
이번 슬라이드를 통해 형용사를 나열한 명사구에서 쉼표의 유무에 따라 어떻게 의미가 달라지는 지 살펴보도록 하겠습니다.
원저논문(Original article)이란 고유한 연구를 다룬 논문으로 과학문헌의 1차 출처이며 고유한 연구를 다룹니다. 저자는 특정 주제에 대한 실험, 관찰 등을 수행한 뒤 그 결과를 원저논문을 통해 보고하게 됩니다. 이번 슬라이드를 통해 원저 논문 쓰기 4단계에 대해 알아보겠습니다.
빅데이터 개념 부터 시작해서 빅데이터 분석 플랫폼의 출현(hadoop)과 스파크의 등장배경까지 풀어서 작성된 spark 소개 자료 입니다.
스파크는 RDD에 대한 개념과 spark SQL 라이브러리에 대한 자료가 조금 자세히 설명 되어있습니다. (텅스텐엔진, 카탈리스트 옵티마이져에 대한 간략한 설명이 있습니다.)
마지막에는 간단한 설치 및 interactive 분석 실습자료가 포함되어 있습니다.
원본 ppt 를 공개해 두었으니 언제 어디서든 필요에 따라 변형하여 사용하시되 출처만 잘 남겨주시면 감사드리겠습니다.
다른 슬라이드나, 블로그에서 사용된 그림과 참고한 자료들은 작게 출처를 표시해두었는데, 본 ppt의 초기버전을 작성하면서 찾았던 일부 자료들은 출처가 불분명한 상태입니다. 자료 출처를 알려주시면 반영하여 수정해 두도록하겠습니다. (제보 부탁드립니다!)
I will make this presentation for seminar of NIPA
For more information of the seminar, please go to http://www.software.kr/user/seminar.mbs?id=swkr_050102000000&command=view&idx=376830
bioinformatics using statistical learning, machine learning and deep learning.
Day 2 and 3 materials from 12 days course, focusing on statistical analysis.
Meta analysis for medical data handling is include.
Outlier detection using machine learning, deep learning as well as statistical analysis.
The slide includes time series analysis. Also included is the hands on exercises with code and data, for a 3-day course.
Arduino, Raspberry Pi, Beagleblack and so on, all are signaling new tide of open source hardware.
In other words, open source is widening from software into hardware.
It will also affect the IOT, Internet of Things, as the major IOT frameworks are also open source based.
8. 배경 – 3V
• Tidal Wave – 3VC
• Supercomputer
– High-throughput computing
– 2가지 방향:
• 원격, 분산형 대규모 컴퓨팅 (grid computing)
• 중앙집중형 (MPP)
• Scale-Up vs. Scale-Out
• BI (Business Intelligence)
– 특히 DW/OLAP/데이터 마이닝
8
9. Hadoop
• Hadoop의 탄생?
– 배경
• Google!
• Nutch/Lucene 프로젝트에서 2006년 독립
– Doug Cutting
– Apache의 top-level 오픈소스 프로젝트
– 특징
• 대용량 데이터 분산처리 프레임워크
– http://hadoop.apache.org – 순수 S/W
• 프로그래밍 모델의 단순화로 선형 확장성 (Flat linearity)
– “function-to-data model vs. data-to-function” (Locality)
– KVP (Key-Value Pair)
9
10. Hadoop 탄생의 배경
1990년대 – Excite,
Alta Vista, Yahoo,
…
2000 – Google ;
PageRank,
GFS/MapReduce
2003~4 –
Google Paper
2005 – Hadoop
탄생
(D. Cutting &
Cafarella)
2006 – Apache
프로젝트에 등재
10
18. 요구사항
• Commodity hardware
– 잦은 고장은 당연한 일
• 수 많은 대형 파일
– 수백 GB or TB
– 대규모 streaming reads – Not random access
• “Write-once, read-many-times”
• High throughput 이 low latency보다 더 중요
• “Modest” number of HUGE files
– Just millions; Each > 100MB & multi-GB files typical
• Large streaming reads
– …
19. HDFS의 해결책
• 파일을 block 단위로 저장
– 통상의 파일시스템 (default: 64MB)보다 훨씬 커짐
• Replication 을 통한 신뢰성 증진
– Each block replicated across 3+ DataNodes
• Single master (NameNode) coordinates access,
metadata
– 단순화된 중앙관리
• No data caching
– Streaming read의 경우 별 도움이 안됨
• Familiar interface, but customize the API
– 문제를 단순화하고 분산 솔루션에 주력
22. HDFS 이용환경
• 명령어 Interface
• Java API
• Web Interface
• REST Interface (WebHDFS REST API)
• HDFS를 mount하여 사용
23. HDFS 명령어 Interface
• Create a directory
$ hadoop fs -mkdir /user/idcuser/data
• Copy a file from the local filesystem to HDFS
$ hadoop fs -copyFromLocal cit-Patents.txt
/user/idcuser/data/.
• List all files in the HDFS file system
$ hadoop fs -ls data/*
• Show the end of the specified HDFS file
$ hadoop fs -tail /user/idcuser/data/cit-patents-
copy.txt
• Append multiple files and move them to HDFS (via
stdin/pipes)
$ cat /data/ita13-tutorial/pg*.txt | hadoop fs -
put- data/all_gutenberg.txt
24. • File/Directory 명령어:
– copyFromLocal, copyToLocal, cp, getmerge, ls, lsr
(recursive ls),
– moveFromLocal, moveToLocal, mv, rm, rmr (recursive
rm), touchz,
– mkdir
• Status/List/Show 명령어:
– stat, tail, cat, test (checks for existence of path,
file, zero length files), du, dus
• Misc 명령어:
– setrep, chgrp, chmod, chown, expunge (empties trash
folder)
25. HDFS Java API
• Listing files/directories (globbing)
• Open/close inputstream
• Copy bytes (IOUtils)
• Seeking
• Write/append data to files
• Create/rename/delete files
• Create/remove directory
• Reading Data from HDFS
org.apache.hadoop.fs.FileSystem (abstract)
org.apache.hadoop.hdfs.DistributedFileSystem
org.apache.hadoop.fs.LocalFileSystem
org.apache.hadoop.fs.s3.S3FileSystem
28. HDFS 정리
• 다수의 저가 H/W 위에서 대규모 작업에 중점
– 잦은 고장에 대처
– 대형 파일 (주로 appended and read)에 중점
– 개발자들에 촛점맞춘 filesystem interface
• Scale-out & Batch Job
– 최근 여러 보완 프로젝트
34. WordCount 예의 개선
• 문제: 단 한 개의 reducer가 병목을 일으킴
– Work can be distributed over multiple nodes
(work balance 개선)
– All the input data has to be sorted before processing
– Question: Which data should be send to which reducer ?
• 해결책:
– Arbitrary distributed, based on a hash function (default mode)
– Partitioner Class, to determine for every output tuple the
corresponding reducer
35. unix 명령어와 Streaming API
• Question: How many cities has each country ?
hadoop jar /mnt/biginsights/opt/ibm/biginsights/pig/test/e2e/
pig/lib/hadoop-streaming.jar
-input input/city.csv
-output output
-mapper "cut -f2 -d,"
-reducer "uniq -c"
-numReduceTasks 5
• Explanation:
cut -f2 -d, # Extract 2nd col. in a CSV
uniq -c # Filter adjacent matches matching lines from INPUT,
# -c: prefix lines by the number of occurrences
additional remark: # numReduceTasks=0: no shuffle & sort phase!!
39. SQL-on-MapReduce
• 방향
– SQL로 HDFS에 저장된 데이터를 빠르게 조회하고, 분석
– MR을 사용하지 않는 (low latency) 실시간 분석을 목표
– 대규모 batch 및 실시간 interactive 분석에 사용
– HDFS, 기타 데이터에 대한 ETL, Ad-hoc 쿼리, 온라인통합
• New Architecture for SQL on Hadoop
– Data Locality
– (MR대신) Real-timer Query
– Schema-on-Read
– SQL ecosystem과 tight 통합
40. • SQL on Hadoop 프로젝트 예
– Google Dremel
– Apache Drill
– Cloudera Impala
– Citus Data
• Tajo
– 2013년 3월 Apache Incubator Project에 선정
• APL V2.0
– 국내기업 적용 – SK텔레콤 등
40
42. NoSQL?
• NoSQL도 DBMS이다.
– 기존 RDBMS:
• Table
• More functionality, Less Performance
– OLAP
• Cube
– NoSQL
• Collections
• Less Functionality, More Performance
• 주안점: Scalability, Performance, HA
42
Structured
Data
Structured/
Unstructured
Data
43. NoSQL 종류
• Key-Value Stores
– 원천기술: DHTs / Amazon’s Dynamo paper
– 예: Memcached, Coherence, Redis
• Column Store
– 원천기술: Google의 BigTable 논문
– 예: Hbase, Cassandra, Hypertable
• Document Store
– 원천기술: Lotus Notes
– 예: CouchDB, MongoDB, Cloudant
• Graph Database
– 원천기술: Euler & graph 이론
– 예: Neo4J, FlockDB
46. NoSQL 특징
• Missing?
– Joins 지원 없음
– Complex Transaction 지원 없음 (ACID)
– Constraint 지원 없음
• Available?
– Query Langauge
– 높은 성능
– Horizontal Scalability
NoSQL
SQL
성능
기능
47. MongoDB의 예
• MongoDB packages
– mongodb-org
– mongodb-org-server
– mongodb-org-mongos
– mongodb-org-shell
– mongodb-org-tools
• 설치
– sudo yum install -y mongodb-org
• 수행과 정지
– sudo service mongod start
– sudo service mongod stop
47
55. NoSQL 사용 – When?
• 대용량 데이터
• Element간의 relationship이 중요치 않을 때
• 비정형 데이터 (log, 는, twitter, blog, …)
• 신속한 prototyping
• 데이터의 변경이 빠를 때
• Business Logic을 DBMS가 아닌 Application에서 구현
55
56. NoSQL 결론
• 특징
– 기존 RDB 제한을 완화하여 단순화, 성능향상, 유연화
• 현황
– 2014.1월 현재 150여 종
56
62. R
• open-source 수리/통계 분석도구 및 프로그래밍 언어
– S 언어에서 기원하였으며 수 많은 package
• CRAN: http://cran.r-project.org/
• 현재 > 5,100 packages
– 뛰어난 성능과 시각화 (visualization) 기능
62
66. Data 즉, 객관적 증거 중심!
• The Fox and the hedgehog in a project life…
– 지도자 vs. 전문가
– 문제는 hedgehog 식 사고에서의 risk 문제…
• Systems Thinking: A Foxy Approach
– OODA: A fox dressed like a hedgehog
66
67. 맺음말
• “Big Data is All Data”
• 개방성의 문제
– 오픈소스, Naver vs. Google
• 교육
– 교육 일반, BD 교육 (www.coursera.org/course/mmds )
• 빅데이터 4V vs. 4P's (hurdles)
– Practicality, privacy, power, Privilege
• 기타
– 복잡계 이론, System Dynamics, 데이터 잔해 (Data Exhaust)
67