SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Fluentd with MySQL
V1.0
작성일자 : 2015.08
작 성 자 : 이 이 구
1
2
Index
1. Intro
2. Install
3. Test
 MySQL slowquery logging
 MySQL process list logging
 Game Log Data Collect
 Log Server 구축
4. QnA
3
Intro
4
Intro
Fluentd is a fully free and fully open-source log collector that instantly enables you to have a ‘Log Everything’
architecture with 125+ types of systems.
http://docs.fluentd.org
5
Intro
Reference : http://blog.seulgi.kim/2014/04/fluentd-pluggable-log-collector.html
6
Intro
Input plugin
Input plugin 은 외부로부터 이벤트를 받아오거나 외부의 파일을 읽어서 이벤트를 만들어 주는 역할을 한다.
fluentd 이외의 다른 log aggregator들이 가장 취약한 부분으로, 반대로 말하면 fluentd의 최고 장점이 되는 부분
이기도 하다.
fluentd의 경우는 이미 많은 plugin들이 만들어져 있어서 필요한 대부분의 plugin을 찾을 수 있고,
찾지 못하더라도 쉽게 plugin을 만들 수 있다.
Reference : http://blog.seulgi.kim/2014/04/fluentd-pluggable-log-collector.html
7
Intro
Output plugin
Output plugin 은 읽은 이벤트를 외부 저장소 또는 외부 서비스로 전달하는 역할을 한다
입력은 input plugin 을 통해서 들어와 engine을 거쳐서 buffer plugin을 거치지 않고 output plugin으로 나간다.
buffer는 engine에서 사용되는 것이 아니라 output plugin 내부에서 사용된다.
왜냐하면, output의 종류에 따라서 buffer가 필요하지 않은 경우가 있어, buffer의 사용 여부를 output plugin이 결정해야 하기 때문이다.
buffer plugin 을 사용하지 않는 output plugin을 non-buffered output plugin 이라고 부르며, 대표적인 예가 out_null과 out_stdout
plugin이다. out_null의 경우 들어오는 입력을 전부 버리는 plugin이고, out_stdout은 들어오는 입력을 커맨드 창에 띄워주는 plugin이다.
또 다른 경우는 out_copy 다. 이 plugin은 하나의 fluentd로 들어온 event를 2개 이상의 output으로 보낼 때 쓰인다.
따라서 뒤에 다른 output plugin이 있고, 이 output plugin이 적절한 buffer를 사용하기 때문에 자체적으로 buffer를 이용할 이유가 없다.
평범하게 buffer plugin을 사용하는 plugin들은 buffered output plugin이라고 부르는데 이 중 일부는 time sliced output plugin이라고
불린다. time sliced output plugin은 buffer를 사용하지만, chunk의 key로 tag가 아닌 시간을 사용한다는 것만이 다르다.
8
Intro
Buffer plugin
1. Output 을 효율적으로 내보내는 기능
log aggregator는 실시간으로 로그를 모아주지만, 모은 로그를 바로 바로 output 으로 보낼 이유는 없다. 그래서 fluentd 를 비롯한 대부분의 aggregator는 서버에서 일정량의 로그를
모았다가 처리하도록 해준다. fluentd에서는 이 단위를 chunk라고 부르며, chunk는 log의 tag 별로 분류되어 저장된다.
output plugin은 우선 chunk를 queue에 집어넣지 않고 들어오는 log를 chunk에 적는다. 그러다가 chunk의 크기가 일정 이상 커지거나, chunk가 생긴지 일정 시간 이상 지나면
queue에 들어간다. chunk는 tag를 key로 하므로 buffer에 들어가지 않고 있는 chunk가 한 개 이상일 수도 있다.
queue의 크기를 일정 이상 키우지 않기 위해 queue에 chunk를 집어넣을 때, queue에서 chunk를 1개 빼서 output으로 내보낸다.
2. Collector 서버 장애시 log 유실 최소화하는 기능
Buffer 를 사용한다고 해도 메모리가 무한한 것이 아니므로 서버에 오랫동안 문제 있으면 버려지는 데이터가 생기게 된다. fluentd 는 재시도를 하고 그래도 안 되면 버리는 것을
정책으로 삼고 있다. 즉, output으로 나가야 하는 data가 나가지 못했을 때 일정 시간이 지난 후 다시 시도하며, 그래도 실패한다면, 기다렸던 시간의 2배만큼 더 기다리고
다시 시도하기를 반복한다. 일정 횟수를 기다려도 보내는 것에 실패하면 이 데이터는 다음으로 보내지지 않고 버려진다. (재시도시간: retry_wait, 재시도횟수: retry_limit로 설정)
fluentd 자체가 문제가 생겨서 꺼지는 경우도 있는데, 이것도 buffer의 plugin으로 원하는 종류를 써서 해결할 수 있다.
기본적으로 fluentd가 buffer에 사용하는 것은 buf_memory 라는 plugin으로 chunk를 memory에 기록하는 plugin 이다. 하지만 서버가 죽었다 살아날 때도 보장하고 싶다면
buf_file plugin을 이용하면 된다. buf_file plugin을 사용하면 chunk의 내용을 file에 보관해 주기 때문에 서버가 다시 켜질 때 file을 읽어와 buffer 내용을 복구해준다.
file에 쓰는 만큼 속도가 느려지지만, 안정성이 증가하기도 하고, 사용할 수 있는 buffer의 크기도 커진다.
9
Index
1. Intro
2. Install
3. Test
 MySQL slowquery logging
 MySQL process list logging
 Game Log Data Collect
 Log Server 구축
