Ad Widget

Collapse

Zabbix repository upgrade from 3.0 to 3.2 with mysql partitioning

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xanadu
    Member
    • Sep 2014
    • 62

    #1

    Zabbix repository upgrade from 3.0 to 3.2 with mysql partitioning

    I've tried to upgrade my Zabbix-server via the repository upgrade of my Zabbix v3.0.5 to v3.2.1.
    However as my current v3.0 install is partitioned it gives an error while trying to upgrade the database:

    [root@bosszbx1 ~]# tail /var/log/zabbix/zabbix_server.log
    15068:20161019:122428.718 SSH2 support: YES
    15068:20161019:122428.718 IPv6 support: YES
    15068:20161019:122428.718 TLS support: YES
    15068:20161019:122428.718 ******************************
    15068:20161019:122428.718 using configuration file: /etc/zabbix/zabbix_server.conf
    15068:20161019:122428.724 current database version (mandatory/optional): 03000000/03000000
    15068:20161019:122428.724 required mandatory version: 03020000
    15068:20161019:122428.725 starting automatic database upgrade
    15068:20161019:122428.725 [Z3005] query failed: [1091] Can't DROP 'history_log_2'; check that column/key exists [drop index history_log_2 on history_log]
    15068:20161019:122428.725 database upgrade failed

    Does anyone know how I can fix this?

    Cheers!
  • burn1024
    Member
    • Jun 2012
    • 52

    #2
    Create this index?
    Generally it's simplier to not use partitioning

    Comment

    • xanadu
      Member
      • Sep 2014
      • 62

      #3
      Originally posted by burn1024
      Create this index?
      Generally it's simplier to not use partitioning
      Thanks! Could you help how to do that?
      I'm not familiar with DB actions on mariadb..

      Comment

      • acropia
        Junior Member
        • Mar 2015
        • 26

        #4
        Hi xanadu,

        Today I had the same issue. I solved the problem by adding the index to the given tabel, and after that the update process completed succesfully.

        I logged into MariaDB server with the username and password from the file
        Code:
        /etc/zabbix/zabbix_server.conf
        Logging into MariaDB server:
        Code:
        mysql -u zabbix -p
        Altering the given tabel:
        Code:
        USE zabbix;
        DESCRIBE history_log
         ALTER TABLE `history_log` ADD INDEX `history_log_2` (`id`);
        After that the update slowly finished. You can check the progress with:
        Code:
        tail -f /var/log/zabbix/zabbix_server.log

        Comment

        • xanadu
          Member
          • Sep 2014
          • 62

          #5
          Originally posted by acropia
          Hi xanadu,

          Today I had the same issue. I solved the problem by adding the index to the given tabel, and after that the update process completed succesfully.

          I logged into MariaDB server with the username and password from the file
          Code:
          /etc/zabbix/zabbix_server.conf
          Logging into MariaDB server:
          Code:
          mysql -u zabbix -p
          Altering the given tabel:
          Code:
          USE zabbix;
          DESCRIBE history_log
           ALTER TABLE `history_log` ADD INDEX `history_log_2` (`id`);
          After that the update slowly finished. You can check the progress with:
          Code:
          tail -f /var/log/zabbix/zabbix_server.log
          Thanks for your post. Today I had time to take a backup and try your solution. However I'm using MariaDB and the command fails:

          MariaDB [(none)]> USE zabbix;
          Reading table information for completion of table and column names
          You can turn off this feature to get a quicker startup with -A

          Database changed
          MariaDB [zabbix]> DESCRIBE history_log
          -> ALTER TABLE `history_log` ADD INDEX `history_log_2` (`id`);
          ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ALTER TABLE `history_log` ADD INDEX `history_log_2` (`id`)' at line 2

          Thanks!
          Last edited by xanadu; 20-12-2016, 17:45.

          Comment

          • xanadu
            Member
            • Sep 2014
            • 62

            #6
            ok, I figured it out. After DESCRIBE history_log it needed an ";"

            I also needed to run: ALTER TABLE `history_text` ADD INDEX `history_text_2` (`id`);

            Thanks acropia for pointing me in the right direction
            Last edited by xanadu; 20-12-2016, 17:46.

            Comment

            Working...