# Installing Fluentd on RHEL and CentOS

td-agent was discontinued in December 2023 and has been replaced by **fluent-package**. The fluent-package is the official successor maintained by the [Cloud Native Computing Foundation](https://www.cncf.io/projects/).

fluent-package is a stable distribution package of Fluentd. Learn more about the difference between [Fluentd and fluent-package](https://www.fluentd.org/faqs).

## Prerequisites

It's highly recommended that you set up ntpd on the nodes to sync the clock. Otherwise, the logs could contain invalid timestamps.

## Install fluent-package

You can install fluent-package using the following methods. We recommend using fluent-package 6 LTS as this is the currently maintained version.

### RHEL/CentOS/Rocky Linux

RHEL 8, 9 and compatible distributions (Rocky Linux, AlmaLinux) 64-bit are currently supported.

Executing the installation script automatically installs fluent-package on your machine. The shell script registers a new rpm repository and installs the fluent-package rpm package.


```bash
# fluent-package 6 LTS (recommended)
curl -fsSL https://fluentd.cdn.cncf.io/sh/install-redhat-fluent-package6-lts.sh | sh
```

## Launch Daemon

fluent-package uses systemd to manage the service.

### systemd

The systemd service script is provided to start, stop, or restart the agent.


```bash
sudo systemctl start fluentd.service
sudo systemctl status fluentd.service
```

Example output:


```
● fluentd.service - fluentd: Fluentd based data collector
   Loaded: loaded (/usr/lib/systemd/system/fluentd.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2024-01-01 15:12:27 PST; 6min ago
     Docs: https://docs.fluentd.org/
  Process: 53192 ExecStart=/opt/fluent/bin/fluentd --config /etc/fluent/fluentd.conf
 Main PID: 53198 (fluentd)
   CGroup: /system.slice/fluentd.service
           └─53198 /opt/fluent/bin/ruby /opt/fluent/bin/fluentd --config /etc/fluent/fluentd.conf
```

If you want to customize systemd behavior, put your `fluentd.service` into `/etc/systemd/system`.

The following commands are supported:


```bash
sudo systemctl start fluentd.service
sudo systemctl stop fluentd.service
sudo systemctl restart fluentd.service
sudo systemctl status fluentd.service
```

Make sure your configuration file is located at `/etc/fluent/fluentd.conf`.

## Other Resources

For more information, see the [Fluentd Documentation](https://docs.fluentd.org/).

For those who are using Treasure Data, refer to the following document:

- [Continuous Data Import with Fluentd](/int/fluentd-continuous-data-import-integration)