td-agent is a stable distribution package of fluentd, which is maintained by Arm Treasure Data.
The installation from Ruby gem presents some difficulties for most users, so we made the package easier to install and use. Details on the difference between fluentd and td-agent can be found here.
It's HIGHLY RECOMMENDED to setup ntpd on the nodes to sync the clock. Otherwise, the logs could contain invalid timestamps.
td-agent 2 rpm has two versions, td-agent 2.5 / td-agent 2.3. The point of difference is the bundled ruby version. td-agent 2.5 or later uses ruby 2.5 and td-agent 2.3 or earlier uses ruby 2.1. ruby 2.1 is at end of life so we recommend that you use td-agent 2.5 for new deployments. td-agent 2.5 and td-agent 2.3 use the fluentd v0.12 series so the behavior is the same.
CentOS and RHEL 5, 6, 7 are currently supported.
Executing install-redhat-td-agent2.sh automatically installs td-agent on your machine. The shell script registers a new rpm repository at /etc/yum.repos.d/td.repo and installs the td-agent rpm package.
# td-agent 2.5 or later. Only CentOS/RHEL 6 and 7 for now. $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.5.sh | sh # td-agent 2.3 or earlier $ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sh
Redhat / CentOS
CentOS and RHEL 6, 7 64-bit are currently supported.
Executing install-redhat-td-agent3.sh automatically installs td-agent on your machine. The shell script registers a new rpm repository at /etc/yum.repos.d/td.repo and installs the td-agent rpm package.
$ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh | sh
We use $releasever as the repository path in the script. Use only a major version (such as ver. 7) of RHEL or CentOS as your run environment for $releasever. If your environment uses a version level such as "7.2", change it to a major version or setup TD repository manually.
td-agent provides 2 scripts:
The /usr/lib/systemd/system/td-agent script is provided to start, stop, or restart the agent.
$ sudo systemctl start td-agent.service $ sudo systemctl status td-agent.service ● td-agent.service - td-agent: Fluentd based data collector for Treasure Data Loaded: loaded (/lib/systemd/system/td-agent.service; disabled; vendor preset: enabled) Active: active (running) since Thu 2017-12-07 15:12:27 PST; 6min ago Docs: https://docs.treasuredata.com/articles/td-agent Process: 53192 ExecStart = /opt/td-agent/embedded/bin/fluentd --log /var/log/td-agent/td-agent.log --daemon /var/run/td-agent/td-agent.pid (code = exited, statu Main PID: 53198 (fluentd) CGroup: /system.slice/td-agent.service ├─53198 /opt/td-agent/embedded/bin/ruby /opt/td-agent/embedded/bin/fluentd --log /var/log/td-agent/td-agent.log --daemon /var/run/td-agent/td-agent └─53203 /opt/td-agent/embedded/bin/ruby -Eascii-8bit:ascii-8bit /opt/td-agent/embedded/bin/fluentd --log /var/log/td-agent/td-agent.log --daemon /v Dec 07 15:12:27 ubuntu systemd: Starting td-agent: Fluentd based data collector for Treasure Data... Dec 07 15:12:27 ubuntu systemd: Started td-agent: Fluentd based data collector for Treasure Data.
If you want to customize systemd behavior, put your
init.d (td-agent2 / td-agent3)
/etc/init.d/td-agent script is provided to start, stop, or restart the agent.
$ sudo /etc/init.d/td-agent start Starting td-agent: [ OK ] $ sudo /etc/init.d/td-agent status td-agent (pid 21678) is running...
The following commands are supported:
$ sudo /etc/init.d/td-agent start $ sudo /etc/init.d/td-agent stop $ sudo /etc/init.d/td-agent restart $ sudo /etc/init.d/td-agent status
Make sure your configuration file is located at
If you have many machines on which to install td-agent, consider using the OpsCode chef cookbook, to automate this td-agent process. For the td-agent cookbook, refer to: https://github.com/treasure-data/chef-td-agent
The ChangeLog for td-agent is available here.
For those who are using Treasure Data, refer the following document too.
for Amazon Linux, refer the following document.