fluent-plugin-mongo icon indicating copy to clipboard operation
fluent-plugin-mongo copied to clipboard

fluentd stopped logging due to outdated position file

Open thkoch2001 opened this issue 8 years ago • 2 comments

I just had a customer case where fluentd stopped sending mongodb logs. Removing the mongodb.pos file solved the issue.

I believe fluentd (or this plugin?) somehow did not notice that the mongodb log file was rotated. I do not know enough about fluentd or mongodb to suggest any mitigation strategy.

thkoch2001 avatar Jul 19 '16 09:07 thkoch2001

What does 'the mongodb log file was rotated' mean? It means do you re-create collection?

repeatedly avatar Jul 24 '16 13:07 repeatedly

With log file rotation I mean what the logrotate unix tool does, although I do not know whether it was used here. On the customers instance I saw files like mongodb.log, mongodb.1.log, mongodb.2.log, mongodb.3.log.

So something (mongodb itself or logrotate) apparently, from time to time, renames the mongodb.log file to mongodb.1.log (and increment the names of the oter files) and makes mongodb log to a new mongodb.log file

Of course, fluentd needs to know that there is a new mongodb.log file so that it starts to read from the first line again.

thkoch2001 avatar Jul 25 '16 12:07 thkoch2001