Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. [gelöst] Backitup kann influxdb Datenbank nicht sichern.

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Backitup kann influxdb Datenbank nicht sichern.

    This topic has been deleted. Only users with topic management privileges can see it.
    • simatec
      simatec Developer Most Active @Christian Kohlöffel last edited by

      @christian-kohlöffel
      Was hat der Ordner /opt/iobroker/backups für Rechte?

      1 Reply Last reply Reply Quote 0
      • Christian Kohlöffel
        Christian Kohlöffel @Christian Kohlöffel last edited by

        @christian-kohlöffel

        der Befehl

        ls -l
        

        gibt folgende INFO zum Ordner:

        pi@raspberrypi:/opt/iobroker/backups $ ls -l /opt/iobroker/
        total 288
        drwxrwxr-x+    4 iobroker iobroker   4096 Apr  6 20:44 backups
        
        simatec 1 Reply Last reply Reply Quote 0
        • simatec
          simatec Developer Most Active @Christian Kohlöffel last edited by

          @christian-kohlöffel
          Führe mal folgendes aus und versuche es im Anschluss nochmal mit dem Backup.

          sudo chmod 755 /opt/iobroker/backups
          sudo chmod 755 /opt/iobroker/backups/
          sudo chmod 755 /opt/iobroker/backups/*
          
          Christian Kohlöffel 1 Reply Last reply Reply Quote 0
          • Christian Kohlöffel
            Christian Kohlöffel @simatec last edited by

            @simatec

            Leider keine Veränderung:

            [ERROR] [influxDB] - [IGNORED] Error: Command failed: "/usr/bin/influxd" backup -portable -database iobroker "/opt/iobroker/backups/influxDB_2021_04_06-21_39_12_backupiobroker"
            backup: copy: read /opt/iobroker/backups/influxDB_2021_04_06-21_39_12_backupiobroker/meta.00: input/output error
            

            Hier auch noch wieder mit Standard Pfad zur Datei influxd

            [ERROR] [influxDB] - [IGNORED] Error: Command failed: influxd backup -portable -database iobroker "/opt/iobroker/backups/influxDB_2021_04_06-21_40_49_backupiobroker"
            backup: copy: read /opt/iobroker/backups/influxDB_2021_04_06-21_40_49_backupiobroker/meta.00: input/output error
            
            
            simatec Christian Kohlöffel 3 Replies Last reply Reply Quote 0
            • simatec
              simatec Developer Most Active @Christian Kohlöffel last edited by

              @christian-kohlöffel
              Es scheint, als ob der User iobroker keine Rechte für Influx besitzt.
              Wie hast du influx installiert?

              1 Reply Last reply Reply Quote 0
              • Christian Kohlöffel
                Christian Kohlöffel @Christian Kohlöffel last edited by Christian Kohlöffel

                @christian-kohlöffel

                Ich bin mir nicht mehr zu 100% sicher, aber ich glaube nach folgender Anleitung:

                https://www.verdrahtet.info/2020/02/14/installation-von-influxdb-grafana-inkl-verbindung-zu-iobroker/

                Was heißt es gibt den User iobroker nicht, sondern den User "user". Das ist auch der Login beim Adapter inlfluxdb.

                Hier die User laut influx:

                pi@raspberrypi:/opt/iobroker/backups $ influx
                Connected to http://localhost:8086 version 1.8.4
                InfluxDB shell version: 1.8.4
                > auth
                username: admin
                password:
                > SHOW USERS
                user  admin
                ----  -----
                admin true
                user  false
                >
                

                Aber vielleicht meintest du gar nicht die influx user ...

                1 Reply Last reply Reply Quote 0
                • Christian Kohlöffel
                  Christian Kohlöffel @Christian Kohlöffel last edited by

                  @simatec

                  Hier die Rechte für die Dateien:

                  pi@raspberrypi:/usr/bin $ ls infl* -l
                  -rwxr-xr-x 1 root root 47338750 Jan 28 12:10 influx
                  -rwxr-xr-x 1 root root 58179503 Jan 28 12:10 influxd
                  -rwxr-xr-x 1 root root 17902141 Jan 28 12:10 influx_inspect
                  -rwxr-xr-x 1 root root 10911515 Jan 28 12:10 influx_stress
                  -rwxr-xr-x 1 root root 19100763 Jan 28 12:10 influx_tsm
                  pi@raspberrypi:/usr/bin $
                  
                  

                  Scheint aber auch alles zu passen, oder?

                  simatec 1 Reply Last reply Reply Quote 0
                  • simatec
                    simatec Developer Most Active @Christian Kohlöffel last edited by

                    @christian-kohlöffel Dann sieht es so aus, als ob dein User "iobroker" (dieser wird bei der Installation von iobroker angelegt) keinen Rechte auf Influx hat.

                    Zeige mir mal die Ausgabe von:

                    less /etc/group
                    
                    Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                    • Christian Kohlöffel
                      Christian Kohlöffel @simatec last edited by

                      @simatec said in Backitup kann influxdb Datenbank nicht sichern.:

                      less /etc/group

                      Und hier der output:

                      pi@raspberrypi:~ $ less /etc/group
                      root:x:0:
                      daemon:x:1:
                      bin:x:2:
                      sys:x:3:
                      adm:x:4:pi
                      tty:x:5:iobroker
                      disk:x:6:
                      lp:x:7:
                      mail:x:8:
                      news:x:9:
                      uucp:x:10:
                      man:x:12:
                      proxy:x:13:
                      kmem:x:15:
                      dialout:x:20:pi,iobroker
                      fax:x:21:
                      voice:x:22:
                      cdrom:x:24:pi
                      floppy:x:25:
                      tape:x:26:
                      sudo:x:27:pi
                      audio:x:29:pi,iobroker
                      dip:x:30:
                      www-data:x:33:
                      backup:x:34:
                      operator:x:37:
                      list:x:38:
                      irc:x:39:
                      src:x:40:
                      gnats:x:41:
                      shadow:x:42:
                      utmp:x:43:
                      video:x:44:pi,iobroker
                      sasl:x:45:
                      plugdev:x:46:pi
                      staff:x:50:
                      games:x:60:pi
                      users:x:100:pi
                      nogroup:x:65534:
                      systemd-journal:x:101:
                      systemd-timesync:x:102:
                      systemd-network:x:103:
                      systemd-resolve:x:104:
                      input:x:105:pi
                      kvm:x:106:
                      render:x:107:
                      crontab:x:108:
                      netdev:x:109:pi
                      pi:x:1000:
                      messagebus:x:110:
                      ssh:x:111:
                      bluetooth:x:112:iobroker
                      avahi:x:113:
                      spi:x:999:pi
                      i2c:x:998:pi,iobroker
                      gpio:x:997:pi,iobroker
                      systemd-coredump:x:996:
                      iobroker:x:1001:pi
                      influxdb:x:995:
                      grafana:x:115:
                      redis:x:114:iobroker
                      mosquitto:x:116:
                      
                      
                      simatec 1 Reply Last reply Reply Quote 0
                      • simatec
                        simatec Developer Most Active @Christian Kohlöffel last edited by

                        @christian-kohlöffel sagte in Backitup kann influxdb Datenbank nicht sichern.:

                        influxdb❌995:

                        Sieht eigentlich gut aus. Bei mir lautet die Zeile zwar „influxdb❌998:“ aber das sollte nix ausmachen. Eventuell kannst du mal Testweise versuchen, den User iobroker in die influxdb Gruppe zu adden
                        Danach aber den Reboot nicht vergessen

                        Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                        • Christian Kohlöffel
                          Christian Kohlöffel @simatec last edited by

                          @simatec

                          habe ich gemacht mit foldendem Befehl:

                          pi@raspberrypi:~ $ sudo usermod -a -G influxdb iobroker
                          
                          less /etc/group
                          

                          zeigt nun folgendes an:

                          influxdb:x:995:iobroker
                          

                          Keine Veränderung:

                          5430) [iobroker/influxDB] [IGNORED] Error: Command failed: influxd backup -portable -database iobroker "/opt/iobroker/backups/influxDB_2021_04_07-20_22_35_backupiobroker"
                          

                          Aber ich habe gerade eine noch bisher nicht gekommen Fehlermeldung im Log entdeckt:

                          backitup.0	2021-04-07 20:22:17.392	error	(5430) [iobroker] Backup folder not created: Error: EPERM: operation not permitted, chmod '/opt/iobroker/backups'Please reinstall backitup and run "iobroker fix"!!
                          

                          Könnte das der Grund sein? Ich mach mal was da dran steht ....

                          Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                          • Christian Kohlöffel
                            Christian Kohlöffel @Christian Kohlöffel last edited by Christian Kohlöffel

                            @christian-kohlöffel

                            Nach Neuinstallation von Backitup und durchführen von

                            iobroker fix
                            

                            Keine Veränderung. Immernoch selber Fehler vorhanden.

                            2645) [iobroker] Backup folder not created: Error: EPERM: operation not permitted, chmod '/opt/iobroker/backups'Please reinstall backitup and run "iobroker fix"!!
                            

                            (Normales Backup ohne Influxdb) läuft durch.

                            InfluxDB bringt dieselbe Fehlermeldung wie bisher.

                            [ERROR] [influxDB] - [IGNORED] Error: Command failed: influxd backup -portable -database iobroker "/opt/iobroker/backups/influxDB_2021_04_07-20_58_06_backupiobroker"
                            backup: copy: read /opt/iobroker/backups/influxDB_2021_04_07-20_58_06_backupiobroker/meta.00: input/output error
                            
                            simatec 1 Reply Last reply Reply Quote 0
                            • simatec
                              simatec Developer Most Active @Christian Kohlöffel last edited by

                              @christian-kohlöffel sagte in Backitup kann influxdb Datenbank nicht sichern.:

                              EPERM

                              Den Fehler kannst du ignorieren.
                              Kann es sein, dass du eventuell dein Influx als root installiert hast? Ich wüsste nicht, warum der User iobroker keine Zugriff hat.

                              Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                              • Christian Kohlöffel
                                Christian Kohlöffel @simatec last edited by

                                @simatec

                                Kann ich nicht genau sagen. Aber ich hab das nach der Std. Anleitung gemacht ohne irgendwas spezielles. Alles andere wäre mir zu kompliziert gewesen 😉

                                Kann man das irgendwie nachschauen / sehen?

                                simatec 2 Replies Last reply Reply Quote 0
                                • simatec
                                  simatec Developer Most Active @Christian Kohlöffel last edited by

                                  @christian-kohlöffel
                                  Hier ist die offizielle Anleitung.
                                  https://docs.influxdata.com/influxdb/v1.8/introduction/install/#installing-influxdb-oss

                                  1 Reply Last reply Reply Quote 0
                                  • simatec
                                    simatec Developer Most Active @Christian Kohlöffel last edited by

                                    @christian-kohlöffel
                                    Ich habe mir die Anleitung, welche du genutzt hast nun noch einmal angeschaut und folgendes festgestellt.
                                    Laut Anleitung hast du folgendes in der Config geändert:

                                    [http]  
                                     enabled = true  
                                     bind-address = ":8086"  
                                     auth-enabled = true
                                     log-enabled = true  
                                     write-tracing = false  
                                     pprof-enabled = false  
                                     https-enabled = false  
                                     https-certificate = "/etc/ssl/influxdb.pem" 
                                    

                                    Da denke ich ist ein wenig zu viel aktiviert.
                                    Bitte gehe in der Config sudo nano /etc/influxdb/influxdb.conf und ändere diese wie folgt:

                                    [http]
                                    enabled = true  
                                    bind-address = ":8086"  
                                    #auth-enabled = true
                                    #log-enabled = true  
                                    #write-tracing = false  
                                    #pprof-enabled = false  
                                    #https-enabled = false  
                                    #https-certificate = "/etc/ssl/influxdb.pem"
                                    

                                    Im Anschluss die Config speichern und Influxdb neustarten

                                    sudo service influxdb restart
                                    
                                    Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                                    • Christian Kohlöffel
                                      Christian Kohlöffel @simatec last edited by

                                      @simatec

                                      Ich ware gerade am genau gleichen dran, aber Du warst schneller:

                                      Ich habe die infuxdb.conf so geändert wie von Dir geschrieben, leider aber kein Effekt.

                                      [ERROR] [influxDB] - [IGNORED] Error: Command failed: influxd backup -portable -database iobroker "/opt/iobroker/backups/influxDB_2021_04_08-13_14_11_backupiobroker"
                                      backup: copy: read /opt/iobroker/backups/influxDB_2021_04_08-13_14_11_backupiobroker/meta.00: input/output error
                                      
                                      

                                      Folgendes ist mir noch inder Anleitung aufgefallen, was auch nicht durchgeführt wird. :
                                      https://docs.influxdata.com/influxdb/v1.8/introduction/install/#influxdb-oss-permissions

                                      War mir jetzt aber nicht sicher ob das optional ist, oder nötig. Auf jeden Fall konnte ich diese auch nicht ausführen.

                                      simatec 1 Reply Last reply Reply Quote 0
                                      • simatec
                                        simatec Developer Most Active @Christian Kohlöffel last edited by

                                        @christian-kohlöffel Wenn du eine Standard-Installation hast, sehe ich das nicht als notwendig.
                                        Grundsätzlich ist da bei der Installation von InfluxDB etwas krum.

                                        Ich würde dir folgendes raten.

                                        Führe manuell ein Backup deiner Datenbank aus:

                                        mkdir /home/pi/influxdb_backup
                                        influxd backup -portable -database iobroker /home/pi/influxdb_backup
                                        

                                        stoppe im Anschluss den Influxdb-Adapter.

                                        Danach deinstalliere Influxdb

                                        sudo apt-get remove influxdb
                                        sudo apt-get autoremove
                                        sudo reboot now
                                        

                                        Nach dem Neustart influxdb wie folgt installieren:

                                        wget -qO- https://repos.influxdata.com/influxdb.key | gpg --dearmor > /etc/apt/trusted.gpg.d/influxdb.gpg
                                        export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc)
                                        echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" > /etc/apt/sources.list.d/influxdb.list
                                        sudo apt-get update && sudo apt-get install influxdb
                                        sudo systemctl unmask influxdb.service
                                        sudo systemctl start influxdb
                                        

                                        Im Anschluss die influxdb.conf anpassen

                                        sudo nano /etc/influxdb/influxdb.conf
                                        

                                        Im Bereich "http" folgendes aktivieren:

                                        [http]  
                                         enabled = true
                                        

                                        Die Datei speichern und influxdb neustarten.

                                        sudo systemctl restart influxdb
                                        

                                        Nun kannst du den Restore durchführen. Wichtig hierbei ist, den Influxdb-Adapter noch nicht gestartet zu haben, da dieser versucht die Datenbank "iobroker" anzulegen.

                                        influxd restore -portable /home/pi/influxdb_backup
                                        

                                        Ist der restore fertig, kannst du noch deinen User für den Adapter wieder einrichten

                                        sudo influx
                                        
                                        CREATE USER "admin" WITH PASSWORD 'deinAdminPasswort' WITH ALL PRIVILEGES
                                        CREATE USER "DeinUser" WITH PASSWORD 'deinUserpasswort'
                                        GRANT ALL ON "iobroker" TO "user"
                                        exit
                                        

                                        Nun noch ein Neustart der DB und im Anschluss den Adapter starten.

                                        sudo systemctl restart influxdb
                                        
                                        Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                                        • Christian Kohlöffel
                                          Christian Kohlöffel @simatec last edited by

                                          @simatec
                                          Guten Morgen,

                                          vielen Dank erst mal für die gute Anleitung. Ich hab mir das für heute Morgen aufgehoben. Beim durchführen erhalte ich bei folgendem Punkt einen Fehler:

                                          pi@raspberrypi:~ $ wget -qO- https://repos.influxdata.com/influxdb.key | gpg --dearmor > /etc/apt/trusted.gpg.d/influxdb.gpg
                                          -bash: /etc/apt/trusted.gpg.d/influxdb.gpg: Permission denied
                                          

                                          (Ich will da jetzt mal nichsts mit sudo o.ö. probieren. Nicht das es am Schluss daran liegt)

                                          Gruß
                                          Christian

                                          Thomas Braun 1 Reply Last reply Reply Quote 0
                                          • Thomas Braun
                                            Thomas Braun Most Active @Christian Kohlöffel last edited by

                                            @christian-kohlöffel sagte in Backitup kann influxdb Datenbank nicht sichern.:

                                            wget -qO- https://repos.influxdata.com/influxdb.key | sudo gpg --dearmor > /etc/apt/trusted.gpg.d/influxdb.gpg
                                            

                                            pi darf nicht in /etc/apt/ und Unterverzeichnissen herumschreiben.

                                            Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            884
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            5
                                            107
                                            7513
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo