InfluxDB Setup - not Creating a Database

Hi

I installed Influxdb and Grafana and both are running. systemctl status influxdb returns active(running).
I installed the Influxdb add on in Openhab and I can access Grafana from the OH3 Paper Ui and login.
I have created a Database: openhab_IDB and it shows up using show databases in influx cli.

My Problem is that its not writting any Data in the given directory for influxdb specified in the influxdb.conf file only the _internal Database shows up and i can’t find any Data in Grafana.

My influxdb.persist file:

Strategies  {
everyMinute :"0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
}

Items  {
T-PV.KM_OF      : strategy = everyChange
T-PV.Ref_OF     : strategy = everyChange
}

Additional Info: running Openhabian v. 3.2.0 on a Raspi 4B, running Influxdb version 1.8.10

Thanks

Besides that the DB is being shown is also content being shown there.

Is there any problem begin reported in

sudo journalctl -u influxdb

It is possible to enable logging in /etc/influxdb/influxdb.conf on influxdb server site.
It also may help to increase the logging lievel at openhab end in karaf console by changing the log level for org.openhab.persistence.influxdb

From Items | openHAB

The only characters permitted in an Item name are letters, numbers and the underscore character. Names must not begin with numbers. Spaces and special characters are not permitted.

So neither a - is allowed nor the .

1 Like

Thanks i fixed those, your surely saved me from future headache.
But this isn’t the only Problem :frowning:

no there isn’t any content shown, thats the main problem.

sudo journalctl -u influxdb

not sure what i am looking at here.

Apr 19 09:07:59 openhabian systemd[1]: Starting InfluxDB is an open-source, distributed, time series database...
Apr 19 09:07:59 openhabian influxd-systemd-start.sh[4618]: Merging with configuration at: /etc/influxdb/influxdb.conf
Apr 19 09:07:59 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:07:59.977473Z lvl=info msg="InfluxDB starting" log_id=0hI5JKQG000 version=1.8.10 branch=1.8 commit=688e697c51fd
Apr 19 09:07:59 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:07:59.980109Z lvl=info msg="Go runtime" log_id=0hI5JKQG000 version=go1.13.8 maxprocs=4
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.084196Z lvl=info msg="Using data dir" log_id=0hI5JKQG000 service=store path=/var/lib/influxdb/data
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.086064Z lvl=info msg="Compaction settings" log_id=0hI5JKQG000 service=store max_concurrent_compactions=2 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.087257Z lvl=info msg="Open store (start)" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open op_event=start
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.117827Z lvl=info msg="Opened file" log_id=0hI5JKQG000 engine=tsm1 service=filestore path=/var/lib/influxdb/data/_internal/monitor/5/000000002-000000002.tsm id=0 duration=0.606ms
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.116416Z lvl=info msg="Opened file" log_id=0hI5JKQG000 engine=tsm1 service=filestore path=/var/lib/influxdb/data/_internal/monitor/2/000000001-000000001.tsm id=0 duration=0.543ms
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4639]: Merging with configuration at: /etc/influxdb/influxdb.conf
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.148267Z lvl=info msg="Opened file" log_id=0hI5JKQG000 engine=tsm1 service=filestore path=/var/lib/influxdb/data/_internal/monitor/4/000000002-000000002.tsm id=0 duration=7.419ms
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.167711Z lvl=info msg="Opened file" log_id=0hI5JKQG000 engine=tsm1 service=filestore path=/var/lib/influxdb/data/_internal/monitor/7/000000001-000000001.tsm id=0 duration=9.437ms
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.170910Z lvl=info msg="Opened shard" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/5 duration=56.>
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.181108Z lvl=info msg="Opened file" log_id=0hI5JKQG000 engine=tsm1 service=filestore path=/var/lib/influxdb/data/_internal/monitor/3/000000001-000000001.tsm id=0 duration=0.733ms
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.183155Z lvl=info msg="Opened shard" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/4 duration=70.>
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.187193Z lvl=info msg="Opened shard" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/2 duration=75.>
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.193475Z lvl=info msg="Opened file" log_id=0hI5JKQG000 engine=tsm1 service=filestore path=/var/lib/influxdb/data/_internal/monitor/6/000000003-000000002.tsm id=0 duration=2.140ms
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.204264Z lvl=info msg="Opened shard" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/3 duration=33.>
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.207665Z lvl=info msg="Opened shard" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/7 duration=95.>
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.216844Z lvl=info msg="Opened shard" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/6 duration=33.>
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.218816Z lvl=info msg="Open store (end)" log_id=0hI5JKQG000 service=store trace_id=0hI5JKql000 op_name=tsdb_open op_event=end op_elapsed=131.574ms
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219248Z lvl=info msg="Opened service" log_id=0hI5JKQG000 service=subscriber
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219561Z lvl=info msg="Starting monitor service" log_id=0hI5JKQG000 service=monitor
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219625Z lvl=info msg="Registered diagnostics client" log_id=0hI5JKQG000 service=monitor name=build
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219673Z lvl=info msg="Registered diagnostics client" log_id=0hI5JKQG000 service=monitor name=runtime
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219719Z lvl=info msg="Registered diagnostics client" log_id=0hI5JKQG000 service=monitor name=network
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219789Z lvl=info msg="Registered diagnostics client" log_id=0hI5JKQG000 service=monitor name=system
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219862Z lvl=info msg="Starting precreation service" log_id=0hI5JKQG000 service=shard-precreation check_interval=10m advance_period=30m
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219927Z lvl=info msg="Starting snapshot service" log_id=0hI5JKQG000 service=snapshot
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.219978Z lvl=info msg="Starting continuous query service" log_id=0hI5JKQG000 service=continuous_querier
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.220128Z lvl=info msg="Starting HTTP service" log_id=0hI5JKQG000 service=httpd authentication=true
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.220190Z lvl=info msg="opened HTTP access log" log_id=0hI5JKQG000 service=httpd path=stderr
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.220232Z lvl=info msg="Auth is enabled but shared-secret is blank. BearerAuthentication is disabled." log_id=0hI5JKQG000 service=httpd
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.220607Z lvl=info msg="Listening on HTTP" log_id=0hI5JKQG000 service=httpd addr=127.0.0.1:8086 https=false
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.220819Z lvl=info msg="Starting retention policy enforcement service" log_id=0hI5JKQG000 service=retention check_interval=30m
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.221692Z lvl=info msg="Listening for signals" log_id=0hI5JKQG000
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: [httpd] 127.0.0.1 - - [19/Apr/2023:09:08:00 +0200] "GET /health HTTP/1.1" 200 107 "-" "curl/7.74.0" eb432e00-de80-11ed-8001-e45f0187f418 968
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4614]: InfluxDB started
Apr 19 09:08:00 openhabian systemd[1]: Started InfluxDB is an open-source, distributed, time series database.
Apr 19 09:08:00 openhabian influxd-systemd-start.sh[4615]: ts=2023-04-19T07:08:00.667053Z lvl=info msg="Sending usage statistics to usage.influxdata.com" log_id=0hI5JKQG000