4. QnA
10
Intro
Fluentd nested plugin
URL(input) : http://docs.fluentd.org/articles/input-plugin-overview
URL(output) : http://docs.fluentd.org/articles/output-plugin-overview
11
Install
"수집대상(Client)" 서버로 접속하여 Fluentd 설치
http://docs.fluentd.org/v0.12/categories/installation
# sudo su -
cd /usr1/program/
curl -L https://td-toolbelt.herokuapp.com/sh/install-redhat-td-agent2.sh | sh
# /etc/init.d/td-agent start
/etc/init.d/td-agent status
/etc/init.d/td-agent restart
/etc/init.d/td-agent stop
# cat /etc/td-agent/td-agent.conf
# curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test
tail -f /var/log/td-agent/td-agent.log
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
12
Index
1. Intro
2. Install
3. Test
 MySQL slowquery logging
 MySQL process list logging
 Game Log Data Collect
 Log Server 구축
4. QnA
13
Step.1 수집대상 서버로 접속하여 Fluentd plugin 설치
https://github.com/yuku-t/fluent-plugin-mysqlslowquery
https://github.com/tagomoris/fluent-plugin-mysql
https://github.com/toyama0919/fluent-plugin-mysql-bulk
# yum -y install ruby-rdoc ruby-devel rubygems
find / -name fluent-gem
/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysqlslowquery
/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysql-bulk
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Test.1 MySQL slowquery logging
14
Test.1 MySQL slowquery logging
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.2 수집기(Collector) 서버로 접속하여 Log 테이블 생성
$ mysql -u root -p
use test;
drop table if exists test.t_mysql_slow;
create table test.t_mysql_slow (
log_date datetime default current_timestamp
, user varchar(100)
, host varchar(100)
, host_ip varchar(20)
, query_time decimal(20,10)
, lock_time decimal(20,10)
, rows_sent bigint
, rows_examined bigint
, sql_text varchar(10000)
);
15
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정
$ sudo vi /etc/td-agent/td-agent.conf
…
…
<source>
type mysql_slow_query
path /data/mysql/ADMIN/slowquery.log
tag ec-ldb-m2.mysql_slow
</source>
<match ec-ldb-m2.mysql_slow>
type copy
<store>
type stdout
</store>
<store>
type mysql_bulk
host ec-ldb-m2
port 19336
database test
username root
password testpasswd12#$
column_names user,host,host_ip,query_time,lock_time,rows_sent,rows_examined,sql_text
key_names user,host,host_ip,query_time,lock_time,rows_sent,rows_examined,sql_text
table t_mysql_slow
flush_interval 5s
</store>
</match>
Test.1 MySQL slowquery logging
16
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.4 td-agent 재시작 및 부하쿼리 수행
$ sudo /etc/init.d/td-agent stop
sudo /etc/init.d/td-agent start
tail -f /var/log/td-agent/td-agent.log
Test.1 MySQL slowquery logging
$ mysql -u root -p
select sleep(1);
select sleep(1);
17
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.5 수집기(Collector) 서버에서 로그 확인
$ mysql -u root –p
select sleep(1);
select sleep(1);
Test.1 MySQL slowquery logging
$ mysql -u root -p
select * from t_mysql_slow;
18
Index
1. Intro
2. Install
3. Test
 MySQL slowquery logging
 MySQL process list logging
 Game Log Data Collect
 Log Server 구축
4. QnA
19
Step.1 수집대상 서버로 접속하여 Fluentd plugin 설치
https://github.com/y-ken/fluent-plugin-mysql-query
https://github.com/shunwen/fluent-plugin-rename-key
# yum -y install ruby-rdoc ruby-devel rubygems
find / -name fluent-gem
/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysql-query
/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-rename-key
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Test.2 MySQL process list logging
20
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Test.2 MySQL process list logging
Step.2 수집기(Collector) 서버로 접속하여 Log 테이블 생성
$ mysql -u root -p
use test;
drop table if exists test.t_mysql_process;
create table test.t_mysql_process (
log_date datetime default current_timestamp
, hostname varchar(100)
, id bigint
, user varchar(100)
, host varchar(100)
, db varchar(64)
, command varchar(50)
, duration_time bigint
, state varchar(4000)
, info varchar(10000)
);
21
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Test.2 MySQL process list logging
Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정
$ sudo vi /etc/td-agent/td-agent.conf
…
…
<source>
type mysql_query
host ec-ldb-s2
port 19336
database test
username root
password 433dlxjsjf12!@!
interval 1m
tag ec-ldb-s2.processlist
query show full processlist;
record_hostname yes
nest_result no
nest_key data
#row_count yes
#row_count_key row_count
</source>
<match ec-ldb-s2.processlist>
type rename_key
remove_tag_prefix ec-ldb-s2.
append_tag ec-ldb-s2
rename_rule1 Time duration_time
</match>
<match processlist.ec-ldb-s2>
type copy
<store>
type stdout
</store>
<store>
type mysql_bulk
host ec-ldb-m2
port 19336
database test
username root
password testpasswd12#$
column_names hostname,Id,User,Host,db,Command,State,Info,duration_time
key_names hostname,Id,User,Host,db,Command,State,Info,duration_time
table t_mysql_process
flush_interval 5s
</store>
</match>
22
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Test.2 MySQL process list logging
Step.4 td-agent 재시작
$ sudo /etc/init.d/td-agent stop
sudo /etc/init.d/td-agent start
tail -f /var/log/td-agent/td-agent.log
23
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Test.2 MySQL process list logging
Step.5 수집기(Collector) 서버에서 로그 확인
$ mysql -u root –p
use test;
select * from t_mysql_process;
24
Index
1. Intro
2. Install
3. Test
 MySQL slowquery logging
 MySQL process list logging
 Game Log Data Collect
 Log Server 구축
