Collect Glusterfs Logs
Last updated
Was this helpful?
Was this helpful?
$ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh$ sudo /usr/sbin/td-agent-gem install fluent-plugin-glusterfs
Fetching: fluent-plugin-glusterfs-1.0.0.gem (100%)
Successfully installed fluent-plugin-glusterfs-1.0.0
1 gem installed
Installing ri documentation for fluent-plugin-glusterfs-1.0.0...
Installing RDoc documentation for fluent-plugin-glusterfs-1.0.0...$ ls -alF /var/log/glusterfs/etc-glusterfs-glusterd.vol.log
-rw------- 1 root root 1385 Feb 3 07:21 2014 /var/log/glusterfs/etc-glusterfs-glusterd.vol.log
$ sudo chmod +r /var/log/glusterfs/etc-glusterfs-glusterd.vol.log
$ ls -alF /var/log/glusterfs/etc-glusterfs-glusterd.vol.log
-rw-r--r-- 1 root root 1385 Feb 3 07:21 2014 /var/log/glusterfs/etc-glusterfs-glusterd.vol.log$ sudo cat /etc/td-agent/td-agent.conf
<source>
@type glusterfs_log
path /var/log/glusterfs/etc-glusterfs-glusterd.vol.log
pos_file /var/log/td-agent/etc-glusterfs-glusterd.vol.log.pos
tag glusterfs_log.glusterd
format /^(?<message>.*)$/
</source>
<match glusterfs_log.**>
@type forward
send_timeout 60s
recover_wait 10s
heartbeat_interval 1s
phi_threshold 8
hard_timeout 60s
<server>
name logserver
host 172.31.10.100
port 24224
weight 60
</server>
<secondary>
@type file
path /var/log/td-agent/forward-failed
</secondary>
</match>$ sudo service td-agent start
Starting td-agent: [ OK ]$ curl -L https://toolbelt.treasuredata.com/sh/install-redhat.sh | sh$ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-glusterfs$ sudo cat /etc/td-agent/td-agent.conf
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<match glusterfs_log.glusterd>
@type copy
#local backup
<store>
@type file
path /var/log/td-agent/glusterd
</store>
#Elasticsearch
<store>
@type elasticsearch
host ELASTICSEARCH_URL_HERE
port 9200
index_name glusterfs
type_name fluentd
logstash_format true
</store>
</match>