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.
    • 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
                                • Christian Kohlöffel
                                  Christian Kohlöffel @Thomas Braun last edited by Christian Kohlöffel

                                  @thomas-braun

                                  Alles klar, dann mit sudo ...

                                  Jetzt wirds wieder komisch, immernoch Permission denied

                                  pi@raspberrypi:~ $ wget -qO- https://repos.influxdata.com/influxdb.key | sudo gpg --dearmor > /etc/apt/trusted.gpg.d/influxdb.gpg
                                  -bash: /etc/apt/trusted.gpg.d/influxdb.gpg: Permission denied
                                  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 ab hier aus. Die anderen befehle sollten bereits durch deine erste Installation erledigt sein.

                                    sudo apt-get update && sudo apt-get install influxdb
                                    sudo systemctl unmask influxdb.service
                                    sudo systemctl start influxdb
                                    
                                    Christian Kohlöffel 1 Reply Last reply Reply Quote 0
                                    • Christian Kohlöffel
                                      Christian Kohlöffel @simatec last edited by

                                      @simatec

                                      In der Datei /etc/influxdb/influxdb.conf waren folgende Punkte schon aktiviert. Das habe ich so gelassen.

                                      [http]
                                        # Determines whether HTTP endpoint is enabled.
                                        enabled = true
                                      
                                        # The bind address used by the HTTP service.
                                        bind-address = ":8086"
                                      
                                      

                                      Beim Restore zeigt er nun folgendes an:

                                      pi@raspberrypi:~ $ influxd restore -portable /home/pi/influxdb_backup
                                      2021/04/09 12:56:21 error updating meta: DB metadata not changed. database may already exist
                                      restore: DB metadata not changed. database may already exist
                                      

                                      Scheint als ob die alte Datenbank nicht gelöscht wurde. Einfach dann weitermachen, oder doch nicht?

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

                                        @christian-kohlöffel @simatec
                                        Der Befehl zum kompletten löschen hätte doch lauten sollen

                                        
                                        sudo apt-get purge --auto-remove influxdb
                                        

                                        Ohne purge bleibt die config erhalten

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

                                          @crunchip

                                          Dann habe ich ab hier nochmals gestartet, dabei kam folgende Warnung:

                                          pi@raspberrypi:~ $ sudo apt-get purge --auto-remove influxdb
                                          Reading package lists... Done
                                          Building dependency tree
                                          Reading state information... Done
                                          The following packages will be REMOVED:
                                            influxdb*
                                          0 upgraded, 0 newly installed, 1 to remove and 9 not upgraded.
                                          After this operation, 153 MB disk space will be freed.
                                          Do you want to continue? [Y/n] y
                                          (Reading database ... 55570 files and directories currently installed.)
                                          Removing influxdb (1.8.4-1) ...
                                          Processing triggers for man-db (2.8.5-2) ...
                                          (Reading database ... 55548 files and directories currently installed.)
                                          Purging configuration files for influxdb (1.8.4-1) ...
                                          dpkg: warning: while removing influxdb, directory '/var/lib/influxdb' not empty                                                                                                                                                              so not removed
                                          

                                          Und tatsächlich die config hatte diesmal keine bereits vorhandenen Einträge.

                                          Aber die Datenbank kann trotzdem nich wiederhergestellt werden, da bereits vorhanden wie es scheint, ist das OK? ....

                                          pi@raspberrypi:~ $ influxd restore -portable /home/pi/influxdb_backup
                                          2021/04/09 14:10:24 error updating meta: DB metadata not changed. database may already exist
                                          restore: DB metadata not changed. database may already exist
                                          
                                          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.:

                                            Beim Restore zeigt er nun folgendes an:
                                            pi@raspberrypi:~ $ influxd restore -portable /home/pi/influxdb_backup 2021/04/09 12:56:21 error updating meta: DB metadata not changed. database may already exist restore: DB metadata not changed. database may already exist
                                            Scheint als ob die alte Datenbank nicht gelöscht wurde. Einfach dann weitermachen, oder doch nicht?

                                            Da ist die Datenbank noch vorhanden. Wenn das nun nach der zweiten Neuinstallation auch noch kommt, dann folgendes ausführen

                                            sudo influx
                                            
                                            DROP DATABASE iobroker
                                            exit
                                            

                                            Im Anschluss dann den restore ausführen

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            837
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            5
                                            107
                                            7515
                                            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