4. QnA
25
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.1 수집기(Collector) 서버로 접속하여 Log 테이블 생성
$ mysql -u root -p
use test;
drop table if exists test.log_game_play;
create table test.log_game_play (
log_date datetime default current_timestamp
, useridx bigint
, play_time bigint
, char_type varchar(1)
, result varchar(1)
);
alter table log_game_play add primary key(log_date,useridx);
Test.3 Game Log Collect
26
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.2 수집대상 서버로 접속하여 Log 테이블 생성 및 데이터 입력
$ mysql -u root -p
use test;
drop table if exists test.log_game_play;
create table test.log_game_play (
log_date datetime default current_timestamp
, useridx bigint
, play_time bigint
, char_type varchar(1)
, result varchar(1)
);
alter table log_game_play add primary key(log_date,useridx);
Test.3 Game Log Collect
set @i=0;
insert ignore into test.log_game_play
select date_sub(now(), interval @i:=@i+1 minute) as log_date
, @i
, rand()*10000
, mod(@i,10)
, mod(@i,3)
from mysql.proc
limit 100;
select date_format(log_date, '%Y%m%d%h') as dt, count(*) from
test.log_game_play group by date_format(log_date, '%Y%m%d%h');
select * from test.log_game_play where log_date between date_sub(now(),
interval 10 minute) and now();
27
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정
$ sudo vi /etc/td-agent/td-agent.conf
…
…
<source>
type mysql_query
host ec-ldb-s2
port 19336
database test
username root
password 433dlxjsjf12!@!
interval 10s
tag ec-ldb-s2.log_game_play
query select * from test.log_game_play where log_date
between date_sub(now(), interval 10 minute) and now();
record_hostname yes
nest_result no
nest_key data
#row_count yes
#row_count_key row_count
</source>
<match ec-ldb-s2.log_game_play>
type copy
<store>
type stdout
</store>
<store>
type mysql_bulk
host ec-ldb-m2
port 19336
database test
username root
password 433dlxjsjf12!@!
column_names log_date,useridx,play_time,char_type,result
key_names log_date,useridx,play_time,char_type,result
table log_game_play
on_duplicate_key_update true
on_duplicate_update_keys log_date,useridx
flush_interval 15s
</store>
</match>
Test.3 Game Log Collect
28
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.4 td-agent 재시작
$ sudo /etc/init.d/td-agent stop
sudo /etc/init.d/td-agent start
tail -f /var/log/td-agent/td-agent.log
Test.3 Game Log Collect
29
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.5 수집기(Collector) 서버에서 로그 확인
$ mysql -u root –p
use test;
select * from test.log_game_play;
Test.3 Game Log Collect
30
Index
1. Intro
2. Install
3. Test
 MySQL slowquery logging
 MySQL process list logging
 Game Log Data Collect
 Log Server 구축
4. QnA
31
Step.1 수집대상 서버로 접속하여 Fluentd plugin 설치
https://github.com/tagomoris/fluent-plugin-mysql
# yum -y install ruby-rdoc ruby-devel rubygems
find / -name fluent-gem
/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysql
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Test.4 Log Server 구축
Client
Client
Client
Server
Server
HAProxy(L4)
32
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.2 수집기(Collector) 서버로 접속하여 Log 테이블 생성
$ mysql -u root -p
use test;
drop table if exists test.t_log_connect;
create table test.t_log_connect (
log_date datetime default current_timestamp
, jsondata text
);
drop table if exists test.t_log_money;
create table test.t_log_money (
log_date datetime default current_timestamp
, jsondata text
);
Test.4 Log Server 구축
33
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정
$ sudo vi /etc/td-agent/td-agent.conf
…
…
<source>
type http
port 8888
body_size_limit 1mb
keepalive_timeout 10s
</source>
<match ec-ldb-s2.t_log_connect>
type copy
<store>
type stdout
</store>
<store>
type mysql
host ec-ldb-m2
port 19336
database test
username root
password testpasswd12#$
table t_log_connect
columns jsondata
format json
flush_interval 5s
</store>
</match>
<match ec-ldb-s2.t_log_money>
type copy
<store>
type stdout
</store>
<store>
type mysql
host ec-ldb-m2
port 19336
database test
username root
password testpasswd12#$
table t_log_money
columns jsondata
format json
flush_interval 5s
</store>
</match>
Test.4 Log Server 구축
34
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.4 td-agent 재시작
$ sudo /etc/init.d/td-agent stop
sudo /etc/init.d/td-agent start
-- 로그 발생
curl -X POST -d 'json={"ver":"1.0","action":"login","user":1}' http://localhost:8888/ec-ldb-s2.t_log_connect
curl -X POST -d 'json={"ver":"1.0","action":"login","user":1}' http://localhost:8888/ec-ldb-s2.t_log_money
tail -f /var/log/td-agent/td-agent.log
Test.4 Log Server 구축
35
Collector
[ec-ldb-m2]
Service DB
[ec-ldb-s2]
Step.5 수집기(Collector) 서버에서 로그 확인
$ mysql -u root –p
use test;
select count(*) from test.t_log_money;
select count(*) from test.t_log_connect;
Test.4 Log Server 구축
36
Test.0 활용방안
37
Test.0 활용방안
BackupDB
Service.1
Service.2
Service.3
1. federated engine or Export/Import 을 이용하여
매월 3개월 이전 Log Data 를 백업받은 후 삭제함
1. 특정기간 이전의 과거 데이터를 10분단위로 백업
받음으로서 불필요한 월 배치작업 제거
2. 주요 지표 데이터에 대해서는 ETL 도 대체할 수
있지 않을까?
Fluentd Agent Pool
38
Reference
RubyConf 2014 - Build the Unified Logging Layer with Fluentd and Ruby by Kiyoto Tamura
https://www.youtube.com/watch?v=sIVGsQgMHIo
39

