Vectorized Processing in a Nutshell. (in Korean)
Presented by Hyoungjun Kim, Gruter CTO and Apache Tajo committer, at DeView 2014, Sep. 30 Seoul Korea.
Vectorized Processing in a Nutshell. (in Korean)
Presented by Hyoungjun Kim, Gruter CTO and Apache Tajo committer, at DeView 2014, Sep. 30 Seoul Korea.
Big Data Platform Field Case in MelOn (in Korean)
- Presented by Byeong-hwa Yoon, engineer manager at Loen Entertainment
- at Gruter TECHDAY 2014 Oct. 29 Seoul, Korea
spark 1.6을 기준으로 spark sql에 대해서 개략적으로 설명한 자료입니다. 발표 자료가 친절하지 않으나 한글로 된 자료가 없길래 혹시나 도움 되시는 분들이 있을까 하여 공유합니다.
발표자료 보다는 마지막 페이지의 참고자료들을 읽어보시기를 권장 드립니다.
출처만 남겨주시면 자유롭게 가져가셔서 사용하셔도 무방합니다.
– Elastic stack과 Data pipeline의 개념
– 데이터의 종류와 형태 / Document 데이터 모델링 (mapping, data type)
– 분산 데이터 저장소 관점에서의 Elasticsearch (index, shard & replica, segment)
https://learningspoons.com/course/detail/elastic-stack/
Big Data Platform Field Case in MelOn (in Korean)
- Presented by Byeong-hwa Yoon, engineer manager at Loen Entertainment
- at Gruter TECHDAY 2014 Oct. 29 Seoul, Korea
spark 1.6을 기준으로 spark sql에 대해서 개략적으로 설명한 자료입니다. 발표 자료가 친절하지 않으나 한글로 된 자료가 없길래 혹시나 도움 되시는 분들이 있을까 하여 공유합니다.
발표자료 보다는 마지막 페이지의 참고자료들을 읽어보시기를 권장 드립니다.
출처만 남겨주시면 자유롭게 가져가셔서 사용하셔도 무방합니다.
– Elastic stack과 Data pipeline의 개념
– 데이터의 종류와 형태 / Document 데이터 모델링 (mapping, data type)
– 분산 데이터 저장소 관점에서의 Elasticsearch (index, shard & replica, segment)
https://learningspoons.com/course/detail/elastic-stack/
스프링군살없이세팅하기(The way to setting the Spring framework for web.)EunChul Shin
깔끔하게 스프링 프레임워크 세팅하는 것에 대한 이야기 입니다.
군살없이 프레임워크를 세팅한다는 의미와 이유, 그리고 스프링 기본 설정 및 설정들의 역할에 대해서 정리해 보았습니다.
This presentation is about Spring framework.
I want to talk about the way to setting the spring framework as tidy in this presentation.
[ http://infiniflux.com/download ]
The world's fastest time series DBMS.
What is InfiniFlux?
1) InfiniFlux is a time-series database which performs real-time data processing, i.e., data are inserted at high speed, retrieved and analyzed without elapsed time.
2) InfiniFlux also compresses and stores data in real-time. Its query language and syntax complies with the SQL standard. The extended SQL syntax provides additional features such as the text search tool.
This document introduces REST.
Explain about what is REST? and advanced REST feature.
It also introduce REST actual implementation with Jersey and REST infrastructure architecture with ESB based on actual delivery experience.
One more interest thing is that it has REST client stub generator & service contract generator design
Gruter TECHDAY 2014 Realtime Processing in TelcoGruter
Big Telco, Bigger real-time demands: Real-time processing in Telco
- Presented by Jung-ryong Lee, engineer manager at SK Telecom at Gruter TECHDAY 2014 Oct.29 Seoul, Korea
Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)Gruter
Big data analysis using Tajo on AWS (Hands-on session)
- presented by Young-kyong Ko, data analyst at Gruter
- at Gruter TECHDAY 2014 (Oct. 29 Seoul, Korea)
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)Gruter
Apache Tajo: A Big Data Warehouse System on Hadoop
- presented by Jae-hwaJeong, Apache Tajo committer and Gruter research engineer
at Gruter TECHDAY 2014 (Oct. 29 Seoul, Korea)
Gruter_TECHDAY_2014_01_SearchEngine (in Korean)Gruter
Case study of open source search engine project in e-commerce site
- presented by Ho-wook Jeong, search expert at Gruter
at Gruter TECHDAY 2014 (Oct. 29 Seoul, Korea)
Apache Tajo: A Big Data Warehouse System on Hadoop
Presented by Jae-hwa Jeong, Apache Tajo committer and senior research engineer at Gruter, in Bigdata World Convention 2014 at Oct.23, Busan, Korea
Big Data Camp LA 2014 - Apache Tajo: A Big Data Warehouse System on HadoopGruter
Apache Tajo is an open source big data warehouse system on Hadoop. This slide is a presentation material used in Big Data Camp LA 2014. This slide shows an introduction to Apache Tajo and the current status of the project. The current status includes cost-based optimization and the current supported SQL feature set.
Hadoop Summit 2014: Query Optimization and JIT-based Vectorized Execution in ...Gruter
Apache Tajo is an open source big data warehouse system on Hadoop. This slide shows two high-tech efforts for performance improvement in Tajo project. First one is query optimization including cost-based join order and progressive optimization. The second effort is JIT-based vectorized processing.
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: Tajo와 SQL-on-HadoopGruter
- 관련 기술 트렌드 소개
- Tajo의 아키텍쳐와 로드맵
Tajo는 Big Data 분석 처리 엔진 분야에서 핫이슈로 부상하고 있는 SQL-on-Hadoop의 차세대 핵심 기술로 Apache Incubation 프로젝트로 등록되어 있는 오픈소스이며, Gruter가 개발을 주도하고 있는 프로젝트입니다.
6. 1.1.ElasticSearch와 동작 방식
ElasticSearch란?
Lucene 기반의 오픈 소스 검색엔진
ElasticSearch 특징
Easy
Real time search & analytics
Distributed & highly available search engine
7. 1.1.ElasticSearch와 동작 방식
ElasticSearch 구성
Physical 구성
Logical 구성
Cluster Index
Node Node Node
Indice Indice Indice
Shard
Shard
Shard
Shard
Shard
Shard
Shard
Shard
Shard
Type Type Type
Document Document Document
field:value
field:value
field:value
field:value
field:value
field:value
field:value
field:value
field:value
[Physical 구성] [Logical 구성]
8. 1.1.ElasticSearch와 동작 방식
ElasticSearch Nodes
Master node
Data node
Search load balancer node
Client node
Master
node.master: true
Data
node.data: true
Search LB
node.master: false
node.data: false
Client
node.client: true
9. 1.1.ElasticSearch와 동작 방식
ElasticSearch Nodes 구성 예
Case 1)
All round player
node.master: true
node.data: true
node.master: true
node.data: true
node.master: true
node.data: true
Case 2)
Master
Data
node.master: true
node.data: false
node.master: true
node.data: false
node.master: false
node.data: true
node.master: false
node.data: true
Case 3)
Master
Data
Search LB
node.master: true
node.data: false
node.master: true
node.data: false
node.master: false
node.data: true
node.master: false
node.data: true
node.master: false
node.data: false
node.master: false
node.data: false
10. 1.1.ElasticSearch와 동작 방식
ElasticSearch vs RDBMS
Relational Database ElasticSearch
Database Index
Table Type
Row Document
Column Field
Index Analyze
Primary key _id
Schema Mapping
Physical partition Shard
Logical partition Route
Relational Parent/Child, Nested
SQL Query DSL
11. 1.1.ElasticSearch와 동작 방식
ElasticSearch shard replication
POST /my_index/_settings
{
"number_of_replicas": 1
}
POST /my_index/_settings
{
"number_of_replicas": 2
}
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/replica-shards
12. 1.1.ElasticSearch와 동작 방식
Creating, indexing and deleting a document
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/distrib-write.html
13. 1.1.ElasticSearch와 동작 방식
Retrieve, query and fetch a document
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/distrib-read.html
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_query_phase.html
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_fetch_phase.html
14. 1.2.설치 및 실행하기
설치하기
다운로드
압축해제
실행하기
실행
테스트
Create index
Add document
Get document
Search document
15. 1.3.Modeling 하기
Indice/type design
Time-based/User-based data
Relational data
1TB
Field design
검색 대상 필드
분석 대상 필드
정렬 대상 필드
저장 대상 필드
Primary key 필드
16. 1.3.Modeling 하기
Modeling 구성 예
Indice1 Indice2 Indice3
IndiceA IndiceB IndiceC
Type
Parent
Type
Child
Type
1 : N
Parent
Type
Child
Type
Child
1 : N
1 : N Type
17. 1.3.Modeling 하기
Shard design
number_of_shards >= number_of_data_nodes
number_of_replica <= number_of_data_nodes - 1
Shard sizing
Index 당 최대 shard 수 : 200 개 이하
Shard 하나 당 최대 크기 : 20 ~ 50GB
Shard 하나 당 최소 크기 : ~ 3GB
18. 1.3.Modeling 하기
Hash partition test
public class EsHashPartitionTest {
@Test
public void testHashPartition() {
……중략……
for ( int i=0; i<1000000; i++ ) {
int shardId = MathUtils.mod(hash(String.valueOf(i)), shardSize);
shards.add(shardId, (long) ++partSize[shardId]);
}
……중략……
}
public int hash(String routing) {
return hashFunction.hash(routing);
}
}
20. 2.1.성능에 영향을 미치는 요소들
장비 관점
Network bandwidth?
Disk I/O?
RAM?
CPU cores?
문서 관점
Document size?
Total index data size?
Data size increase?
Store period?
서비스 관점
Analyzer?
Analyze fields?
Indexed field size?
Boosting?
Realtime or batch?
Queries?
21. 2.1.성능에 영향을 미치는 요소들
In ElasticSearch site:
If 1 shard is too few and 1,000 shards are too many, how do I know how many
shards I need?
This is a question that is impossible to answer in the general case. There are
many variables: the hardware that you use, the size and complexity of your
documents, how you index and analyze those documents, the types of queries
that you run, the aggregations that you perform, how you model your data,
etc., etc.
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/capacity-planning.html
22. 2.1.성능에 영향을 미치는 요소들
In ElasticSearch site:
Fortunately, it is an easy question to answer in the specific case: yours.
1. Create a cluster consisting of a single server, with the hardware that you are
considering using in production.
2. Create an index with the same settings and analyzers that you plan to use in
production, but with only on primary shard and no replicas.
3. Fill it with real documents (or as close to real as you can get).
4. Run real queries and aggregations (or as close to real as you can get).
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/capacity-planning.html
23. 2.2.설정 최적화
운영체제 관점
Increase File descriptor
Avoid swap
검색엔진 관점
Avoid swap
Thread pool
Segment merge
Index buffer size
Storage device
Use recent version
24. 2.2.설정 최적화
Cluster restart 관점
Optimize (max segments: 5)
Close index
Restart after set “disable_allocation: true”
Increase recovery limits
25. 2.3.색인 최적화
Modeling
Disable “_all” fields
Disable “_source” fields, so far as possible
Set right value to “_id” fields
Set false to “store” fields, so far as possible
26. 2.3.색인 최적화
Sizing
Indice는 데이터의 크기를 관리 할 수 있는 용도로 사용한다.
Indice 당 primary shard 수는 data node 수 보다 크거나 같아야 한다.
(number_of_shards >= number_of_data_nodes)
Indice 당 shard 수는 200개 미만으로 구성한다.
Shard 하나의 크기는 50GB 미만으로 구성한다.
27. 2.3.색인 최적화
Client
Bulk API를 사용한다.
Hardware 성능을 점검한다.
Exception을 확인한다.
Thread pools을 점검한다.
1110(Node,Indice,Shard,Replica)으로 점검한다.
Optimize 대신 Flush와 Refresh를 활용한다.
28. 2.3.색인 최적화
Bulk indexing
Request 당 크기는 5 ~ 15MB
Request 당 문서 크기는 1,000 ~ 5,000개
Server bulk thread pool 크기는 core size × 5 보다 작거나 같게 설정
Client bulk connection pool 크기는 3 ~ 10개 × number_of_data_nodes
Client ping timeout은 30 ~ 90초로 설정
Client node sampler interval은 30 ~ 90초로 설정
Client transport sniff를 true로 설정
Client network TCP blocking을 false로 설정
30. 2.4.질의 최적화
Shards
Data 분산을 위해 shard 수를 늘린다.
Replica shard 수를 늘린다.
Data distribution
Use routing
Check _id
ShardId = hash(_id) % number_of_primary_shards
31. 2.4.질의 최적화
Query
항상 같은 node 로 query hitting이 되지 않도록 한다.
Zero hit query를 줄여야 한다.
Query 결과를 cache 한다.
Avoid deep pagination.
Sorting : number_of_shard × (from +size)
Script 사용 시 _source, _field 대신 doc[‘field’]를 사용한다.
Search type
Query and fetch
Query then fetch
Count
Scan
32. 2.4.질의 최적화
Queries vs. Filters
Query 대신 filtered query와 filter를 사용한다.
And/or/not filter 대신 bool filter를 사용한다.
Queries Filters
Relevance Binary yes/no
Full text Exact values
Not cached Cached
Slower Faster
“query” : {
“match_all” : {
}
}
“query” : {
“filtered” : {
“query” : {
“match_all” : {}
}
}
}
34. 3.1.Hadoop 통합
ElasticSearch Hadoop 활용
Big data 분석을 위한 도구
Snapshot & Restore 저장소
ElasticSearch Hadoop plugin 도구 제공
35. 3.1.Hadoop 통합
Indexing
BulkRequestBuilder REST API
ElasticSearch
Hadoop plugin
Bulk indexing
Integrate natively
Read raw data
Java client
application
Control concurrency request
36. 3.1.Hadoop 통합
Indexing
ElasticSearch
Hadoop
Plugin
MapReduce
Configuration conf = new Configuration();
…중략…
conf.set(Configuration.ES_NODES, “localhost:9200”);
conf.set(Configuration.ES_RESOURCE, “blog/post”);
…중략…
Job job = new Job(conf);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(EsOutputFormat.class);
job.setMapOutputValueClass(LinkedMapWritable.class);
job.setMapperClass(TabMapper.class);
job.setNumReduceTasks(0);
File fl = new File(“blog/post.txt”);
long splitSize = fl.length() / 3;
TextInputFormat.setMaxInputSplitSize(job, splitSize);
TextInputFormat.setMinInputSplitSize(job, 50);
boolean result = job.waitForCompletion(true);
37. 3.1.Hadoop 통합
Indexing
Java
Client
Application
MapReduce
public static void main(String[] args) throws Exception {
...중략...
settings = Connector.buildSettings(esCluster);
client = Connector.buildClient(settings, esNodes.split(","));
runBeforeConfig(esIndice);
Job job = new Job(conf);
...중략...
for ( String distJar : esDistributedCacheJars) {
DistributedCache.addFileToClassPath(
new Path(esDistributedCachePath+"/"+distJar),
job.getConfiguration());
}
...중략...
if ( "true".equalsIgnoreCase(esOptimize) ) {
runOptimize(esIndice);
} else {
runRefreshAndFlush(esIndice);
}
runAfterConfig(esIndice, replica);
}
42. 3.2.SQL on ElasticSearch
ElasticSearch SQL 이란?
쉬운 접근성과 데이터 분석 도구를 제공한다.
표준 SQL 문법을 Query DSL로 변환한다.
표준 SQL 문법을 사용하여 검색엔진으로 CRUD 연산을 수행할 수 있다.
JDBC drive와 CLI 기능을 제공하고 있다.
Apache Tajo용 SQL analyzer를 사용하고 있다.
44. 3.2.SQL on ElasticSearch
ElasticSearch SQL Syntax
Create database/table
Drop database/table
Select/Insert/Upsert/Delete
Use database
Show databases/tables
Desc table
49. 마무리 하며…
ElasticSearch 이해
Lucene 기반의 분산 검색 엔진
ElasticSearch 성능 최적화 이해
정답은 없지만…
항상 좋은 장비에 최신버전을 사용한다.
확장 가능한 modeling과 sizing을 구성한다.
병목 구간을 항상 모니터링 한다.
Query와 filter를 목적에 맞게 사용한다.
Bulk API를 사용한다.
ElasticSearch 빅데이터 활용
Hadoop과 SQL로 쉽게 분석도구로 활용한다.