Ad Widget

Collapse

zabbix db mysql schema upgrade 1.8 to 2.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rliu
    Junior Member
    • Mar 2017
    • 1

    #1

    zabbix db mysql schema upgrade 1.8 to 2.0

    Hi there,

    I am doing the zabbix db mysql schema upgrade 1.8 to 2.0. Using the download package from zabbix and use the following command to upgrade zabbix database schema from 1.8 to 2.0:
    mysql -uroot -ppassword zabbix3 --verbose < /tmp/zabbix-2.0.20/upgrades/dbpatches/2.0/mysql/patch.sql

    It failed on below error:
    ERROR 1034 (HY000) at line 1862: Incorrect key file for table 'events'; try to repair it

    environemnt:
    Centos 7.3.1611
    Mariadb 10.1.21

    I did try below, but it still failed.
    [root@ tmp]# mysqlcheck -u root -p --auto-repair zabbix events
    Enter password:

    zabbix.events OK
    MariaDB [zabbix]> analyze table events;
    +---------------+---------+----------+----------+
    | Table | Op | Msg_type | Msg_text |
    +---------------+---------+----------+----------+
    | zabbix.events | analyze | status | OK |
    +---------------+---------+----------+----------+
    1 row in set (0.86 sec)

    MariaDB [zabbix]> check table events;
    +---------------+-------+----------+----------+
    | Table | Op | Msg_type | Msg_text |
    +---------------+-------+----------+----------+
    | zabbix.events | check | status | OK |
    +---------------+-------+----------+----------+
    1 row in set (10 min 52.83 sec)

    MariaDB [zabbix]> optimize table events;
    +----------------+----------+----------+-------------------------------------------------------------------+
    | Table | Op | Msg_type | Msg_text |
    +----------------+----------+----------+-------------------------------------------------------------------+
    | zabbix.events | optimize | note | Table does not support optimize, doing recreate + analyze instead |
    | zabbix.events | optimize | error | Got error 64 'Temp file write failure' from InnoDB |
    | zabbix.events | optimize | status | Operation failed |
    +----------------+----------+----------+-------------------------------------------------------------------+
    3 rows in set, 1 warning (56.14 sec)


    Change the tmp folder to /opt/mysql/tmp
    increate size from 256M to 1G


    [root@ zabbix]# mysql_upgrade -uroot -ppassword zabbix
    Phase 1/6: Checking and upgrading mysql database
    Processing databases
    mysql
    mysql.column_stats OK
Working...