Ad Widget

Collapse

Trouble upgrading Zabbix 3.2 Standalone Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doctorbal82
    Member
    • Oct 2016
    • 39

    #1

    Trouble upgrading Zabbix 3.2 Standalone Database

    Hello,

    I am running into an issue on upgrading a seperate postgresql server that serves as the database to a HA Zabbix Server environment (using corosync and pacemaker). Upgrading the server to 3.2 using zabbix-server-pgsql goes just fine but I am receiving an error that the frontend does not match the Zabbix database (3.0 vs 3.2).

    The standalone database (running Postgresql 9.4) is not using the zabbix-server-pgsql package (running on Debian 8.5); just simply a postgres DB.

    Within the zabbix servers log file (/var/log/zabbix/zabbix_server.log) file I am seeing the following error:

    Code:
      1089:20161018:172737.308 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR:  duplicate key value violates unique constraint "events_pkey"
    How can I successfully upgrade a separate postgresql Database with the 3.2 upgrade?

    Thanks!
  • doctorbal82
    Member
    • Oct 2016
    • 39

    #2
    The reason this error showed was because the HA was having zabbix-server running both at the same time. CRM status showed Zabbix1 as the primary but the database was responding to both. After shutting done the none-HA it resolved but other database issues arose, particularly around adding indexes.

    I am using the postgresql .deb package on a standalone DB server. When I try to upgrade from one of the HA servers it fails stating that it requires additional indexes or items after I create them.

    But when I tested this on a standalone database server with the zabbix-server-pgsql .deb package the upgrade was seamless.

    Thus my question is what must be changed for a seamless upgrade on a standalone postrgres only server with no zabbix packages installed? Does it change other parameters that I am unaware of that allows for a seamless DB upgrade?

    Comment

    • doctorbal82
      Member
      • Oct 2016
      • 39

      #3
      I resolved this by rebuilding the whole environment. I must of jacked up the database server on initial installation and configuration.

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by doctorbal82
        I resolved this by rebuilding the whole environment. I must of jacked up the database server on initial installation and configuration.
        Problem with which you've been dealing was on DB layer. You had at least two rows in events_pkey table with non unique value on in some exact column. because this table is very small connecting to the database using command DB client, executing few selects to identify such duplicated rows. Review content of those duplicated rows and make decision which one row remove by one delete query it was all what was necessary to do. Theoretically fixing this issue should take not more few minutes .. even without proper knowledge about SQL just only by google for "postgresql remove duplicate entries".
        Last edited by kloczek; 17-11-2016, 12:27.
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • doctorbal82
          Member
          • Oct 2016
          • 39

          #5
          Thank you for the details. I appreciate the reply.

          Comment

          Working...