-
-
Save rjmanlawe/03608b9fc9595d75c90cabe469c6eb28 to your computer and use it in GitHub Desktop.
Revisions
-
zzz0123 revised this gist
Jul 21, 2014 . No changes.There are no files selected for viewing
-
zzz0123 revised this gist
Jul 21, 2014 . No changes.There are no files selected for viewing
-
zzz0123 revised this gist
Jul 21, 2014 . 1 changed file with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,13 +6,14 @@ ## install * http://help.treasuredata.com/customer/portal/articles/1246904-installing-td-agent-on-rhel-and-centos ## edit td-agent.conf ### server#1 ``` $ sudo vi /etc/td-agent/td-agent.conf <source> type tail format ltsv time_key time_local # formatがltsvのときに必要 path /var/log/nginx/access.log tag nginx.access pos_file /var/log/td-agent/nginx_access.pos @@ -50,10 +51,13 @@ $ sudo service td-agent stop $ sudo service td-agent start ``` ## edit iptables ``` $ sudo cat /etc/sysconfig/iptables + -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 24224 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 24224 -j ACCEPT $ sudo service iptables restart ``` ## reference * http://blog.excale.net/index.php/archives/2682 -
zzz0123 revised this gist
Jul 21, 2014 . 1 changed file with 8 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,13 @@ # setup td-agent ## about * source: server#1 nginx_access.log * dist: server#2 mongodb ## install * http://help.treasuredata.com/customer/portal/articles/1246904-installing-td-agent-on-rhel-and-centos ## setup ### server#1 ``` $ sudo vi /etc/td-agent/td-agent.conf <source> @@ -29,7 +30,7 @@ $ sudo vi /etc/td-agent/td-agent.conf </server> </match> ``` ### server#2 ``` <source> type forward -
zzz0123 renamed this gist
Jul 21, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
zzz0123 created this gist
Jul 21, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ # about * source: nginx_access.log * dist: mongodb # install * http://help.treasuredata.com/customer/portal/articles/1246904-installing-td-agent-on-rhel-and-centos # setup ## source ``` $ sudo vi /etc/td-agent/td-agent.conf <source> type tail format nginx path /var/log/nginx/access.log tag nginx.access pos_file /var/log/td-agent/nginx_access.pos </source> <match nginx.*> type forward buffer_type memory buffer_chunk_limit 256m buffer_queue_limit 128 flush_interval 5s <server> host $host port $port </server> </match> ``` ## dist ``` <source> type forward port $port </source> <match nginx.access> type mongo database $db_name collection $collection_name </match> ``` ## restart td-agent ``` // pidが残る or 2重起動するためstop, startで反映 $ sudo service td-agent stop $ sudo service td-agent start ``` ## setup iptables ``` $ sudo cat /etc/sysconfig/iptables + -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 24224 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 24224 -j ACCEPT $ sudo service iptables restart ```