Slide 1

Slide 1 text

EC2 / Fargate Logging

Slide 2

Slide 2 text

summary 現状の構成(EC2 + fluentd) から Fargate + α に移⾏するためのロギング構成を検討する

Slide 3

Slide 3 text

現状の構成 fluentdはEC2起動テンプレートのユーザーデータで設定&プロセス起動 アプリケーションからEBSにファイル出⼒ fluentdで拾って Firehose -> S3 へ。 Athenaでクエリ 起動テンプレートに依存しているためFargateに移⾏できない MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="==BOUNDARY==" --==BOUNDARY== Content-Type: text/x-shellscript; charset="us-ascii" #!/bin/bash pip3 install awscli curl -L https://toolbelt.treasuredata.com/sh/install-amazon2-td-agent3.sh | sh td-agent-gem install fluent-plugin-s3 td-agent-gem install fluent-plugin-elasticsearch td-agent-gem install fluent-plugin-kinesis td-agent-gem install fluent-plugin-slack aws s3 cp s3://***/fluentd.conf /etc/td-agent/td-agent.conf chown -R td-agent /work/td-agent chown -R td-agent /etc/td-agent

Slide 4

Slide 4 text

Sidecar pattern

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

ログ出⼒⽅法 ファイル出⼒ 標準出⼒ FireLens

Slide 7

Slide 7 text

FireLens AWS⽤のfluentbitのイメージを利⽤する Docker build時に設定&ECRにpush FROM amazon/aws-for-fluent-bit:2.12.0 COPY ./extra.conf /fluent-bit/etc/extra.conf

Slide 8

Slide 8 text

ECS task 定義 { ... "containerDefinitions": [ { "dnsSearchDomains": null, "environmentFiles": null, "logConfiguration": { "logDriver": "awsfirelens", "secretOptions": null, "options": { "Name": "" } }, ... "image": " メインアプリケーションのコンテナイメージ", ... }, { ... "image": "fluentbit のコンテナイメージ", "startTimeout": null, "firelensConfiguration": { "type": "fluentbit", "options": null }, ... } ], ... }

Slide 9

Slide 9 text

conclusion FireLens と fluentbit を⽤いた Sidecar pattern による EC2 / Fargate のロギング構成を 紹介した