SlideShare a Scribd company logo
1 of 24
Download to read offline
Apache Flume
Software Maestro 3rd 한진수
Contents
Flume 이야기
핵심 컨셉
그림. 이벤트가 분리되는 모습.
그림. 하나로 모아지는 모습.
심플 예제.
Flume 이야기
특징
분산되고, 신뢰할 수 있고, 대용량의 로그를
각각 다른 소스(Sources)에서 중앙 Data Store로 모을 수 있는 시스템이다.

Flume과 Flume-NG
엄밀한 Flume은 0.9.4버전이다.
Flume에서는 Field에서 보고된 address문제를 다시만들(rework-재가공)할 필요가 생겼다.
JIRA issue FLUME-728에서 브랜치를 따와서 다시만들(reside)기 시작했고,
그걸 별칭으로 Flume-NG(Next Generation)이라고 부른다.
Flume-NG는 1.x.x로 시작한다.
핵심 컨셉
Event
근원지에서 목적지까지 전송할 수 있는 플룸의 단위를 표현하는 optional string header와 byte pay load.

Flow
근원지에서 목적지까지 이벤트의 활동을 data flow 혹은 simply flow라고 부른다. 이건 엄격한 정의는 아니며 오직 high level
에서 설명할 목적으로 쓰인다.

Client
근원지점의 이벤트들을 동작시키고 이벤트들을 Flume agent로 전달하는 인터페이스 구현체. 전형적으로 클라이언트들
은 소비하는 데이터가 있는 application에 process 공간 내에서 작동한다. 예를 들면 Flume Log4j Appender는 클라이언트이다.

Agent
Source나 Channel이나 Sink와 같은 Flume 컴포넌트를 갖고있는 인터페이스 구현체이고 Agents들은 Receive하거나 Store하거
나 이벤트들을 next-hop destination으로 보낼 수 있는 능력을 가진다.
핵심 컨셉
Source
구체적인 메커니즘을 통해서 소스로 전달된 이벤트들을 소비하는 인터페이스 구현체. 예를 들면, Avro Source는 Flow상에서
Client들이나 다른 Agent들에게 Avro 이벤트들을 전달 받을 수 있는 Source 구현체이다. Source가 이벤트를 받을 때, Source는 이한
개 이상의 채널로 보내버린다.

Channel
Agent내에서 동작하고 Source들을 통해서 Channel로 전달된 이벤트들을 일시적으로 저장한다. 이벤트들은 채널에서 Sink가 지워
줄 때까지 기다린다. 한 예로, JDBC채널은 Sink가 지워줄 때까지 이벤트들을 갖고 있는 backed embedded database 파일 시스템을
사용하는 채널이다. Channel들은 중요한 역할을 수행한다.

Client
채널에서 온 이벤트들을 지울 수 있고 Flow상의 다음 Agent이나 최적 목적지로 전달할 수 있는인터페이스 구현체. 이벤트들을
flow상의 최종 목적지(Terminal Sink라고도 불린다)로 전달하는 Sinks. 반면에 Flume Avro는 다른 Avro Source에서 돌아가는 Agent에
게 메시지를 전달하는 평범한 Sink이다.
그림
Agent
Source Channel Sink를 가진 아이

Agent
그림
Source
Client, 다른 Sink에서 온 Event를 받는 입구

Source

Agent
그림
Channel
Source

Channel
Channel
Agent

Sink가 지워주기 전까지 보관하는 애
그림
Sink
Source

Channel
Sink
Channel
Agent

Sink
다음 Agent의 Source나 HDFS로 보내주는 애
잘 보냈으면 Channel에 있는 Event를 삭제한다.
그림
Client
Sink
Source

Channel
Sink
Channel
Agent

Client
최초로 Event가 발생하는 곳
ex) Log4j Appender
그림
Client

Source

Channel
Channel
Agent

Sink
Source
Sink

Channel
Channel
Agent

Sink

Sink
그림. 이벤트 분리되는 모습.
Client
Source
Sink

Channel
Channel
Agent

Client와 Sink는 Source에게 Event를 보낸다.

Sink
Sink
그림. 이벤트가 분리되는 모습.
Client
Source
Sink

Channel
Channel
Agent

Source에서 2개로 분리되고
Channel은 event를 저장하고 Sink에게 보낸다

Sink
Sink
그림. 하나로 모아지는 모습.
Client
Client

Agent

Client
Client

Agent
Agent

Source에 2개 이상의 이벤트가 들어오는 경우.

HDFS
그림. 2개의 트랜잭션
Source

Sink
트랜잭션 시작

Channel

Channel

이벤트 받기
다른 Agent로 이벤트 보내기

트랜잭션 시작
이벤트 넣기(쌓기)

트랜잭션 커밋

Agent

트랜잭션 커밋

Agent
그림. 2개의 트랜잭션 효과
Source

Sink
트랜잭션 시작

Channel

Channel

이벤트 받기
다른 Agent로 이벤트 보내기

트랜잭션 시작
이벤트 넣기(쌓기)

트랜잭션 커밋

트랜잭션 커밋

Agent
Agent
다른 Agent에 잘 도착할때 까지 보장하므로 failure에 강하다.
그림. 에러가 났을 때.
노말

Central
Event Store

Client
Agent

노말 상태

Agent
그림. 에러가 났을 때.
노말

Central
Event Store

Client
Agent

실패

Agent

Central
Event Store

Client
Agent

다음과 같은 에러가 나면
2번째 Agent의 Channel에 Event들이 쌓인다.

Agent
그림. 에러가 났을 때.
노말

Central
Event Store

Client
Agent

실패

Central
Event Store

Client
Agent

복구

Agent

Agent

Central
Event Store

Client
Agent

Agent

복구되면 Channel에 쌓인 Event들이 배수(drain)된다
Usage:
flume-ng
agent
--conf conf/
--conf-file conf/example.conf
--name a1
-Dflume.root.logger=INFO,conole
플룸
Flume Agent 실행
conf 디렉토리는 conf/
설정파일은 conf/example.conf
Agent 이름은 a1
flume.root.logger=INFO,console 옵션추가
심플 예제.1.
Agent의 이름은 a1
a1의 source는 r1
a1의 sinks는 k1
a1의 channel은 c1
아래는 너무 직관적이라 생략
심플 예제.1. 보냄
심플 예제.1. 받음
Reference
Apache Blog [https://blogs.apache.org/flume/entry/flume_ng_architecture]
Apache Wiki [https://cwiki.apache.org/FLUME/flume-ng.html]
Apache Flume [http://flume.apache.org/]

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Flume 조사