Fluentd 安装使用

安装

# 安装
curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh

# 支持命令
/etc/init.d/td-agent start
/etc/init.d/td-agent stop
/etc/init.d/td-agent restart
/etc/init.d/td-agent status

使用

#安装完成之后可执行文件在/opt/td-agent/embedded/bin/目录下
#配置文件在/etc/td-agent/目录下

#编辑配置文件/etc/td-agent/in_docker.conf
<source>
  type forward
  port 24224
  bind 0.0.0.0
</source>

<match *.*>
  type stdout
</match>
# 启动监听
root@localhost:usr# cd /opt/td-agent/embedded/bin/
root@localhost:bin# ls
aws-rb      createuser  fluent-debug          infotocap   lzmadec           openssl            pg_receivexlog  postmaster  reset             testrb    vacuumlo
aws.rb      c_rehash    fluentd-ui            initdb      lzmainfo          pg_archivecleanup  pg_resetxlog    pprof       ri                thor      xml2-config
b2json      dropdb      fluent-gem            irb         makedepend        pg_basebackup      pg_restore      psql        ruby              tic       xmlcatalog
bundle      droplang    fluent-post           j2bson      mongo_console     pgbench            pg_standby      puma        sass              tilt      xmllint
bundler     dropuser    fluent-scribe-remote  kramdown    mongo-tail        pg_config          pg_test_fsync   pumactl     sass-convert      toe       xslt-config
captoinfo   ecpg        gem                   ldiff       ncurses5-config   pg_controldata     pg_test_timing  rackup      scss              tput      xsltproc
clear       erb         haml                  libtool     ncursesw5-config  pg_ctl             pg_upgrade      rails       sprockets         tset      xz
clusterdb   erubis      htmldiff              libtoolize  nokogiri          pg_dump            pg_xlogdump     rake        tabs              unlzma    xzcat
createdb    fluent-cat  httpclient            lzcat       ohai              pg_dumpall         pkg-config      rdoc        td                unxz      xzdec
createlang  fluentd     infocmp               lzma        oid2name          pg_isready         postgres        reindexdb   td_agent_ui_ruby  vacuumdb
root@localhost:bin# ./fluentd -c /etc/td-agent/in_docker.conf 
2016-09-05 13:47:53 -0400 [info]: reading config file path="/etc/td-agent/in_docker.conf"
2016-09-05 13:47:53 -0400 [info]: starting fluentd-0.12.26
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-mixin-config-placeholders' version '0.4.0'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-mixin-plaintextformatter' version '0.2.6'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-plugin-mongo' version '0.7.13'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-plugin-rewrite-tag-filter' version '1.5.5'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-plugin-s3' version '0.6.8'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-plugin-scribe' version '0.10.14'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-plugin-td' version '0.10.28'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-plugin-td-monitoring' version '0.2.2'
2016-09-05 13:47:53 -0400 [info]: gem 'fluent-plugin-webhdfs' version '0.4.2'
2016-09-05 13:47:53 -0400 [info]: gem 'fluentd' version '0.12.26'
2016-09-05 13:47:53 -0400 [info]: adding match pattern="*.*" type="stdout"
2016-09-05 13:47:53 -0400 [info]: adding source type="forward"
2016-09-05 13:47:53 -0400 [info]: using configuration file: <ROOT>
  <source>
    type forward
    port 24224
    bind 0.0.0.0
  </source>
  <match *.*>
    type stdout
  </match>
</ROOT>
2016-09-05 13:47:53 -0400 [info]: listening fluent socket on 0.0.0.0:24224

# 运行docker容器,可以看fluentd打印信息
docker run --name test02 --log-driver=fluentd imekaku/simple-web echo "Hello Fluentd

参考链接:

Fluent官方文档:docs-fluentd

Docker-log-driver使用fluentd

Fluentd使用Mongodb:fluentd-mongdb

fluentd基本工具概览

2 个评论 在 “Fluentd 安装使用

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。

返回顶部