Seite 1 von 4

Influx DB geht nicht

Verfasst: 27. Dez 2022 14:31
von AndyRPi
Hallo Zusammen,
ich habe folgenden Aufbau
RPI4 mit SSD nun wollte ich Influx und Grafana einrichten.
Ich habe beides installiert.
Nun kommt wenn ich mich einlogen will in die Datenbank folgender fehler
Failed to connect to http://localhost:8086: Get http://localhost:8086/ping: dial tcp [::1]:8086: connect: connection refused
Please check your connection settings and ensure 'influxd' is running.

Ich habe Version 1.8.10-1 installiert mit openhabian oberflöche

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 16:41
von Lux73
läuft InfluxDB überhaupt? d.h. der Dienst?

hast du in der InfluxDB einen User und die entsprechende Datenbank angelegt?

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:11
von AndyRPi
Lux73 hat geschrieben: 27. Dez 2022 16:41 läuft InfluxDB überhaupt? d.h. der Dienst?

hast du in der InfluxDB einen User und die entsprechende Datenbank angelegt?
Ich hab den Dienst gestartet. Wie kann ich prüfen ob der läuft.

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:15
von Lux73

Code: Alles auswählen

service influxd status

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:20
von AndyRPi
Lux73 hat geschrieben: 27. Dez 2022 17:15

Code: Alles auswählen

service influxd status
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: activating (start) since Tue 2022-12-27 17:16:42 CET; 1min 0s ago
Docs: https://docs.influxdata.com/influxdb/
Cntrl PID: 116769 (influxd-systemd)
Tasks: 2 (limit: 4531)
CPU: 2.191s
CGroup: /system.slice/influxdb.service
├─116769 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
└─117246 sleep 1

Dec 27 17:17:33 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 50 attempts...
Dec 27 17:17:34 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 51 attempts...
Dec 27 17:17:35 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 52 attempts...
Dec 27 17:17:36 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 53 attempts...
Dec 27 17:17:37 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 54 attempts...
Dec 27 17:17:38 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 55 attempts...
Dec 27 17:17:39 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 56 attempts...
Dec 27 17:17:40 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 57 attempts...
Dec 27 17:17:41 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 58 attempts...
Dec 27 17:17:42 openhabian influxd-systemd-start.sh[116769]: InfluxDB API unavailable after 59 attempts...

das erhalte ich zurück
und bei der eingabe von influxd erhalte ich folgenedes:
openhabian@openhabian:~ $ influxd

8888888 .d888 888 8888888b. 888888b.
888 d88P" 888 888 "Y88b 888 "88b
888 888 888 888 888 888 .88P
888 88888b. 888888 888 888 888 888 888 888 888 8888888K.
888 888 "88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b
888 888 888 888 888 888 888 X88K 888 888 888 888
888 888 888 888 888 Y88b 888 .d8""8b. 888 .d88P 888 d88P
8888888 888 888 888 888 "Y88888 888 888 8888888P" 8888888P"