Contenu connexe

Tendances

ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022René Cannaò
 
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)Hyojun Jeon
 
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 Amazon Web Services Korea
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바NeoClova
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용I Goo Lee
 
[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL TuningPgDay.Seoul
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정PgDay.Seoul
 
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교Amazon Web Services Korea
 
AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지
AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지
AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지Changje Jeong
 
Lessons learned from operating Data Platform on Kubernetes(EKS)
Lessons learned from operating Data Platform on Kubernetes(EKS)Lessons learned from operating Data Platform on Kubernetes(EKS)
Lessons learned from operating Data Platform on Kubernetes(EKS)창언 정
 
서비스 무중단 마이그레이션 : KT에서 Amazon으로
서비스 무중단 마이그레이션 : KT에서 Amazon으로서비스 무중단 마이그레이션 : KT에서 Amazon으로
서비스 무중단 마이그레이션 : KT에서 Amazon으로신우 방
 
Dd and atomic ddl pl17 dublin
Dd and atomic ddl pl17 dublinDd and atomic ddl pl17 dublin
Dd and atomic ddl pl17 dublinStåle Deraas
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleMariaDB plc
 
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유Hyojun Jeon
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바NeoClova
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교Woo Yeong Choi
 
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...Amazon Web Services Korea
 
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システムMySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システムKouhei Sutou
 
Red Hat Ansible 적용 사례
Red Hat Ansible 적용 사례Red Hat Ansible 적용 사례
Red Hat Ansible 적용 사례Opennaru, inc.
 

Tendances (20)

ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022
 
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유 (2부)
 
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015 AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
AWS로 사용자 천만 명 서비스 만들기 (윤석찬)- 클라우드 태권 2015
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
 
[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
 
InnoDB Locking Explained with Stick Figures
InnoDB Locking Explained with Stick FiguresInnoDB Locking Explained with Stick Figures
InnoDB Locking Explained with Stick Figures
 
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
Amazon DocumentDB vs MongoDB 의 내부 아키텍쳐 와 장단점 비교
 
AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지
AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지
AWS를 활용하여 Daily Report 만들기 : 로그 수집부터 자동화된 분석까지
 
Lessons learned from operating Data Platform on Kubernetes(EKS)
Lessons learned from operating Data Platform on Kubernetes(EKS)Lessons learned from operating Data Platform on Kubernetes(EKS)
Lessons learned from operating Data Platform on Kubernetes(EKS)
 
서비스 무중단 마이그레이션 : KT에서 Amazon으로
서비스 무중단 마이그레이션 : KT에서 Amazon으로서비스 무중단 마이그레이션 : KT에서 Amazon으로
서비스 무중단 마이그레이션 : KT에서 Amazon으로
 
Dd and atomic ddl pl17 dublin
Dd and atomic ddl pl17 dublinDd and atomic ddl pl17 dublin
Dd and atomic ddl pl17 dublin
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
[NDC18] 야생의 땅 듀랑고의 데이터 엔지니어링 이야기: 로그 시스템 구축 경험 공유
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교
 
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
데이터 분석가를 위한 신규 분석 서비스 - 김기영, AWS 분석 솔루션즈 아키텍트 / 변규현, 당근마켓 소프트웨어 엔지니어 :: AWS r...
 
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システムMySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
 
Red Hat Ansible 적용 사례
Red Hat Ansible 적용 사례Red Hat Ansible 적용 사례
Red Hat Ansible 적용 사례
 

Similaire à Fluentd with MySQL

Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurationsJohn Kim
 
클라우드 환경에서 알아야할 성능 이야기
클라우드 환경에서 알아야할 성능 이야기클라우드 환경에서 알아야할 성능 이야기
클라우드 환경에서 알아야할 성능 이야기YoungSu Son
 
도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집Daegwon Kim
 
Hadoop security DeView 2014
Hadoop security DeView 2014Hadoop security DeView 2014
Hadoop security DeView 2014Gruter
 
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1Ji-Woong Choi
 
[오픈소스컨설팅]Nginx jboss 연동가이드__v1
[오픈소스컨설팅]Nginx jboss 연동가이드__v1[오픈소스컨설팅]Nginx jboss 연동가이드__v1
[오픈소스컨설팅]Nginx jboss 연동가이드__v1Ji-Woong Choi
 
Python으로 채팅 구현하기
Python으로 채팅 구현하기Python으로 채팅 구현하기
Python으로 채팅 구현하기Tae Young Lee
 
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)Esun Kim
 
4. Application - Oozie Fork
4. Application - Oozie Fork4. Application - Oozie Fork
4. Application - Oozie Forkmerry7
 
Zoo keeper 소개
Zoo keeper 소개Zoo keeper 소개
Zoo keeper 소개주표 홍
 
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020Ji-Woong Choi
 
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례Gruter
 
클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기
클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기
클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기YoungSu Son
 
[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdfHeeJung Chae
 
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중ymtech
 
Easy gameserver
Easy gameserverEasy gameserver
Easy gameserver진상 문
 

Similaire à Fluentd with MySQL (20)

Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurations
 
클라우드 환경에서 알아야할 성능 이야기
클라우드 환경에서 알아야할 성능 이야기클라우드 환경에서 알아야할 성능 이야기
클라우드 환경에서 알아야할 성능 이야기
 
도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집도커(Docker) 메트릭스 & 로그 수집
도커(Docker) 메트릭스 & 로그 수집
 
Hadoop security DeView 2014
Hadoop security DeView 2014Hadoop security DeView 2014
Hadoop security DeView 2014
 
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
 
[오픈소스컨설팅]Nginx jboss 연동가이드__v1
[오픈소스컨설팅]Nginx jboss 연동가이드__v1[오픈소스컨설팅]Nginx jboss 연동가이드__v1
[오픈소스컨설팅]Nginx jboss 연동가이드__v1
 
Python으로 채팅 구현하기
Python으로 채팅 구현하기Python으로 채팅 구현하기
Python으로 채팅 구현하기
 
OpenStack Swift Debugging
OpenStack Swift DebuggingOpenStack Swift Debugging
OpenStack Swift Debugging
 
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
 
4. Application - Oozie Fork
4. Application - Oozie Fork4. Application - Oozie Fork
4. Application - Oozie Fork
 
Zoo keeper 소개
Zoo keeper 소개Zoo keeper 소개
Zoo keeper 소개
 
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
 
Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
 
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
 
클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기
클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기
클라우드 & 모바일 환경에서 알아야 할 성능 품질 이야기
 
[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf
 
Redis
RedisRedis
Redis
 
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
 
Oracle History #8
Oracle History #8Oracle History #8
Oracle History #8
 
Easy gameserver
Easy gameserverEasy gameserver
Easy gameserver
 

Plus de I Goo Lee

MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항I Goo Lee
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOI Goo Lee
 
From MSSQL to MySQL
From MSSQL to MySQLFrom MSSQL to MySQL
From MSSQL to MySQLI Goo Lee
 
From MSSQL to MariaDB
From MSSQL to MariaDBFrom MSSQL to MariaDB
From MSSQL to MariaDBI Goo Lee
 
AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기I Goo Lee
 
Backup automation in KAKAO
Backup automation in KAKAO Backup automation in KAKAO
Backup automation in KAKAO I Goo Lee
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축I Goo Lee
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례I Goo Lee
 
MySQL 5.7 NF – Optimizer Improvement
 MySQL 5.7 NF – Optimizer Improvement MySQL 5.7 NF – Optimizer Improvement
MySQL 5.7 NF – Optimizer ImprovementI Goo Lee
 
MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용I Goo Lee
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)I Goo Lee
 
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개I Goo Lee
 
AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론I Goo Lee
 
AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분I Goo Lee
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTI Goo Lee
 
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKMySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKI Goo Lee
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKI Goo Lee
 
PostgreSQL 이야기
PostgreSQL 이야기PostgreSQL 이야기
PostgreSQL 이야기I Goo Lee
 
Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)I Goo Lee
 
Binlog Servers 구축사례
Binlog Servers 구축사례Binlog Servers 구축사례
Binlog Servers 구축사례I Goo Lee
 

Plus de I Goo Lee (20)

MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIO
 
From MSSQL to MySQL
From MSSQL to MySQLFrom MSSQL to MySQL
From MSSQL to MySQL
 
From MSSQL to MariaDB
From MSSQL to MariaDBFrom MSSQL to MariaDB
From MSSQL to MariaDB
 
AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기AWS Aurora 100% 활용하기
AWS Aurora 100% 활용하기
 
Backup automation in KAKAO
Backup automation in KAKAO Backup automation in KAKAO
Backup automation in KAKAO
 
텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축텔레그램을 이용한 양방향 모니터링 시스템 구축
텔레그램을 이용한 양방향 모니터링 시스템 구축
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례
 
MySQL 5.7 NF – Optimizer Improvement
 MySQL 5.7 NF – Optimizer Improvement MySQL 5.7 NF – Optimizer Improvement
MySQL 5.7 NF – Optimizer Improvement
 
MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
 
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개MS 빅데이터 서비스 및 게임사 PoC 사례 소개
MS 빅데이터 서비스 및 게임사 PoC 사례 소개
 
AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론AWS 환경에서 MySQL Infra 설계하기-2본론
AWS 환경에서 MySQL Infra 설계하기-2본론
 
AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분AWS 환경에서 MySQL Infra 설계하기-1도입부분
AWS 환경에서 MySQL Infra 설계하기-1도입부분
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMT
 
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKMySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELK
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
PostgreSQL 이야기
PostgreSQL 이야기PostgreSQL 이야기
PostgreSQL 이야기
 
Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)Intro KaKao ADT (Almighty Data Transmitter)
Intro KaKao ADT (Almighty Data Transmitter)
 
