Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegraf should be resilient to Influx dying and the database going away #836

Closed
jchauncey opened this issue Mar 11, 2016 · 2 comments
Closed

Comments

@jchauncey
Copy link

Right now I am running Influx without persistent storage (it runs on kubernetes and is not saving data to the host filesystem). So that means if the pod dies the database goes away.

Currently, Telegraf will reconnect to Influx but fails to send any data because the database has gone away. I patched my local telegraf copy by removing the following conditional - https://github.com/influxdata/telegraf/blob/master/plugins/outputs/influxdb/influxdb.go#L163

This seemed to fix the problem but now its not reusing the client connection. It would be nice if the database check was performed further down the stack so that way if the database goes away telegraf can just recreate it.

@steverweber
Copy link

I agree that telegraf should be resilient to fails!

However I feel telegraf should not create the database if it is missing. perhaps could be a config option ,,, but not default behavior.

Perhaps for your setup just put a cron job on your influxdb server to create database.

@sparrc
Copy link
Contributor

sparrc commented Mar 14, 2016

I think we could just clear out the i.conns slice if all writes fail before we return from Write() (which will trigger a call to i.Connect on the next write)

But @jchauncey if you don't care that much about your data, you might want to use the UDP service listener on InfluxDB. The UDP listener has lower overhead on both sides, and it will also create your database for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants