Upgrade td-agent from v3 to v4
td-agent “v4” is available since August 2020. You' might’ve been wondering what the upgrade process is. You are in a right place, In this post, we will share the steps we’ve tested and hopefully this will help your experience from v3 to v4.
Differences between td-agent v3 and v4
In the td-agent v4, core components like ruby(2.4 -> 2.7) and jemalloc(4.5.0 -> 5.2.1) were updated as well as removing libraries for 3rd party gems like postgreSQL to improve the maintainability of packages.
In addition to core components, plugins bundled in td-agent are also upgraded. You can learn versions of latest bundled plugins and change logs in the following table.
Note : Versions of bundled plugins depend on minor version of td-agent. When new td-agent will be build, latest plugin at that time will be bundled.
Plugin | td-agent v3.8.0 | td-agent v4.0.1 | Change Log |
---|---|---|---|
fluent-plugin-elasticsearch | 4.0.9 | 4.1.1 | https://github.com/uken/fluent-plugin-elasticsearch/blob/master/History.md |
fluent-plugin-kafka | 0.13.0 | 0.14.1 | https://github.com/fluent/fluent-plugin-kafka/blob/master/ChangeLog |
fluent-plugin-prometheus | 1.8.0 | 1.8.2 | https://github.com/fluent/fluent-plugin-prometheus/blob/master/ChangeLog |
fluent-plugin-prometheus-pushgateway | 0.0.2 | 0.0.2 | - |
fluent-plugin-record-modifier | 2.1.0 | 2.1.0 | - |
fluent-plugin-rewrite-tag-filter | 2.3.0 | 2.3.0 | - |
fluent-plugin-s3 | 1.3.2 | 1.4.0 | https://github.com/fluent/fluent-plugin-s3/blob/master/ChangeLog |
fluent-plugin-systemd | 1.0.2 | 1.0.2 | - |
fluent-plugin-td | 1.1.0 | 1.1.0 | - |
fluent-plugin-tdmonitoring | 0.2.4 | N/A | - |
fluent-plugin-webhdfs | 1.2.5 | 1.2.5 | - |
Upgrade steps
During the upgrade process, plugins bundled in td-agent are automatically upgraded. With that being said, other plugins added on your own are not included. You should review if you need to upgrade plugins since some directory structures from v3 and v4 are changed.
In this post, I will show steps with plugins added on my own, “fluent-plugin-mongo“ for instance. Here is sample configuration file I used through steps.
1. Review what plugins are installed together with td-agent v3.
You can also find installed plugins under “/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/“ directories.
2. Stop td-agent v3 daemon.
3. Run installation script of td-agent v4.
When RedHat, you can run following script.
You can find more information about the installation script in Fluend Doc - Installation.
4. Confirm if td-agent v4 is properly installed.
5. Reload td-agent daemon.
6. Check installed plugins.
You can see bundled plugins are upgraded as well but can not find plugins added on my own. In this post, added plugin was “fluent-plugin-mongo“ and it is not shown in installed list.
7. Install plugins added on my own.
As for td-agent v4, “fluent-plugin-mongo“ was installed under “/opt/td-agent/lib/ruby/gems/2.7.0/gems/” directories.
8. Start td-agent v4 daemon.
9. Check if there are no error messages in tg-agent logs.
10. As for my sample configuration, I restart “sshd“ service for instance and see messages are stored in MongoDB as expected.
i) Restart “sshd“ daemon.
ii) Confirm messages in “stdout“ output.
iii) Create sample script to read data from MongoDB.
iv) Run sample script and confirm if same messages with “stdout“ are available.
Now, upgrading steps are completed. Happy Logging!
Commercial Service - We are here for you.
In the Fluentd Subscription Network, we will provide you consultancy and professional services to help you run Fluentd and Fluent Bit with confidence by solving your pains. Service desk is also available for your operation and the team is equipped with the Diagtool and knowledge of tips running Fluentd in production. Contact us anytime if you would like to learn more about our service offerings.