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

Upgrade to support InfluxDB 2.0 #45

Closed
jomjol opened this issue Apr 16, 2019 · 29 comments
Closed

Upgrade to support InfluxDB 2.0 #45

jomjol opened this issue Apr 16, 2019 · 29 comments
Assignees

Comments

@jomjol
Copy link

jomjol commented Apr 16, 2019

Support to connect to InfluxDB 2.0:
https://www.influxdata.com/blog/influxdb-2-0-alpha-release-and-the-road-ahead/

Although still in the Alpha state, the 2.0 version support enhanced DB management tools (e.g. Influx language to further process input data).

@Apollon77
Copy link
Contributor

As I know influxdb 2.0 will still support InfluxQA as now, so what would be the needed change?
OR do you say we need to switch to use Flux protocol?

@jomjol
Copy link
Author

jomjol commented Apr 16, 2019 via email

@Apollon77
Copy link
Contributor

When I understand https://github.com/influxdata/influxdb correctly the the Influx 1.x compat layer is still "planned" and so not implemented right now ... so ay to early :-)
So for now I can not recommend Alpha 2.0 to be used and me personally will not start thinking about checking this before a beta is out because I do not have time to adopt to weekly alpha changes ;-)

@Apollon77
Copy link
Contributor

BTW: The adapter is relaying on https://github.com/node-influx/node-influx to be updated to be 2.0 compatible ... so first an issue there would be any idea, but projects somehow seems not that active :-(

@jomjol
Copy link
Author

jomjol commented Apr 16, 2019 via email

@tvojtech
Copy link

There are no plans to support Influx v2 by node-influx node-influx/node-influx#483

@Apollon77
Copy link
Contributor

Thank you for linking ... so means that we might need to migrate over to https://github.com/influxdata/influxdb-client-js/ ... So means: 1. modularize code so that user can select the influxdb version

@savek-cc
Copy link

Is anyone currently working on this?

@Apollon77
Copy link
Contributor

No, influxdb2 will get a v1 api compatibility layer so in a first place it is not that needed and changing over to a new library will be a bigger effort as it seems because it should also contain "thinking about better data structure" and such. And noone had time for this so far.

Why you ask? We are also interested in PRs :-)

@savek-cc
Copy link

Deleting mv v2 instance (though I liked it better) and will stick with 1.8 for now... PR - if my dev skills would extend to node; maybe some other time ;).

@savek-cc
Copy link

Tested today with the influxDB 2.0 RC. Authentication works using a token as password; The adapter does not initialize, as the "show databases" command is not supported by the API compatibility layer (only /read and /write are, see https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/).
So apparently there isn't a way to use this adapter with influxdb 2.0 even with the provided compatibility layer.

@Apollon77
Copy link
Contributor

Hm ... we could add a way to ignore DB creation and manually show the commands to create dbs or such ... ?!

@Apollon77
Copy link
Contributor

@savek-cc can you please post a log from a start with influxdb 2?

@savek-cc
Copy link

savek-cc commented Nov 1, 2020

2020-11-01 20:40:50.946 - debug: influxdb.0 (4244) Redis Objects: Use Redis connection: 127.0.0.1:9001
2020-11-01 20:40:50.958 - debug: influxdb.0 (4244) Objects client ready ... initialize now
2020-11-01 20:40:50.959 - debug: influxdb.0 (4244) Objects create System PubSub Client
2020-11-01 20:40:50.960 - debug: influxdb.0 (4244) Objects create User PubSub Client
2020-11-01 20:40:50.961 - debug: influxdb.0 (4244) Objects client initialize lua scripts
2020-11-01 20:40:50.968 - debug: influxdb.0 (4244) Objects connected to redis: 127.0.0.1:9001
2020-11-01 20:40:50.970 - debug: influxdb.0 (4244) objectDB connected
2020-11-01 20:40:50.970 - debug: influxdb.0 (4244) Redis States: Use Redis connection: 127.0.0.1:9000
2020-11-01 20:40:50.973 - debug: influxdb.0 (4244) States create User PubSub Client
2020-11-01 20:40:50.974 - debug: influxdb.0 (4244) States create System PubSub Client
2020-11-01 20:40:50.976 - debug: influxdb.0 (4244) States connected to redis: 127.0.0.1:9000
2020-11-01 20:40:50.976 - debug: influxdb.0 (4244) statesDB connected
2020-11-01 20:40:51.378 - debug: influxdb.0 (4244) Plugin sentry Initialize Plugin (enabled=true)
2020-11-01 20:40:52.653 - info: influxdb.0 (4244) starting. Version 1.9.2 in /opt/iobroker/node_modules/iobroker.influxdb, node: v12.19.0, js-controller: 3.1.6
2020-11-01 20:40:52.700 - info: influxdb.0 (4244) No stored data from last exit found
2020-11-01 20:40:52.700 - silly: influxdb.0 (4244) redis psubscribe cfg.o.*
2020-11-01 20:40:52.701 - info: influxdb.0 (4244) Connecting http://192.168.0.8:8086 ...
2020-11-01 20:40:52.712 - silly: influxdb.0 (4244) States system redis pmessage system.adapter.influxdb.0.logLevel/system.adapter.influxdb.0.logLevel:{"val":"silly","ack":true,"ts":1604259652710,"q":0,"from":"system.adapter.influxdb.0","lc":1604259652710}
2020-11-01 20:40:52.715 - debug: influxdb.0 (4244) connected set to false
2020-11-01 20:40:52.888 - error: influxdb.0 (4244) Error: bad response from server
2020-11-01 20:41:02.889 - info: influxdb.0 (4244) Connecting http://192.168.0.8:8086 ...
2020-11-01 20:41:02.892 - error: influxdb.0 (4244) Error: bad response from server
2020-11-01 20:41:12.892 - info: influxdb.0 (4244) Connecting http://192.168.0.8:8086 ...
2020-11-01 20:41:12.895 - error: influxdb.0 (4244) Error: bad response from server
2020-11-01 20:41:22.895 - info: influxdb.0 (4244) Connecting http://192.168.0.8:8086 ...
2020-11-01 20:41:22.897 - error: influxdb.0 (4244) Error: bad response from server
2020-11-01 20:41:32.198 - debug: pioneer.0 (931) system.adapter.admin.0: logging false
2020-11-01 20:41:32.199 - silly: influxdb.0 (4244) States system redis pmessage *.logging/system.adapter.admin.0.logging:{"val":false,"ack":true,"ts":1604259692196,"q":0,"from":"system.adapter.admin.0","lc":1604259692196}
2020-11-01 20:41:32.200 - debug: influxdb.0 (4244) system.adapter.admin.0: logging false
2020-11-01 20:41:32.898 - info: influxdb.0 (4244) Connecting http://192.168.0.8:8086 ...
2020-11-01 20:41:32.900 - error: influxdb.0 (4244) Error: bad response from server
2020-11-01 20:41:42.901 - info: influxdb.0 (4244) Connecting http://192.168.0.8:8086 ...
2020-11-01 20:41:42.904 - error: influxdb.0 (4244) Error: bad response from server
2020-11-01 20:41:43.432 - debug: pioneer.0 (931) system.adapter.admin.0: logging true
2020-11-01 20:41:43.433 - silly: influxdb.0 (4244) States system redis pmessage *.logging/system.adapter.admin.0.logging:{"val":true,"ack":true,"ts":1604259703430,"q":0,"from":"system.adapter.admin.0","lc":1604259703430}
2020-11-01 20:41:43.434 - debug: influxdb.0 (4244) system.adapter.admin.0: logging true
2020-11-01 20:41:44.125 - info: unifi.0 (901) Update done

