|
| 1 | +# Install `fluent-package` by DEB Package \(Debian/Ubuntu\) |
| 2 | + |
| 3 | +This article explains how to install stable versions of `fluent-package` deb packages, the stable Fluentd distribution packages maintained by [Fluentd Project](https://www.fluentd.org/). |
| 4 | + |
| 5 | +## What is `fluent-package`? |
| 6 | + |
| 7 | +Please see [fluent-package-v5-vs-td-agent](../../quickstart/fluent-package-v5-vs-td-agent.md). |
| 8 | + |
| 9 | +## How to install `fluent-package` |
| 10 | + |
| 11 | +{% hint style='info' %} |
| 12 | +NOTE: |
| 13 | + |
| 14 | +* `fluent-package` will be shipped in two flavors - normal release version and LTS (Long Term Support) version. See [Scheduled support lifecycle announcement about Fluent Package v6](https://www.fluentd.org/blog/fluent-package-v6-scheduled-lifecycle) about difference between this two flavors. |
| 15 | +* If you upgrade from `td-agent` v4, See [Upgrade to fluent-package v5](https://www.fluentd.org/blog/upgrade-td-agent-v4-to-v5). |
| 16 | +* Do not directly upgrade from v3 to v5. Such a workflow is not supported. It causes a trouble. Upgrade in stages. (v3 to v4, then v4 to v5) |
| 17 | +{% endhint %} |
| 18 | + |
| 19 | +{% hint style='danger' %} |
| 20 | +The following are deprecated fluent-package and td-agent (EOL) information: |
| 21 | + |
| 22 | +* About [Treasure Agent (td-agent) v4 (EOL)](https://www.fluentd.org/blog/schedule-for-td-agent-4-eol), See [Install by DEB Package v4](../install-by-deb-td-agent-v4.md). |
| 23 | +* About [Treasure Agent (td-agent) 3 will not be maintained anymore](https://www.fluentd.org/blog/schedule-for-td-agent-3-eol), see [Install by DEB Package v3](../install-by-deb-td-agent-v3.md). |
| 24 | +{% endhint %} |
| 25 | + |
| 26 | +### Step 0: Before Installation |
| 27 | + |
| 28 | +Please follow the [Pre-installation Guide](../before-install.md) to configure your OS properly. |
| 29 | + |
| 30 | +### Step 1: Install from Apt Repository |
| 31 | + |
| 32 | +NOTE: If your OS is not supported, consider [gem installation](../install-by-gem.md) instead. |
| 33 | + |
| 34 | +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/fluent.sources` (or `/etc/apt/sources.list.d/fluent-lts.sources`) and installs the `fluent-package` deb package. |
| 35 | + |
| 36 | +#### For Ubuntu Noble: |
| 37 | + |
| 38 | +##### fluent-package 5 (LTS) |
| 39 | + |
| 40 | +```bash |
| 41 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-noble-fluent-package5-lts.sh | sh |
| 42 | +``` |
| 43 | + |
| 44 | +##### fluent-package 5 |
| 45 | + |
| 46 | +```bash |
| 47 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-noble-fluent-package5.sh | sh |
| 48 | +``` |
| 49 | + |
| 50 | +#### For Ubuntu Jammy: |
| 51 | + |
| 52 | +##### fluent-package 5 (LTS) |
| 53 | + |
| 54 | +```bash |
| 55 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-jammy-fluent-package5-lts.sh | sh |
| 56 | +``` |
| 57 | + |
| 58 | +##### fluent-package 5 |
| 59 | + |
| 60 | +```bash |
| 61 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-jammy-fluent-package5.sh | sh |
| 62 | +``` |
| 63 | + |
| 64 | +#### For Ubuntu Focal: |
| 65 | + |
| 66 | +{% hint style='info' %} |
| 67 | +fluent-package v6 will not be shipped for Ubuntu Focal. |
| 68 | +{% endhint %} |
| 69 | + |
| 70 | +##### fluent-package 5 (LTS) |
| 71 | + |
| 72 | +```bash |
| 73 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-focal-fluent-package5-lts.sh | sh |
| 74 | +``` |
| 75 | + |
| 76 | +##### fluent-package 5 |
| 77 | + |
| 78 | +```bash |
| 79 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-focal-fluent-package5.sh | sh |
| 80 | +``` |
| 81 | + |
| 82 | +#### For Debian Bookworm: |
| 83 | + |
| 84 | +##### fluent-package 5 (LTS) |
| 85 | + |
| 86 | +```bash |
| 87 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-debian-bookworm-fluent-package5-lts.sh | sh |
| 88 | +``` |
| 89 | + |
| 90 | +##### fluent-package 5 |
| 91 | + |
| 92 | +```bash |
| 93 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-debian-bookworm-fluent-package5.sh | sh |
| 94 | +``` |
| 95 | + |
| 96 | +#### For Debian Bullseye: |
| 97 | + |
| 98 | +{% hint style='info' %} |
| 99 | +fluent-package v6 will not be shipped for Debian Bullseye. |
| 100 | +{% endhint %} |
| 101 | + |
| 102 | +##### fluent-package 5 (LTS) |
| 103 | + |
| 104 | +```bash |
| 105 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-debian-bullseye-fluent-package5-lts.sh | sh |
| 106 | +``` |
| 107 | + |
| 108 | +##### fluent-package 5 |
| 109 | + |
| 110 | +```bash |
| 111 | +curl -fsSL https://fluentd.cdn.cncf.io/sh/install-debian-bullseye-fluent-package5.sh | sh |
| 112 | +``` |
| 113 | + |
| 114 | +### Step 2: Launch Daemon |
| 115 | + |
| 116 | +### `systemd` |
| 117 | + |
| 118 | +Use `/lib/systemd/system/fluentd` script to `start`, `stop`, or `restart` the agent: |
| 119 | + |
| 120 | +```text |
| 121 | +$ sudo systemctl start fluentd.service |
| 122 | +$ sudo systemctl status fluentd.service |
| 123 | + sudo systemctl status fluentd |
| 124 | +● fluentd.service - fluentd: All in one package of Fluentd |
| 125 | + Loaded: loaded (/lib/systemd/system/fluentd.service; enabled; vendor preset: enabled) |
| 126 | + Active: active (running) since Wed 2023-08-16 08:18:22 UTC; 18s ago |
| 127 | + Docs: https://docs.fluentd.org/ |
| 128 | + Process: 494 ExecStart=/opt/fluent/bin/fluentd --log $FLUENT_PACKAGE_LOG_FILE --daemon /var/run/fluent/fluentd.pid $FLUENT_PACKAGE_OPTI> |
| 129 | + Main PID: 826 (fluentd) |
| 130 | + Tasks: 9 (limit: 4660) |
| 131 | + Memory: 95.4M |
| 132 | + CPU: 731ms |
| 133 | + CGroup: /system.slice/fluentd.service |
| 134 | + ├─826 /opt/fluent/bin/ruby /opt/fluent/bin/fluentd --log /var/log/fluent/fluentd.log --daemon /var/run/fluent/fluentd.pid |
| 135 | + └─833 /opt/fluent/bin/ruby -Eascii-8bit:ascii-8bit /opt/fluent/bin/fluentd --log /var/log/fluent/fluentd.log --daemon /var/run> |
| 136 | +``` |
| 137 | + |
| 138 | +To customize `systemd` behavior, put your `fluentd.service` in `/etc/systemd/system`. |
| 139 | + |
| 140 | +NOTE: In fluent-package v5, path is different. `/opt/fluent/bin` instead of `/opt/td-agent/bin` |
| 141 | + |
| 142 | +### Step 3: Post Sample Logs via HTTP |
| 143 | + |
| 144 | +The default configuration \(`/etc/fluent/fluentd.conf`\) is to receive logs at an HTTP endpoint and route them to `stdout`. For `fluent-package` logs, see `/var/log/fluent/fluentd.log`. |
| 145 | + |
| 146 | +You can post sample log records with `curl` command: |
| 147 | + |
| 148 | +```text |
| 149 | +$ curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test |
| 150 | +$ tail -n 1 /var/log/fluent/fluentd.log |
| 151 | +2018-01-01 17:51:47 -0700 debug.test: {"json":"message"} |
| 152 | +``` |
| 153 | + |
| 154 | +## Next Steps |
| 155 | + |
| 156 | +You are now ready to collect real logs with Fluentd. Refer to the following tutorials on how to collect data from various sources: |
| 157 | + |
| 158 | +* Basic Configuration |
| 159 | + * [Config File](../../configuration/config-file.md) |
| 160 | +* Application Logs |
| 161 | + * [Ruby](../../language-bindings/ruby.md), [Java](../../language-bindings/java.md), [Python](../../language-bindings/python.md), [PHP](../../language-bindings/php.md), |
| 162 | + |
| 163 | + [Perl](../../language-bindings/perl.md), [Node.js](../../language-bindings/nodejs.md), [Scala](../../language-bindings/scala.md) |
| 164 | +* Examples |
| 165 | + * [Store Apache Log into Amazon S3](../../how-to-guides/apache-to-s3.md) |
| 166 | + * [Store Apache Log into MongoDB](../../how-to-guides/apache-to-mongodb.md) |
| 167 | + * [Data Collection into HDFS](../../how-to-guides/http-to-hdfs.md) |
| 168 | + |
| 169 | +{% hint style='info' %} |
| 170 | +There are some commercial supports for Fluentd, see [Enterprise Services](https://www.fluentd.org/enterprise_services). |
| 171 | +If you use Fluentd on production, Let's share your use-case/testimonial on [Testimonials](https://www.fluentd.org/testimonials) page. |
| 172 | +Please consider to feedback via [GitHub](https://github.com/fluent/fluentd-website/issues/new?template=testimonials.yml). |
| 173 | +{% endhint %} |
| 174 | + |
| 175 | +If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License. |
0 commit comments