Skip to content
Last updated

Installing TD Agent on Ubuntu and Debian

Treasure Agent (td-agent) is a stable distribution package of Fluentd, which is maintained by Treasure Data and the Cloud Native Computing Foundation.

Before Installation

You can learn more about how to prepare for the installation at Fluentd Installation Guide.

Install or Upgrade td-agent

You can install or upgrade from a previous version using the following methods. We recommend the latest version of td-agent, which can be downloaded from the www.fluentd.org website.

Learn more about how this version compares to earlier versions.

PlatformPlatform VersionPackage or Installer
Ubuntu/Debian2.6+ Linux kernel (64-bit)td-agent v4

td-agent 4

We currently provide td-agent4.x packages for Ubuntu Focal, Bionic, Xenial, and Debian Buster.

A shell script is provided to automate the installation process for each version. The shell script registers a new apt repository at /etc/apt/sources.list.d/treasure-data.list and installs the td-agent deb package.

For Ubuntu Focal,

# Ubuntu 20.04 Focal -- td-agent 4
curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-focal-td-agent4.sh | sh

For Ubuntu Bionic,

# Ubuntu 18.04 Bionic -- td-agent 4
curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-bionic-td-agent4.sh | sh

For Ubuntu Xenial,

# Ubuntu 16.04 Xenial -- td-agent 4
curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent4.sh | sh

For Debian Buster,

# Debian Buster -- td-agent 4
curl -L https://toolbelt.treasuredata.com/sh/install-debian-buster-td-agent4.sh | sh

td-agent 3

Legacy td-agent3.x is available for EOL versions Ubuntu Trusty, Debian Stretch, and Debian Jessie.

A shell script is provided to automate the installation process for each version. The shell script registers a new apt repository at /etc/apt/sources.list.d/treasure-data.list and installs the td-agent deb package.

These commands set up td-agent package for you:

For Ubuntu Trusty,

curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent3.sh | sh

For Debian Stretch,

curl -L https://toolbelt.treasuredata.com/sh/install-debian-stretch-td-agent3.sh | sh

For Debian Jessie,

curl -L https://toolbelt.treasuredata.com/sh/install-debian-jessie-td-agent3.sh | sh

Launch the daemon with systemd

The /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

Example output:

● 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, status=0/SUCCESS)
   Main PID: 53198 (fluentd)
      Tasks: 2 (limit: 4915)
     Memory: 19.9M
        CPU: 1.251s
     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.pid
             └─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 /var/run/td-agent/td-agent.pid

If you want to customize systemd behavior, place your td-agent.service file in /etc/systemd/system.

Launch the daemon with init.d

The /etc/init.d/td-agent script is provided to start, stop, or restart the agent.

sudo /etc/init.d/td-agent restart
sudo /etc/init.d/td-agent status

Example output:

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 /etc/td-agent/td-agent.conf.

The logs are located under /var/log/td-agent. The daemon runs as the td-agent user and td-agent group. After you modify the config file, restart the agent.

Cookbook

See the Chef cookbook to automate this process.

Other Resources