That log doesn't really say much on its own I guess.
The InfluxDB 2.0 log also only shows the query at this level (SHOW DATABASES).

@LePremier
Copy link

LePremier commented Apr 11, 2021

savek-cc commented on 28 Oct 2020: "Authentication works using a token as password"

Does this mean you have been able to connect to your installation using the iobroker adapter? Tried it with Influx Version Version 2.0.4 (4e7a59b) but got "(146990) Error: {"code":"unauthorized","message":"Unauthorized"}"

Are there any further updates on implementations / ideas / workarounds to get data into influxdb 2? Or is it maybe even better to find another way (database) to make iobroker data available in Grafana?

Many thanks.

Cheers!

@savek-cc
Copy link

@LePremier it's been a while since I tried, but I am somewhat (quite?) certain that it was authorized. Only after that authentication it failed with invalid commands afaict.

@LePremier
Copy link

Hm, ok. Even the first step doesn't seem to work in my setup.

Anyways,

@savek-cc have you found another way to get your iobroker data be stored in an external DB (and be visualized in Grafana)? E.g. by using another data base, like mySQL with the ioBroker SQL Adapter?

@Apollon77 et al.: Are there any further updates on implementations / ideas / workarounds to get data into influxdb 2? Or can you recommend something else?

Many thanks!

@Apollon77
Copy link
Contributor

In fact from my side we could add a flag that is bypassing then the "db initialization" because we know that at least sending data works via the compatibility layer. No idea about the kind of selections we do.

For this to work for new users of the adapter we need to add a guide on how to create the relevant stuff for influxdb by themself (the "database and tables and such"). Then we could have a "veeeery basic compatibility thing" working.

A real support will rewriting the whole data management in teh adapter to use a influxdb 2 library ... This is a bigger thing and mainly needs time. It is on my list, but otehr stuff is on top if it. Till now no other dev was found to take on that

@LePremier
Copy link

Thanks @Apollon77. Having the mentioned "very basic compatibility thing" working would be a great short term workaround. Would be great if you could provide the required details. I would than try to do the setup based on that. While doing so I could do some screenshots and notes that can be used for a more detailed documentation afterwards?

I also would love to support you with a more sustainable rewrite of the adapter, but unfortunately I think my programming skills are not yet advanced enough :( ... But please let me know if I can support the project in another way (e.g. collecting required information, etc.)

@Apollon77
Copy link
Contributor

This topic is currently in development and we might have a testversion soon that can then support influxdb 1.8 and 2.x. Stay tuned, we then need testers :-)

@LePremier
Copy link

I am in! 😃 ... really great news. Many thanks for your efforts.

@astrakid
Copy link

great to hear!

@RkcCorian
Copy link

Very nice, many thanks!!!!!

@Apollon77
Copy link
Contributor

I hope I find time till latest weekend to check the PR and prepare a testing version

@Sp0b1e
Copy link

Sp0b1e commented May 18, 2021

Is there any news about the current status?

What about the pull request that is supposed to support InfluxDB2.0?

@Apollon77
Copy link
Contributor

Yes, still on list, hopefully soon. Was bound in private live to an other topic ...

@josefzahner
Copy link

I'm really curious about this update as well :-D. Hope to see it soon

@Apollon77
Copy link
Contributor

Ok gyus, lets go ... Tests started --> https://forum.iobroker.net/topic/46098/test-adapter-influxdb-2-0

@Apollon77
Copy link
Contributor

Adapter 2.1.1 officially released just now

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

No branches or pull requests

10 participants