際際滷

際際滷Share a Scribd company logo
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 讌企l 螻 れ伎る log襯 chunk . 蠏碁り chunk 蠍郁 殊 伎 貉れ蟇磯, chunk螳 蠍伎 殊 螳 伎 讌覃
queue れ願. chunk tag襯 key襦 覩襦 buffer れ願讌 螻  chunk螳  螳 伎  .
queue 蠍磯ゼ 殊 伎 れ一 蠍  queue chunk襯 讌企l , 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

More Related Content

What's hot (20)

PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
PGConf APAC
Postgresql tutorial
Postgresql tutorialPostgresql tutorial
Postgresql tutorial
Ashoka Vanjare
MySQL Administrator 2021 - れろ企覦
MySQL Administrator 2021 - れろ企覦MySQL Administrator 2021 - れろ企覦
MySQL Administrator 2021 - れろ企覦
NeoClova
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101
Connor McDonald
悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰
悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰
悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰
NeoClova
Maxscale 螳 1.1.1
Maxscale 螳 1.1.1Maxscale 螳 1.1.1
Maxscale 螳 1.1.1
NeoClova
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
Ludovico Caldara
[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙
[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙
[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙
PgDay.Seoul
ろれ雑ろ 企ろ一 V1.0
ろれ雑ろ 企ろ一 V1.0ろれ雑ろ 企ろ一 V1.0
ろれ雑ろ 企ろ一 V1.0
sprdd
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic Concepts
James Bayer
MariaDB 襷願係伎 - れろ企覦
MariaDB 襷願係伎 - れろ企覦MariaDB 襷願係伎 - れろ企覦
MariaDB 襷願係伎 - れろ企覦
NeoClova
[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster
[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster
[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster
Ji-Woong Choi
Secondary Index Search in InnoDB
Secondary Index Search in InnoDBSecondary Index Search in InnoDB
Secondary Index Search in InnoDB
MIJIN AN
spinlock.pdf
spinlock.pdfspinlock.pdf
spinlock.pdf
Adrian Huang
Rocks db state store in structured streaming
Rocks db state store in structured streamingRocks db state store in structured streaming
Rocks db state store in structured streaming
Balaji Mohanam
MySQL Advanced Administrator 2021 - れろ企覦
MySQL Advanced Administrator 2021 - れろ企覦MySQL Advanced Administrator 2021 - れろ企覦
MySQL Advanced Administrator 2021 - れろ企覦
NeoClova
Learning postgresql
Learning postgresqlLearning postgresql
Learning postgresql
DAVID RAUDALES
AWS 蟆曙 MySQL BMT
AWS 蟆曙 MySQL BMTAWS 蟆曙 MySQL BMT
AWS 蟆曙 MySQL BMT
I Goo Lee
DMS SCT襯 Oracle Open Source DB襦
DMS SCT襯  Oracle Open Source DB襦 DMS SCT襯  Oracle Open Source DB襦
DMS SCT襯 Oracle Open Source DB襦
Amazon Web Services Korea
REST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using RESTREST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using REST
Christian Gohmann
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
PGConf APAC
Postgresql tutorial
Postgresql tutorialPostgresql tutorial
Postgresql tutorial
Ashoka Vanjare
MySQL Administrator 2021 - れろ企覦
MySQL Administrator 2021 - れろ企覦MySQL Administrator 2021 - れろ企覦
MySQL Administrator 2021 - れろ企覦
NeoClova
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101
Connor McDonald
悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰
悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰
悪艶艶沿温鉛庄厩艶糸+珂温恰皆界温鉛艶+珂温姻庄温禽京喝伎襷る換_1.0.糸看界恰
NeoClova
Maxscale 螳 1.1.1
Maxscale 螳 1.1.1Maxscale 螳 1.1.1
Maxscale 螳 1.1.1
NeoClova
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
Ludovico Caldara
[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙
[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙
[pgday.Seoul 2022] PostgreSQL蟲譟 - れ煙
PgDay.Seoul
ろれ雑ろ 企ろ一 V1.0
ろれ雑ろ 企ろ一 V1.0ろれ雑ろ 企ろ一 V1.0
ろれ雑ろ 企ろ一 V1.0
sprdd
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic Concepts
James Bayer
MariaDB 襷願係伎 - れろ企覦
MariaDB 襷願係伎 - れろ企覦MariaDB 襷願係伎 - れろ企覦
MariaDB 襷願係伎 - れろ企覦
NeoClova
[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster
[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster
[ろれ雑ろ]Day #2 MySQL Tuning, Replication, Cluster
Ji-Woong Choi
Secondary Index Search in InnoDB
Secondary Index Search in InnoDBSecondary Index Search in InnoDB
Secondary Index Search in InnoDB
MIJIN AN
Rocks db state store in structured streaming
Rocks db state store in structured streamingRocks db state store in structured streaming
Rocks db state store in structured streaming
Balaji Mohanam
MySQL Advanced Administrator 2021 - れろ企覦
MySQL Advanced Administrator 2021 - れろ企覦MySQL Advanced Administrator 2021 - れろ企覦
MySQL Advanced Administrator 2021 - れろ企覦
NeoClova
Learning postgresql
Learning postgresqlLearning postgresql
Learning postgresql
DAVID RAUDALES
AWS 蟆曙 MySQL BMT
AWS 蟆曙 MySQL BMTAWS 蟆曙 MySQL BMT
AWS 蟆曙 MySQL BMT
I Goo Lee
REST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using RESTREST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using REST
Christian Gohmann

Similar to Fluentd with MySQL (20)

Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurations
John Kim
企殊磯 蟆曙 狩 焔 伎手鍵
企殊磯 蟆曙 狩 焔 伎手鍵企殊磯 蟆曙 狩 焔 伎手鍵
企殊磯 蟆曙 狩 焔 伎手鍵
YoungSu Son
貉(Docker) 覃碁Ν & 襦蠏 讌
貉(Docker) 覃碁Ν & 襦蠏 讌貉(Docker) 覃碁Ν & 襦蠏 讌
貉(Docker) 覃碁Ν & 襦蠏 讌
Daegwon Kim
Hadoop security DeView 2014
Hadoop security DeView 2014Hadoop security DeView 2014
Hadoop security DeView 2014
Gruter
[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1
[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1
[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1
Ji-Woong Choi
[ろれ雑ろ]Nginx jboss 磯螳企__v1
[ろれ雑ろ]Nginx jboss 磯螳企__v1[ろれ雑ろ]Nginx jboss 磯螳企__v1
[ろれ雑ろ]Nginx jboss 磯螳企__v1
Ji-Woong Choi
Python朱 豈 蟲蠍
Python朱 豈 蟲蠍Python朱 豈 蟲蠍
Python朱 豈 蟲蠍
Tae Young Lee
OpenStack Swift Debugging
OpenStack Swift DebuggingOpenStack Swift Debugging
OpenStack Swift Debugging
OpenStack Korea Community
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 Fork
merry7
Zoo keeper 螳
Zoo keeper 螳Zoo keeper 螳
Zoo keeper 螳
譯狩
[ろれ雑ろ] れ拘壱 螳企 2020
[ろれ雑ろ] れ拘壱  螳企 2020[ろれ雑ろ] れ拘壱  螳企 2020
[ろれ雑ろ] れ拘壱 螳企 2020
Ji-Woong Choi
Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
wonyong hwang
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.pdf
HeeJung Chae
赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓
赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓
赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓
dpfls5645
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...
Kyuhyun Byun
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
Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurations
John Kim
企殊磯 蟆曙 狩 焔 伎手鍵
企殊磯 蟆曙 狩 焔 伎手鍵企殊磯 蟆曙 狩 焔 伎手鍵
企殊磯 蟆曙 狩 焔 伎手鍵
YoungSu Son
貉(Docker) 覃碁Ν & 襦蠏 讌
貉(Docker) 覃碁Ν & 襦蠏 讌貉(Docker) 覃碁Ν & 襦蠏 讌
貉(Docker) 覃碁Ν & 襦蠏 讌
Daegwon Kim
Hadoop security DeView 2014
Hadoop security DeView 2014Hadoop security DeView 2014
Hadoop security DeView 2014
Gruter
[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1
[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1
[ろれ雑ろ]Nginx 1.2.7 れ螳企__v1
Ji-Woong Choi
[ろれ雑ろ]Nginx jboss 磯螳企__v1
[ろれ雑ろ]Nginx jboss 磯螳企__v1[ろれ雑ろ]Nginx jboss 磯螳企__v1
[ろれ雑ろ]Nginx jboss 磯螳企__v1
Ji-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 Fork
merry7
Zoo keeper 螳
Zoo keeper 螳Zoo keeper 螳
Zoo keeper 螳
譯狩
[ろれ雑ろ] れ拘壱 螳企 2020
[ろれ雑ろ] れ拘壱  螳企 2020[ろれ雑ろ] れ拘壱  螳企 2020
[ろれ雑ろ] れ拘壱 螳企 2020
Ji-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.pdf
HeeJung Chae
赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓
赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓
赫禽赫看遺喝悪堰雨喝赫看皆艶姻厩艶姻喝敬艶艶一5喝悌求估メ悌,悌仰估求慶悌п.沿糸韓
dpfls5645
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...
Kyuhyun Byun
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

More from I Goo Lee (20)

珂霞皆河晦喝酷温恢姻庄界喝伎脚矧
珂霞皆河晦喝酷温恢姻庄界喝伎脚矧珂霞皆河晦喝酷温恢姻庄界喝伎脚矧
珂霞皆河晦喝酷温恢姻庄界喝伎脚矧
I Goo Lee
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIO
I Goo Lee
From MSSQL to MySQL
From MSSQL to MySQLFrom MSSQL to MySQL
From MSSQL to MySQL
I Goo Lee
From MSSQL to MariaDB
From MSSQL to MariaDBFrom MSSQL to MariaDB
From MSSQL to MariaDB
I 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 覃讌 覿 覦
MySQL  覃讌 覿 覦 MySQL  覃讌 覿 覦
MySQL 覃讌 覿 覦
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 Improvement
I 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
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
I 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 ELK
I 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
珂霞皆河晦喝酷温恢姻庄界喝伎脚矧
珂霞皆河晦喝酷温恢姻庄界喝伎脚矧珂霞皆河晦喝酷温恢姻庄界喝伎脚矧
珂霞皆河晦喝酷温恢姻庄界喝伎脚矧
I Goo Lee
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIO
I Goo Lee
From MSSQL to MySQL
From MSSQL to MySQLFrom MSSQL to MySQL
From MSSQL to MySQL
I Goo Lee
From MSSQL to MariaDB
From MSSQL to MariaDBFrom MSSQL to MariaDB
From MSSQL to MariaDB
I 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 覃讌 覿 覦
MySQL  覃讌 覿 覦 MySQL  覃讌 覿 覦
MySQL 覃讌 覿 覦
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 Improvement
I 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
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
I 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 ELK
I 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

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 讌企l 螻 れ伎る log襯 chunk . 蠏碁り chunk 蠍郁 殊 伎 貉れ蟇磯, chunk螳 蠍伎 殊 螳 伎 讌覃 queue れ願. chunk tag襯 key襦 覩襦 buffer れ願讌 螻 chunk螳 螳 伎 . queue 蠍磯ゼ 殊 伎 れ一 蠍 queue chunk襯 讌企l , 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