Binlog Servers 구축사례
Binlog Servers 구축사례Binlog Servers 구축사례
Binlog Servers 구축사례
 

Fluentd with MySQL

  • 1. Fluentd with MySQL V1.0 작성일자 : 2015.08 작 성 자 : 이 이 구 1
  • 2. 2 Index 1. Intro 2. Install 3. Test  MySQL slowquery logging  MySQL process list logging  Game Log Data Collect  Log Server 구축 4. QnA
  • 4. 4 Intro Fluentd is a fully free and fully open-source log collector that instantly enables you to have a ‘Log Everything’ architecture with 125+ types of systems. http://docs.fluentd.org
  • 6. 6 Intro Input plugin Input plugin 은 외부로부터 이벤트를 받아오거나 외부의 파일을 읽어서 이벤트를 만들어 주는 역할을 한다. fluentd 이외의 다른 log aggregator들이 가장 취약한 부분으로, 반대로 말하면 fluentd의 최고 장점이 되는 부분 이기도 하다. fluentd의 경우는 이미 많은 plugin들이 만들어져 있어서 필요한 대부분의 plugin을 찾을 수 있고, 찾지 못하더라도 쉽게 plugin을 만들 수 있다. Reference : http://blog.seulgi.kim/2014/04/fluentd-pluggable-log-collector.html
  • 7. 7 Intro Output plugin Output plugin 은 읽은 이벤트를 외부 저장소 또는 외부 서비스로 전달하는 역할을 한다 입력은 input plugin 을 통해서 들어와 engine을 거쳐서 buffer plugin을 거치지 않고 output plugin으로 나간다. buffer는 engine에서 사용되는 것이 아니라 output plugin 내부에서 사용된다. 왜냐하면, output의 종류에 따라서 buffer가 필요하지 않은 경우가 있어, buffer의 사용 여부를 output plugin이 결정해야 하기 때문이다. buffer plugin 을 사용하지 않는 output plugin을 non-buffered output plugin 이라고 부르며, 대표적인 예가 out_null과 out_stdout plugin이다. out_null의 경우 들어오는 입력을 전부 버리는 plugin이고, out_stdout은 들어오는 입력을 커맨드 창에 띄워주는 plugin이다. 또 다른 경우는 out_copy 다. 이 plugin은 하나의 fluentd로 들어온 event를 2개 이상의 output으로 보낼 때 쓰인다. 따라서 뒤에 다른 output plugin이 있고, 이 output plugin이 적절한 buffer를 사용하기 때문에 자체적으로 buffer를 이용할 이유가 없다. 평범하게 buffer plugin을 사용하는 plugin들은 buffered output plugin이라고 부르는데 이 중 일부는 time sliced output plugin이라고 불린다. time sliced output plugin은 buffer를 사용하지만, chunk의 key로 tag가 아닌 시간을 사용한다는 것만이 다르다.
  • 8. 8 Intro Buffer plugin 1. Output 을 효율적으로 내보내는 기능 log aggregator는 실시간으로 로그를 모아주지만, 모은 로그를 바로 바로 output 으로 보낼 이유는 없다. 그래서 fluentd 를 비롯한 대부분의 aggregator는 서버에서 일정량의 로그를 모았다가 처리하도록 해준다. fluentd에서는 이 단위를 chunk라고 부르며, chunk는 log의 tag 별로 분류되어 저장된다. output plugin은 우선 chunk를 queue에 집어넣지 않고 들어오는 log를 chunk에 적는다. 그러다가 chunk의 크기가 일정 이상 커지거나, chunk가 생긴지 일정 시간 이상 지나면 queue에 들어간다. chunk는 tag를 key로 하므로 buffer에 들어가지 않고 있는 chunk가 한 개 이상일 수도 있다. queue의 크기를 일정 이상 키우지 않기 위해 queue에 chunk를 집어넣을 때, queue에서 chunk를 1개 빼서 output으로 내보낸다. 2. Collector 서버 장애시 log 유실 최소화하는 기능 Buffer 를 사용한다고 해도 메모리가 무한한 것이 아니므로 서버에 오랫동안 문제 있으면 버려지는 데이터가 생기게 된다. fluentd 는 재시도를 하고 그래도 안 되면 버리는 것을 정책으로 삼고 있다. 즉, output으로 나가야 하는 data가 나가지 못했을 때 일정 시간이 지난 후 다시 시도하며, 그래도 실패한다면, 기다렸던 시간의 2배만큼 더 기다리고 다시 시도하기를 반복한다. 일정 횟수를 기다려도 보내는 것에 실패하면 이 데이터는 다음으로 보내지지 않고 버려진다. (재시도시간: retry_wait, 재시도횟수: retry_limit로 설정) fluentd 자체가 문제가 생겨서 꺼지는 경우도 있는데, 이것도 buffer의 plugin으로 원하는 종류를 써서 해결할 수 있다. 기본적으로 fluentd가 buffer에 사용하는 것은 buf_memory 라는 plugin으로 chunk를 memory에 기록하는 plugin 이다. 하지만 서버가 죽었다 살아날 때도 보장하고 싶다면 buf_file plugin을 이용하면 된다. buf_file plugin을 사용하면 chunk의 내용을 file에 보관해 주기 때문에 서버가 다시 켜질 때 file을 읽어와 buffer 내용을 복구해준다. file에 쓰는 만큼 속도가 느려지지만, 안정성이 증가하기도 하고, 사용할 수 있는 buffer의 크기도 커진다.
  • 9. 9 Index 1. Intro 2. Install 3. Test  MySQL slowquery logging  MySQL process list logging  Game Log Data Collect  Log Server 구축 4. QnA
  • 10. 10 Intro Fluentd nested plugin URL(input) : http://docs.fluentd.org/articles/input-plugin-overview URL(output) : http://docs.fluentd.org/articles/output-plugin-overview
  • 11. 11 Install "수집대상(Client)" 서버로 접속하여 Fluentd 설치 http://docs.fluentd.org/v0.12/categories/installation # sudo su - cd /usr1/program/ curl -L https://td-toolbelt.herokuapp.com/sh/install-redhat-td-agent2.sh | sh # /etc/init.d/td-agent start /etc/init.d/td-agent status /etc/init.d/td-agent restart /etc/init.d/td-agent stop # cat /etc/td-agent/td-agent.conf # curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test tail -f /var/log/td-agent/td-agent.log Collector [ec-ldb-m2] Service DB [ec-ldb-s2]
  • 12. 12 Index 1. Intro 2. Install 3. Test  MySQL slowquery logging  MySQL process list logging  Game Log Data Collect  Log Server 구축 4. QnA
  • 13. 13 Step.1 수집대상 서버로 접속하여 Fluentd plugin 설치 https://github.com/yuku-t/fluent-plugin-mysqlslowquery https://github.com/tagomoris/fluent-plugin-mysql https://github.com/toyama0919/fluent-plugin-mysql-bulk # yum -y install ruby-rdoc ruby-devel rubygems find / -name fluent-gem /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysqlslowquery /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysql-bulk Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Test.1 MySQL slowquery logging
  • 14. 14 Test.1 MySQL slowquery logging Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.2 수집기(Collector) 서버로 접속하여 Log 테이블 생성 $ mysql -u root -p use test; drop table if exists test.t_mysql_slow; create table test.t_mysql_slow ( log_date datetime default current_timestamp , user varchar(100) , host varchar(100) , host_ip varchar(20) , query_time decimal(20,10) , lock_time decimal(20,10) , rows_sent bigint , rows_examined bigint , sql_text varchar(10000) );
  • 15. 15 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정 $ sudo vi /etc/td-agent/td-agent.conf … … <source> type mysql_slow_query path /data/mysql/ADMIN/slowquery.log tag ec-ldb-m2.mysql_slow </source> <match ec-ldb-m2.mysql_slow> type copy <store> type stdout </store> <store> type mysql_bulk host ec-ldb-m2 port 19336 database test username root password testpasswd12#$ column_names user,host,host_ip,query_time,lock_time,rows_sent,rows_examined,sql_text key_names user,host,host_ip,query_time,lock_time,rows_sent,rows_examined,sql_text table t_mysql_slow flush_interval 5s </store> </match> Test.1 MySQL slowquery logging
  • 16. 16 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.4 td-agent 재시작 및 부하쿼리 수행 $ sudo /etc/init.d/td-agent stop sudo /etc/init.d/td-agent start tail -f /var/log/td-agent/td-agent.log Test.1 MySQL slowquery logging $ mysql -u root -p select sleep(1); select sleep(1);
  • 17. 17 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.5 수집기(Collector) 서버에서 로그 확인 $ mysql -u root –p select sleep(1); select sleep(1); Test.1 MySQL slowquery logging $ mysql -u root -p select * from t_mysql_slow;
  • 18. 18 Index 1. Intro 2. Install 3. Test  MySQL slowquery logging  MySQL process list logging  Game Log Data Collect  Log Server 구축 4. QnA
  • 19. 19 Step.1 수집대상 서버로 접속하여 Fluentd plugin 설치 https://github.com/y-ken/fluent-plugin-mysql-query https://github.com/shunwen/fluent-plugin-rename-key # yum -y install ruby-rdoc ruby-devel rubygems find / -name fluent-gem /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysql-query /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-rename-key Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Test.2 MySQL process list logging
  • 20. 20 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Test.2 MySQL process list logging Step.2 수집기(Collector) 서버로 접속하여 Log 테이블 생성 $ mysql -u root -p use test; drop table if exists test.t_mysql_process; create table test.t_mysql_process ( log_date datetime default current_timestamp , hostname varchar(100) , id bigint , user varchar(100) , host varchar(100) , db varchar(64) , command varchar(50) , duration_time bigint , state varchar(4000) , info varchar(10000) );
  • 21. 21 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Test.2 MySQL process list logging Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정 $ sudo vi /etc/td-agent/td-agent.conf … … <source> type mysql_query host ec-ldb-s2 port 19336 database test username root password 433dlxjsjf12!@! interval 1m tag ec-ldb-s2.processlist query show full processlist; record_hostname yes nest_result no nest_key data #row_count yes #row_count_key row_count </source> <match ec-ldb-s2.processlist> type rename_key remove_tag_prefix ec-ldb-s2. append_tag ec-ldb-s2 rename_rule1 Time duration_time </match> <match processlist.ec-ldb-s2> type copy <store> type stdout </store> <store> type mysql_bulk host ec-ldb-m2 port 19336 database test username root password testpasswd12#$ column_names hostname,Id,User,Host,db,Command,State,Info,duration_time key_names hostname,Id,User,Host,db,Command,State,Info,duration_time table t_mysql_process flush_interval 5s </store> </match>
  • 22. 22 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Test.2 MySQL process list logging Step.4 td-agent 재시작 $ sudo /etc/init.d/td-agent stop sudo /etc/init.d/td-agent start tail -f /var/log/td-agent/td-agent.log
  • 23. 23 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Test.2 MySQL process list logging Step.5 수집기(Collector) 서버에서 로그 확인 $ mysql -u root –p use test; select * from t_mysql_process;
  • 24. 24 Index 1. Intro 2. Install 3. Test  MySQL slowquery logging  MySQL process list logging  Game Log Data Collect  Log Server 구축 4. QnA
  • 25. 25 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.1 수집기(Collector) 서버로 접속하여 Log 테이블 생성 $ mysql -u root -p use test; drop table if exists test.log_game_play; create table test.log_game_play ( log_date datetime default current_timestamp , useridx bigint , play_time bigint , char_type varchar(1) , result varchar(1) ); alter table log_game_play add primary key(log_date,useridx); Test.3 Game Log Collect
  • 26. 26 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.2 수집대상 서버로 접속하여 Log 테이블 생성 및 데이터 입력 $ mysql -u root -p use test; drop table if exists test.log_game_play; create table test.log_game_play ( log_date datetime default current_timestamp , useridx bigint , play_time bigint , char_type varchar(1) , result varchar(1) ); alter table log_game_play add primary key(log_date,useridx); Test.3 Game Log Collect set @i=0; insert ignore into test.log_game_play select date_sub(now(), interval @i:=@i+1 minute) as log_date , @i , rand()*10000 , mod(@i,10) , mod(@i,3) from mysql.proc limit 100; select date_format(log_date, '%Y%m%d%h') as dt, count(*) from test.log_game_play group by date_format(log_date, '%Y%m%d%h'); select * from test.log_game_play where log_date between date_sub(now(), interval 10 minute) and now();
  • 27. 27 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정 $ sudo vi /etc/td-agent/td-agent.conf … … <source> type mysql_query host ec-ldb-s2 port 19336 database test username root password 433dlxjsjf12!@! interval 10s tag ec-ldb-s2.log_game_play query select * from test.log_game_play where log_date between date_sub(now(), interval 10 minute) and now(); record_hostname yes nest_result no nest_key data #row_count yes #row_count_key row_count </source> <match ec-ldb-s2.log_game_play> type copy <store> type stdout </store> <store> type mysql_bulk host ec-ldb-m2 port 19336 database test username root password 433dlxjsjf12!@! column_names log_date,useridx,play_time,char_type,result key_names log_date,useridx,play_time,char_type,result table log_game_play on_duplicate_key_update true on_duplicate_update_keys log_date,useridx flush_interval 15s </store> </match> Test.3 Game Log Collect
  • 28. 28 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.4 td-agent 재시작 $ sudo /etc/init.d/td-agent stop sudo /etc/init.d/td-agent start tail -f /var/log/td-agent/td-agent.log Test.3 Game Log Collect
  • 29. 29 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.5 수집기(Collector) 서버에서 로그 확인 $ mysql -u root –p use test; select * from test.log_game_play; Test.3 Game Log Collect
  • 30. 30 Index 1. Intro 2. Install 3. Test  MySQL slowquery logging  MySQL process list logging  Game Log Data Collect  Log Server 구축 4. QnA
  • 31. 31 Step.1 수집대상 서버로 접속하여 Fluentd plugin 설치 https://github.com/tagomoris/fluent-plugin-mysql # yum -y install ruby-rdoc ruby-devel rubygems find / -name fluent-gem /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-mysql Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Test.4 Log Server 구축 Client Client Client Server Server HAProxy(L4)
  • 32. 32 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.2 수집기(Collector) 서버로 접속하여 Log 테이블 생성 $ mysql -u root -p use test; drop table if exists test.t_log_connect; create table test.t_log_connect ( log_date datetime default current_timestamp , jsondata text ); drop table if exists test.t_log_money; create table test.t_log_money ( log_date datetime default current_timestamp , jsondata text ); Test.4 Log Server 구축
  • 33. 33 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.3 수집대상(DB) 서버로 접속하여 td-agent.conf 설정 $ sudo vi /etc/td-agent/td-agent.conf … … <source> type http port 8888 body_size_limit 1mb keepalive_timeout 10s </source> <match ec-ldb-s2.t_log_connect> type copy <store> type stdout </store> <store> type mysql host ec-ldb-m2 port 19336 database test username root password testpasswd12#$ table t_log_connect columns jsondata format json flush_interval 5s </store> </match> <match ec-ldb-s2.t_log_money> type copy <store> type stdout </store> <store> type mysql host ec-ldb-m2 port 19336 database test username root password testpasswd12#$ table t_log_money columns jsondata format json flush_interval 5s </store> </match> Test.4 Log Server 구축
  • 34. 34 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.4 td-agent 재시작 $ sudo /etc/init.d/td-agent stop sudo /etc/init.d/td-agent start -- 로그 발생 curl -X POST -d 'json={"ver":"1.0","action":"login","user":1}' http://localhost:8888/ec-ldb-s2.t_log_connect curl -X POST -d 'json={"ver":"1.0","action":"login","user":1}' http://localhost:8888/ec-ldb-s2.t_log_money tail -f /var/log/td-agent/td-agent.log Test.4 Log Server 구축
  • 35. 35 Collector [ec-ldb-m2] Service DB [ec-ldb-s2] Step.5 수집기(Collector) 서버에서 로그 확인 $ mysql -u root –p use test; select count(*) from test.t_log_money; select count(*) from test.t_log_connect; Test.4 Log Server 구축
  • 37. 37 Test.0 활용방안 BackupDB Service.1 Service.2 Service.3 1. federated engine or Export/Import 을 이용하여 매월 3개월 이전 Log Data 를 백업받은 후 삭제함 1. 특정기간 이전의 과거 데이터를 10분단위로 백업 받음으로서 불필요한 월 배치작업 제거 2. 주요 지표 데이터에 대해서는 ETL 도 대체할 수 있지 않을까? Fluentd Agent Pool
  • 38. 38 Reference RubyConf 2014 - Build the Unified Logging Layer with Fluentd and Ruby by Kiyoto Tamura https://www.youtube.com/watch?v=sIVGsQgMHIo
  • 39. 39