Fluentd and AWS at classmethod

24
Mar 21, 2014 www.treasuredata.com/ Fluentd & AWS! Masahiro Nakagawa Treasure Data, Inc 1

description

Presented at http://connpass.com/event/5222/

Transcript of Fluentd and AWS at classmethod

Page 1: Fluentd and AWS at classmethod

Mar 21, 2014

www.treasuredata.com/

Fluentd & AWS!

Masahiro NakagawaTreasure Data, Inc

1

Page 2: Fluentd and AWS at classmethod

Who are you?

• Masahiro Nakagawa

• @repeatedly

• Treasure Data, Inc

• Senior Software Engineer

• Fluentd, td-agent, etc...

• Dlang, MessagePack, ...

2

Page 3: Fluentd and AWS at classmethod
Page 4: Fluentd and AWS at classmethod

Treasure Data on AWS

4

Page 5: Fluentd and AWS at classmethod

FrontendQueue

Worker

Hadoop

Fluentd

Applications push metrics to Fluentd(via local Fluentd)

Librato Metricsfor realtime analysis

Treasure Data

for historical analysis

Fluentd sums up data minutes(partial aggregation)

Backend overviewImpalaPresto

Hadoop

Page 6: Fluentd and AWS at classmethod

Used AWS products

• RDS

• Store service data

• Queue / Scheduler

• S3

• Columnar storage

• EC2

• Clusters: Hadoop, Workers, APIs, etc…6

SeparateStorage and Processor!

Page 7: Fluentd and AWS at classmethod

Classmethod use case!

7

Page 8: Fluentd and AWS at classmethod

Fluentd(Treasure Agent)

8

Page 9: Fluentd and AWS at classmethod

Structured logging

Reliable forwarding

Pluggable architecture

http://fluentd.org/

Page 10: Fluentd and AWS at classmethod

Collect Store Process Visualize

Data source

Reporting

Monitoring

Data Processing

Page 11: Fluentd and AWS at classmethod

Related Products

Store Process

Cloudera

Horton Works

Treasure Data

Collect Visualize

Tableau

Excel

R

easier & shorter time

???

Page 12: Fluentd and AWS at classmethod

Before…

12

Application

・・・

Server2

Application

・・・

Server3

Application

・・・

Server1

FluentLog Server

High Latency!must wait for a day...

Page 13: Fluentd and AWS at classmethod

Divide & Conquer & Retry

13

error retry

error retry retry

retry

Page 14: Fluentd and AWS at classmethod

After!

14

Application

・・・

Server2

Application

・・・

Server3

Application

・・・

Server1

Fluentd Fluentd Fluentd

Fluentd Fluentd

In streaming!

Page 15: Fluentd and AWS at classmethod

Lambda Architecture

15

http://www.drdobbs.com/database/applying-the-big-data-lambda-architectur/240162604

Page 16: Fluentd and AWS at classmethod

In short

• Open sourced log collector written in Ruby

• Customization is essentialsmall core + many plugins

16

Fluentd is a robust log collectordesigned for processing data streams

Page 17: Fluentd and AWS at classmethod

Core Plugins

• Divide & Conquer

• Buffring & Retrying

• Error handling

• Message routing

• Parallelize

• read / receive data

• write / send data

17

Page 18: Fluentd and AWS at classmethod

M x N → M + N

18

Nagios

MongoDB

Hadoop

Alerting

Amazon S3

Analysis

Archiving

MySQL

Apache

Frontend

Access logs

syslogd

App logs

System logs

Backend

Databasesbuffer / buffer / routing

Page 19: Fluentd and AWS at classmethod

Pluggable Architecture

19

Buffer Output

Input

> Forward> HTTP> File tail> dstat> ...

> Forward> File> MongoDB> ...

> File> Memory

Engine

Output

> rewrite> ...

Pluggable Pluggable

Page 20: Fluentd and AWS at classmethod

Next release

20

• Fluentd v0.10.45

• in_tail supports multiline and * watch

• in_exec supports json / msgpack

• several fixes

• td-agent 1.1.19

Page 21: Fluentd and AWS at classmethod

AWS use cases

21

Page 22: Fluentd and AWS at classmethod

Collecting instance logs

22

• A sign of Immutable Infrastructure

• Hard to manage state-full instance

• Almost instance should be disposable

• Excluding DB, Master, etc...

• How to manage such instance logs?

• Common problem on Cloud environment

Page 23: Fluentd and AWS at classmethod

• Start Fluentd at launch phase

• It is also useful for Docker / other containers

• Including metadata or host to identify

Collecting using Fluentd

23

Collector Aggregator

Page 24: Fluentd and AWS at classmethod

AWS Plugins

24

http://fluentd.org/plugin/

• s3

• dynamodb

• redshift

• rds

• elb

• cloudwatch

• sns

• sqs

• ses

• kinesis (soon!)