Ad Widget

Collapse

Database seems to be growing too quick

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #61
    You were fundamentally missing the mysqldump command vs mysql. that single transaction is just addition good to have.

    Comment

    • fsousa
      Member
      • Aug 2017
      • 99

      #62
      In my previous post I've pasted the wrong command, the right command I insert is: mysqldump --single-transaction -u root -p zabbix > db_zabbix.sql

      Comment

      • ingus.vilnis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2014
        • 908

        #63
        Then you don't need to run it again. Single transaction should have no effect whether you are having some table in the dump or not.

        Comment

        • fsousa
          Member
          • Aug 2017
          • 99

          #64
          I don't understand why my ibd files aren't dumped.

          Comment

          • ingus.vilnis
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Mar 2014
            • 908

            #65
            In case you recover to empty database I think you needed to create the DB schema first (as from the Zabbix installation steps but without data) and then import the backup.

            Comment

            • fsousa
              Member
              • Aug 2017
              • 99

              #66
              Thank you Ingus. I will try that

              Comment

              • fsousa
                Member
                • Aug 2017
                • 99

                #67
                Hi Ingus,

                I didn't any feedback because I've some troubles to put my database in my test environment.

                Here the things I've tried:
                • dump my database and then recover to empty database (DB schema created): without success, because my ibd files didn't appear
                • rsync my zabbix in /var/lib/mysql/ to my other server: without success , when I tried to select any table I get "Empty set"

                Comment

                • ingus.vilnis
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Mar 2014
                  • 908

                  #68
                  Hi,

                  I believe you should look up some tutorial how to restore complete DB from backup.

                  Comment

                  • fsousa
                    Member
                    • Aug 2017
                    • 99

                    #69
                    Hi,

                    I found the solution for my problem, I've to enable the innodb_file_per_table.

                    Enable innodb_file_per_table vi /etc/my.cnf
                    Code:
                    [mysqld]
                    innodb_file_per_table = 1
                    Apparently when I imported the dump the ibd files per table aren't created.

                    I started to import again my database dump and I've the idb files per table.

                    Thank you.

                    Comment

                    • ingus.vilnis
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Mar 2014
                      • 908

                      #70
                      What version of MySQL are you using that this setting is still off by default?

                      Comment

                      • fsousa
                        Member
                        • Aug 2017
                        • 99

                        #71
                        Hi,

                        Code:
                        mysql --version
                        mysql  Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1

                        Comment

                        • ingus.vilnis
                          Senior Member
                          Zabbix Certified Trainer
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Mar 2014
                          • 908

                          #72
                          Ok... at least you got this little issue resolved.

                          Comment

                          • fsousa
                            Member
                            • Aug 2017
                            • 99

                            #73
                            Yes

                            I began the import of my dump yesterday and then I will try the partitioning of my tables.

                            Comment

                            • fsousa
                              Member
                              • Aug 2017
                              • 99

                              #74
                              Hi,

                              After 2 days partioning my history table I got the following error:
                              Code:
                              [SOLVED] ERROR 1206 (HY000): The total number of locks exceeds the lock table size
                              I google it and it seems are related with innodb_buffer_pool_size parameter in my.cnf. But I'm not sure the value I have to put here

                              Comment

                              • ingus.vilnis
                                Senior Member
                                Zabbix Certified Trainer
                                Zabbix Certified SpecialistZabbix Certified Professional
                                • Mar 2014
                                • 908

                                #75
                                Hi,

                                This article will give you a good insight.
                                Aurimas Mikalauskas shares optimizations that will help you optimize MySQL for Zabbix.

                                Comment

                                Working...