Elasticsearch

Fluentd

데이터 세상 2022. 6. 17. 14:04

Fluentd

an open source data collector for unified logging layer

https://www.fluentd.org/

 

Fluentd | Open Source Data Collector

"Logs are streams, not files. I love that Fluentd puts this concept front-and-center, with a developer-friendly approach for distributed systems logging." Adam Wiggins, Heroku co-founder

www.fluentd.org

 

트레저 데이터(Treaure Data)에서 개발된 크로스 플랫폼 오픈 소스 데이터 수집 소프트웨어 프로젝트로 C와 Ruby로 개발되었다.

보통 로그를 수집하지만 다양한 데이터 소스(HTTP, TCP 등)로부터 데이터를 받아올 수 있다.

Fluentd-Bit

Fluentd forwarder의 경량화 버전으로 더 적은 메모리를 사용해야 하는 환경에 적합하다.

 

Fluentd 처리 데이터 특징

Event

Fluentd 데이터는 tag, time, record로 구성된 event로 처리된다.

  • tag: 이벤트를 어디로 보낼지 결정하기 위한 구분값
  • time: 이벤트가 발생한 시간
  • record: 데이터(JSON)

 

Use Cases

https://docs.fluentd.org/

  • 어플리케이션 로그 한곳으로 모으기
  • 서비스 로그 모니터링(Elasticsearch, Kibana)
  • 데이터 분석을 위한 hdfs로 적재
  • AWS S3 데이터 저장
  • Stream 데이터 처리

 

Fludentd vs Logstash

FluentD and Logstash are both open source data collectors used for Kubernetes logging.

Logstash is centralized while FluentD is decentralized.

FluentD offers better performance than Logstash.

 

Fluentd는 CNCF(Cloud Native Computing Foundation)의 일부로 Kubernetes, Prometheus, OpenTracing 등과 잘 어울린다.

Logstash는 ELK stack의 일부로 ElasticSearch와 높은 호환성을 가진다.

 

Logstash는 JRuby로 호스트에 자바 런타임이 필요하다.

 

이벤트 라우팅

Logstash

  • if-else 조건에 기반에 이벤트가 라우팅된다.
  • 만약 로그에 다른 종류의 타입이 많아질 경우 관리하기 어려워질 수 있다.

Fluentd

  • 태그에 기반에 이벤트가 라우팅된다.
  • 이벤트에 태그 지정 방식이 Logstash에 비해 상대적으로 쉬운 라우팅 접근 방식을 제공한다.

 

Plug-in

Logstash는 200개 이상의 플러그인이 존재하며, Fluentd는 500개 이상의 플러그인이 존재한다.

출처: https://grip.news/archives/1340

 

ELK & EFK

ELK = Elasticsearch, Logstash, Kibana

EFK = Elastisearch, Fluentd, Kibana

모놀리틱 한 애플리케이션의 경우 로그, 메트릭, 상태 등의 수집을 위해 여러 에이전트 지원 가능한 Logstash가 적합할 수 있으며

호스팅 되는 마이크로 서비스의 경우에는 Fluentd가 적합할 수 있다.

 


References

반응형