victronenergy / venus-influx-loader

NodeJS server that takes from MQTT into Influx, and config UI and still more
MIT License
12 stars 4 forks source link

Feature request: support for influxdb2 #33

Open nadrog opened 6 months ago

nadrog commented 6 months ago

Would it be possible to get support for influxdb2?

mman commented 5 months ago

Support for InfluxDB 2 and upcoming InfluxDB 3 is definitely in the pipeline, but has so far been put on hold given that InfluxDB 1 is the last version working on armv7 required to support some Raspberry Pi models.

More over getting InfluxDB 2 up and running is more complex (setting up bucket + auth tokens) than InfluxDB 1 (where auth can be specified via environment variables).

Could you please elaborate more about what exactly you are looking for at running against InfluxDB 2.x?

mman commented 5 months ago

Dropping here a link for myself about the automated InfluxDB 2 upgrade/deployment procedure that may be useful.

https://docs.influxdata.com/influxdb/v2/install/upgrade/v1-to-v2/docker/

Using several environment variables we may be able to deploy InfluxDB 2 without user intervention, and automatically create a bucket. InfluxQL queries used to populate Grafana panels should work against InfluxDB 2 without problem in compatibility mode, but additional steps are required to map InfluxDB 2 bucket name to InfluxDB 1 database name.

https://docs.influxdata.com/influxdb/v2/query-data/influxql/

The missing piece will be either upgrading InfluxDB client library to add proper support for InfluxDB 2, or continue storing data using InfluxQL compatibility mode, which however does not support CREATE DATABASE venus command that we use to make sure DB is in place. So that will need to be addressed as well.

nadrog commented 5 months ago

Sure, in my setup, I plan to use Zima board instead of an RPi and I already have a setup on this server that is based on InfluxDB2. It includes SignalK that uses signalk-to-influxdb2 to save to the DB. If I could save some data from CerboGX, it would be great.

mman commented 5 months ago

The code needs to be adapted to use https://www.npmjs.com/package/@influxdata/influxdb-client in order to support Influx 1.8 and Influx 2 at the same time. I can't promise when this will happen but this is one of the minimal steps that will allow us to talk to existing InfluxDB 1 and InfluxDB 2 installations.

Mib83 commented 3 months ago

Hello Can you tell me when you can use Influx 2 or 3?

mman commented 3 months ago

@Mib83 it's on the agenda, but with no clear date set, so can't promise anything at the moment...