Ad Widget

Collapse

upgrading timescaledb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hakanozanlagan
    Member
    • Nov 2021
    • 35

    #1

    upgrading timescaledb

    hi,
    I upgraded Zabbix from 6.0 LTS to 7.0 LTS. now zabbix getting below error and stop working.is there a guide for upgrading timescaledb for zabbix?

    4195:20240814:133016.165 TimescaleDB version 20601 is not officially supported. Recommended version is at least TimescaleDB Community Edition 2.13.0.
    4195:20240814:133016.169 Zabbix Server stopped. Zabbix 7.0.2 (revision d1b0c3308ce).

    my first timescaledb installation procedure for zabbix is below

    --install timescaledb
    apt install -y gnupg postgresql-common apt-transport-https lsb-release wget
    /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
    echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list
    wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo sh -c "gpg --dearmor > /etc/apt/trusted.gpg.d/timescaledb.gpg"
    apt -y update
    apt-get install -y timescaledb-2-postgresql-14='2.6.1*' timescaledb-2-loader-postgresql-14='2.6.1*'
    sudo timescaledb-tune --quiet --yes
    systemctl restart postgresql
    systemctl status postgresql

    --create extension
    psql
    \c zabbix
    CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;​

    --apply sql file
    cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb.sql | sudo -u zabbix psql zabbix

    systemctl restart postgresql
    Last edited by hakanozanlagan; 14-08-2024, 17:10.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    If you already had it installed, then installing update and then issuing "ALTER EXTENSION timescaledb UPDATE;" should do the trick... https://docs.timescale.com/self-host...minor-upgrade/

    Comment

  • hakanozanlagan
    Member
    • Nov 2021
    • 35

    #3
    Originally posted by cyber
    If you already had it installed, then installing update and then issuing "ALTER EXTENSION timescaledb UPDATE;" should do the trick... https://docs.timescale.com/self-host...minor-upgrade/
    hi cyber. I finished upgrade at zabbix that have a small db.It is done quickly. but our prod env has 75GB database and it's taking very long time at applying schema sql.

    Is it neccesary to apply schema.sql? or do tou have any suggestion for better perofrmance

    my procedure is below.
    1. upgrade postgresql14 timescaledb from 2.06 to 2.15
    3. upgrade zabbix to 6.4 and 7.03 in order. and start with "AllowUnsupportedDBVersions=1" parameter
    4. install postgresql16 and timescaledb 2.15 on same machine
    5. migrate old db to v16
    6. apply schema.sql
    7. start zabbix server
    Last edited by hakanozanlagan; 03-10-2024, 09:00.

    Comment

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

      #4
      If you migrate your old db, you do not need to apply any sql any more (you will screw up your upgrade that way)... first startup of your server should do the upgrades and changes to schema.

      Comment

      • hakanozanlagan
        Member
        • Nov 2021
        • 35

        #5
        Originally posted by cyber
        If you migrate your old db, you do not need to apply any sql any more (you will screw up your upgrade that way)... first startup of your server should do the upgrades and changes to schema.
        thanks for answer
        Actually, I did not migrate database. An upgrade was made.. The command I used to upgrade the DB is below. After this command was completed on two different Zabbix servers, I ran schema.sql. They are now working without any problems. I read somewhere that when you upgrade to Zabbix 7.0, schema.sql needs to work in order for the table and schema infrastructure to be compatible. is it wrong?

        /usr/lib/postgresql/16/bin/pg_upgrade --old-datadir=/etc/postgresql/14/main/ --new-datadir=/PostgresqlData/ --old-bindir=/usr/lib/postgresql/14/bin --new-bindir=/usr/lib/postgresql/16/bin

        using schema.sql is neccesary if you use timescaledb.

        This time, we will show you how to update Zabbix to the latest version 7.0, including the upgrade of PHP, PostgreSQL, and TimescaleDB.


        "Since our Zabbix database uses the TimescaleDB extension, we must also run an SQL script again to initialize hypertables. A new feature in version 7.0 is the hypertabled auditlog table."
        Last edited by hakanozanlagan; 04-10-2024, 10:06.

        Comment

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

          #6
          ah .. I see.. it is a bit different approach to DB upgrade (not just zabbix DB schema) and data transfer...I think I will have an opportunity to do inplace upgrade soon, then I can see, if that reapply of schema is needed or not... From my current understanding, it shoudl not be necessary... but, who knows..

          Comment

          Working...