Ad Widget

Collapse

database migration to primary keys

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harri
    Member
    • Nov 2010
    • 89

    #1

    database migration to primary keys

    Is the page about migrating to primary keys in mariadb (https://www.zabbix.com/documentation...b_primary_keys) still up-to-date? I mean, if this migration is supposed to be an important point, I would have expected some automatic procedure. The history_pk_prepare.sql script cannot even be found in Zabbix' git repository.

    Every insightful comment is highly appreciated
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    I found the script, but don't recall where, is it shipped with the product?

    We had over 10 billion rows in history_unit, we keep 30 days using partitioning. I contacted Zabbix support, we couldn't really be down for the time it would take to reload this data. With partitioning the doc said to contact support. With zabbix down, we ran the prepare script, created our partitions, the restarted zabbix. I loaded the smallest tables first but loading the larger tables caused problems with false alarms caused by contrition for the history tables. Setting threads to 1 and adding a max rate to mysqlsh helped with everything but history_uint. I split my history_uint into 30 files so I could load newest first. After loading about 3 days, I gave up, it caused too many false alarms due to delayed history. At best, it was taking 2 days to load 3 days history_uint.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      Those scripts should be available if you install zabbix-sql-scripts package (whatever distro you may use). for RH8 for example http://repo.zabbix.com/zabbix/6.0/rh...el8.noarch.rpm
      And it is important to not only to mysql / mariadb, but for all db platforms... But having somekind of universal automatic thing there... it is DB upgrade, you cannot expect people to have enough room present for export/import. Setups differ a lot from company to company... Sometimes Zabbix admin may not even have knowledge of DB-s or access to DB.... so it is better to describe, what needs to be done and let people decide themselves, how exactly this will be accomplished... As LenR here already described... there are cases..

      Comment

      • harri
        Member
        • Nov 2010
        • 89

        #4
        Found it, thank you very much

        Comment

        Working...