Skip to main content

What should we do when td-agent does not work

💻 Tech

Recently I encountered a problem that the td-agent did not work.

When I restart the td-agent, a console showed the message below.

$ sudo service td-agent restart
Restarting td-agent: td-agent                              [FAILED]

It only told the re-starting process failed.
To resolve it, I took the two steps below.

1. Figured out what is going on

Firstly, I checked the status.

$ sudo /etc/init.d/td-agent status
td-agent is not running                                    [FAILED]

It looked like something went wrong.
Then I checked the log.

$ sudo tail -f /var/log/td-agent/td-agent.log
2018-08-28 17:36:44 +0900 [error]: config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Other 'forward' plugin already use same buffer path: type = forward, buffer path = /var/log/td-agent/buffer"

Luckily, it told the reason why.

2. Removed the cause

As the log said, in the config file the ‘forward’ plugin called multiple times.
I fixed it to call the plugin only one time.

After that, it worked.

$ sudo service td-agent restart
Restarting td-agent: td-agent                              [  OK  ]
Tell me what you think of this article! 👉️ @curryisdrink