-->

DEVOPSZONES

  • Recent blogs

    How to Install td-agent on CentOS/RHEL 7

    How to Install td-agent on CentOS/RHEL 7



    This article explains how to install the td-agent rpm package, the stable Fluentd distribution package maintained by Treasure Data, Inc.

    What is td-agent?
    Fluentd is written in Ruby for flexibility, with performance-sensitive parts in C. However, some users may have difficulty installing and operating a Ruby daemon. That is why Treasure Data, Inc provides the stable distribution of Fluentd, called td-agent. 

    Step 1: Install from rpm Repository

    Red Hat / CentOS

    Download and execute the install script with curl:
    # td-agent 4
    $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh

    # td-agent 3
    $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh | sh



    Executing this script will automatically install td-agent on your machine. This shell script registers a new rpm repository at /etc/yum.repos.d/td.repo and installs td-agent.

    Step 2: Start Services

    $ sudo systemctl start td-agent.service
    $ sudo systemctl status td-agent.service
    $ sudo systemctl stop td-agent.service

    Step 3: Post Sample Logs via HTTP

    The default configuration (/etc/td-agent/td-agent.conf) is to receive logs at an HTTP endpoint and route them to stdout. For td-agent logs, see /var/log/td-agent/td-agent.log.
    You can post sample log records with curl command:

    $ curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test
    $ tail -n 1 /var/log/td-agent/td-agent.log
    2018-01-01 17:51:47 -0700 debug.test: {"json":"message"}





    No comments