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

                              @simatec

                              Der Restore läuft nun durch.

                              Für

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

                              war noch zuvor folgendes nötig:

                              use iobroker
                              

                              Dann ist mir glaub noch ein Typo aufgefallen:
                              (Sollte wohl heißen: GRANT ALL ON "iobroker" TO "DeinUser"; oder?)

                              Influxdb Adapter startet und Daten sind vorhanden

                              Aber nun das interessante, der Fehler ist immernoch da ...:

                              [DEBUG] [influxDB] - InfluxDB tmp directory was successfully deleted
                              [ERROR] [influxDB] - [IGNORED] Error: Command failed: influxd backup -portable -database iobroker "/opt/iobroker/backups/influxDB_2021_04_09-14_51_44_backupiobroker"
                              backup: copy: read /opt/iobroker/backups/influxDB_2021_04_09-14_51_44_backupiobroker/meta.00: input/output error
                              
                              1 Reply Last reply Reply Quote 0
                              • Christian Kohlöffel
                                Christian Kohlöffel @simatec last edited by

                                @simatec

                                Jetzt noch ein Gedanke. Ich habe beim inlfuxdb Adapter den User "DeinUser" drin. Ich habe es auch schon gesehen dass manche dort "Admin" stehen haben. Daran kanns nicht liegen, oder?

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

                                  @christian-kohlöffel
                                  Sicherst du lokal oder wieder auf dem NAS?

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

                                    @simatec
                                    Ich sichere aktuell weiterhin auf dem NAS (Fritzbox).

                                    Ich stelle mal um und berichte ...

                                    Hier das. Log:

                                    Scheint alles zu klappen ...

                                    Started iobroker ...
                                    [DEBUG] [iobroker] - host.raspberrypi 2156 states saved
                                    
                                    [DEBUG] [iobroker] - host.raspberrypi 2575 objects saved
                                    
                                    [DEBUG] [iobroker] - Backup created: /opt/iobroker/backups/iobroker_2021_04_10-11_26_47_backupiobroker.tar.gz
                                    
                                    [DEBUG] [iobroker] - done
                                    [DEBUG] [influxDB] - Start InfluxDB Backup ...
                                    [DEBUG] [influxDB] - InfluxDB Backup tmp directory created 
                                    [DEBUG] [influxDB] - Packed 36MB so far...
                                    [DEBUG] [influxDB] - Packed 42MB so far...
                                    [DEBUG] [influxDB] - Packed 57MB so far...
                                    [DEBUG] [influxDB] - Packed 81MB so far...
                                    [DEBUG] [influxDB] - Packed 85MB so far...
                                    [DEBUG] [influxDB] - Packed 111MB so far...
                                    [DEBUG] [influxDB] - Packed 152MB so far...
                                    [DEBUG] [influxDB] - Packed 165MB so far...
                                    [DEBUG] [influxDB] - Packed 186MB so far...
                                    [DEBUG] [influxDB] - Packed 211MB so far...
                                    [DEBUG] [influxDB] - Backup created: /opt/iobroker/backups/influxDB_2021_04_10-11_26_55_backupiobroker.tar.gz
                                    [DEBUG] [influxDB] - Try deleting the InfluxDB tmp directory
                                    [DEBUG] [influxDB] - InfluxDB tmp directory was successfully deleted
                                    [DEBUG] [influxDB] - done
                                    [DEBUG] [clean] - done
                                    [DEBUG] [historyHTML] - new history html values created
                                    [DEBUG] [historyHTML] - done
                                    [DEBUG] [historyJSON] - new history json values created
                                    [DEBUG] [historyJSON] - done
                                    [EXIT] 0
                                    

                                    Hier mal noch die Einstellungen zum NAS:

                                    2021-04-10 11_39_25-instances - ioBroker.png

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

                                      @christian-kohlöffel
                                      Auf aktuellen FritzBoxen (Firmware 7.2x) würde ich smb 3.1.1 einstellen. Läuft hier super.

                                      simatec 1 Reply Last reply Reply Quote 0
                                      • simatec
                                        simatec Developer Most Active @Thomas Braun last edited by

                                        @Christian-Kohlöffel Wir hatten hier im Forum gerade ein ähnliches Problem mit der FB.
                                        Zeige mal bitte deine NAS Einstellungen der FB und in welchem Dateiformat ist der Speichermedium an der FB formatiert?

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

                                          @simatec

                                          Ich habe die Version 07.20, also aktuellste Version für die 6490 cable installiert. Anbei die Einstellungen. Ich versuche auch mal das smb 3.1.1, vielleicht ändert sich was.

                                          2021-04-10 13_36_37-FRITZ!Box 6490 Cable.png

                                          2021-04-10 13_36_58-FRITZ!Box 6490 Cable.png

                                          2021-04-10 13_37_11-FRITZ!Box 6490 Cable.png

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

                                            @christian-kohlöffel
                                            OK da liegt dann wohl das Problem. Stelle in Backitup auf smb v1
                                            Des Weiteren würde ich den USB Speicher auf ext4 formatieren.
                                            Hier im Forum gab es ein vergleichbares Problem und das war die Lösung

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            689
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

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