these are the most recent entries from the Journalctl.

i am not seeing an obvious error here

using Influxd i get:

2023-04-19T13:01:30.534430Z     info    InfluxDB starting       {"log_id": "0hIPXv9W000", "version": "1.8.10", "branch": "1.8", "commit": "688e697c51fd"}
2023-04-19T13:01:30.534617Z     info    Go runtime      {"log_id": "0hIPXv9W000", "version": "go1.13.8", "maxprocs": 4}
run: open server: listen: listen tcp 127.0.0.1:8088: bind: address already in use

both in influxdb.cfg & influxdb.conf the url is 127.0.0.1:8086 could this be part of the problem?

No. influx uses two ports.

netstat -tulpn |grep influxd
tcp        0      0 127.0.0.1:8086          0.0.0.0:*               LISTEN      933/influxd         
tcp        0      0 127.0.0.1:8088          0.0.0.0:*               LISTEN      933/influxd

this just says that you tried to start the influxd service while it (?) is already running or at least there is already something listening on that part.

Use influx, the command line client ( I think you already did ) to check and connect to the influxdb.
If that does not show any error I would set the binding to debug or trace mode. Then you should be able to see the reason why nothing is stored in the database.

i can use th influx ctl and connect to influxdb, i have to authanticate every time but afaik this is normal, otherwise there is no error in influx ctl.

sorry not sure what you mean with the mode of the binding.
Which binding? and how do i set it to a different mode?
thanks

  • login to your OH system via ssh or putty
  • from there login to the karaf console ( openhab-cli console )
  • change the logging for org.openhab.persistence.influxdb:
    log:set DEBUG org.openhab.persistence.influxdb
    ( this needs to be reset later using: log:set DEFAULT org.openhab.persistence.influxdb )
  • now check the logs either log:tail in the karaf console
    or using the linux shell ( tail -f /var/log/openhab/openhab.log )
  • if that log level is not enough it can be increased by using TRACE instead of DEBUG