2022-12-27T16:18:05.938426Z info InfluxDB starting {"log_id": "0f15sPxG000", "version": "1.8.10", "branch": "1.8", "commit": "688e697c51fd"}
2022-12-27T16:18:05.938589Z info Go runtime {"log_id": "0f15sPxG000", "version": "go1.13.8", "maxprocs": 4}
2022-12-27T16:18:06.040089Z info Using data dir {"log_id": "0f15sPxG000", "service": "store", "path": "/var/lib/influxdb/data"}
2022-12-27T16:18:06.040299Z info Compaction settings {"log_id": "0f15sPxG000", "service": "store", "max_concurrent_compactions": 2, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
2022-12-27T16:18:06.040491Z info Open store (start) {"log_id": "0f15sPxG000", "service": "store", "trace_id": "0f15sQM0000", "op_name": "tsdb_open", "op_event": "start"}
2022-12-27T16:18:06.040816Z info Open store (end) {"log_id": "0f15sPxG000", "service": "store", "trace_id": "0f15sQM0000", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "0.329ms"}
run: open server: open tsdb store: mkdir /var/lib/influxdb/data/openhab/_series: permission denied

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:32
von Lux73
okay, der Dienst läuft - durch dein manuelles aufrufen von

Code: Alles auswählen

influxd
könnte es sein das du den Dienst doppelt gestartet hast ^^

daher bitte einmal

Code: Alles auswählen

service influxd restart
beendet InfluxDB und startet den Dienst dann wieder neu

jetzt zu deinem Eingangspost, wohin willst du dich dann per http:// verbinden? InfluxDB ist einen Datenbankanwendung - AFAIK wird da auch keinerlei Webinterface gestartet. Wofür auch? Ist halt eine Datenbank...

was passiert wenn du dann einfach in OpenHAB deine Items mit der passenden influxdb.persist persistierst?

Ich bin nicht sicher ob OpenHabian schon einen passenden User und Datenbank anlegt beim installieren von InfluDB

ansonsten:

Code: Alles auswählen

CREATE DATABASE openhab_db
CREATE USER admin WITH PASSWORD _DEIN_PASSWORD_' WITH ALL PRIVILEGES
CREATE USER openhab WITH PASSWORD '_DEIN_PASSWORD_'
GRANT ALL ON openhab_db TO openhab
exit
innerhalb der influxd anwendung

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:39
von AndyRPi
Ich habe es versucht mit restart:
openhabian@openhabian:~ $ service influxd restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'influxdb.service'.
Authenticating as: ,,, (openhabian)
Password:
==== AUTHENTICATION COMPLETE ===
Job for influxdb.service failed because a timeout was exceeded.
See "systemctl status influxdb.service" and "journalctl -xe" for details.

openhabian@openhabian:~ $ journalctl -xe
Dec 27 17:40:19 openhabian systemd[1]: Stopping Network Time Synchronization...
░░ Subject: A stop job for unit systemd-timesyncd.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A stop job for unit systemd-timesyncd.service has begun execution.
░░
░░ The job identifier is 13082.
Dec 27 17:40:19 openhabian systemd[1]: systemd-timesyncd.service: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit systemd-timesyncd.service has successfully entered the 'dead' state.
Dec 27 17:40:19 openhabian systemd[1]: Stopped Network Time Synchronization.
░░ Subject: A stop job for unit systemd-timesyncd.service has finished
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A stop job for unit systemd-timesyncd.service has finished.
░░
░░ The job identifier is 13082 and the job result is done.
Dec 27 17:40:19 openhabian systemd[1]: Starting Network Time Synchronization...
░░ Subject: A start job for unit systemd-timesyncd.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit systemd-timesyncd.service has begun execution.
░░
░░ The job identifier is 13082.
Dec 27 17:40:20 openhabian systemd[1]: Started Network Time Synchronization.
░░ Subject: A start job for unit systemd-timesyncd.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit systemd-timesyncd.service has finished successfully.
░░
░░ The job identifier is 13082.
Dec 27 17:40:20 openhabian systemd-timesyncd[127695]: Initial synchronization to time server 162.159.200.1:123 (0.debian.pool.ntp.org).
Dec 27 17:40:20 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 18 attempts...
Dec 27 17:40:21 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 19 attempts...
Dec 27 17:40:22 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 20 attempts...
Dec 27 17:40:23 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 21 attempts...
Dec 27 17:40:24 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 22 attempts...
Dec 27 17:40:25 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 23 attempts...
Dec 27 17:40:26 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 24 attempts...
Dec 27 17:40:27 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 25 attempts...
Dec 27 17:40:28 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 26 attempts...
Dec 27 17:40:29 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 27 attempts...
Dec 27 17:40:30 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 28 attempts...
Dec 27 17:40:31 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 29 attempts...
Dec 27 17:40:32 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 30 attempts...
Dec 27 17:40:33 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 31 attempts...
Dec 27 17:40:34 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 32 attempts...
Dec 27 17:40:35 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 33 attempts...
Dec 27 17:40:36 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 34 attempts...
Dec 27 17:40:37 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 35 attempts...
Dec 27 17:40:38 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 36 attempts...
Dec 27 17:40:39 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 37 attempts...
Dec 27 17:40:41 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 38 attempts...
Dec 27 17:40:42 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 39 attempts...
Dec 27 17:40:43 openhabian influxd-systemd-start.sh[127518]: InfluxDB API unavailable after 40 attempts...

Das steht in der einen Ausgabe

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:43
von Lux73

Code: Alles auswählen

service influxd stop
danach

Code: Alles auswählen

service influxd start
geht auch

Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:46
von AndyRPi
Lux73 hat geschrieben: 27. Dez 2022 17:43

Code: Alles auswählen

service influxd stop
danach

Code: Alles auswählen

service influxd start
geht auch
Leider geht das nicht

Code: Alles auswählen

openhabian@openhabian:~ $ service influxd stop
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'influxdb.service'.
Authenticating as: ,,, (openhabian)
Password:
==== AUTHENTICATION COMPLETE ===
openhabian@openhabian:~ $ service influxd start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'influxdb.service'.
Authenticating as: ,,, (openhabian)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to start influxd.service: Access denied
See system logs and 'systemctl status influxd.service' for details.
ich habe nach dem Stop nochmals den Status angesehen:

Code: Alles auswählen

openhabian@openhabian:~ $ service influxd status
● influxdb.service - InfluxDB is an open-source, distributed, time series database
     Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Tue 2022-12-27 17:45:04 CET; 2min 25s ago
       Docs: https://docs.influxdata.com/influxdb/
    Process: 129614 ExecStart=/usr/lib/influxdb/scripts/influxd-systemd-start.sh (code=killed, signal=TERM)
        CPU: 1.197s

Dec 27 17:44:58 openhabian influxd-systemd-start.sh[129614]: InfluxDB API unavailable after 24 attempts...
Dec 27 17:44:59 openhabian influxd-systemd-start.sh[129614]: InfluxDB API unavailable after 25 attempts...
Dec 27 17:45:00 openhabian influxd-systemd-start.sh[129614]: InfluxDB API unavailable after 26 attempts...
Dec 27 17:45:01 openhabian influxd-systemd-start.sh[129614]: InfluxDB API unavailable after 27 attempts...
Dec 27 17:45:02 openhabian influxd-systemd-start.sh[129614]: InfluxDB API unavailable after 28 attempts...
Dec 27 17:45:03 openhabian influxd-systemd-start.sh[129614]: InfluxDB API unavailable after 29 attempts...
Dec 27 17:45:04 openhabian influxd-systemd-start.sh[129614]: InfluxDB API unavailable after 30 attempts...
Dec 27 17:45:04 openhabian systemd[1]: influxdb.service: Succeeded.
Dec 27 17:45:04 openhabian systemd[1]: Stopped InfluxDB is an open-source, distributed, time series database.
Dec 27 17:45:04 openhabian systemd[1]: influxdb.service: Consumed 1.197s CPU time.


Re: Influx DB geht nicht

Verfasst: 27. Dez 2022 17:48
von Lux73

Code: Alles auswählen

sudo service influxd restart
du bist als eingeschränkter Benutzer unterwegs (ich vergesse das immer weil ich als Benutzer 'root' auf meinen Systemen unterwegs bin)

das 'sudo' davor führt die Befehle als root User durch