More

Upgrading Zabbix with PSQL and TimescaleDB to specific version

By Antti Hurme 04/06/2024 No Comments 2 Min Read

When upgrading to Zabbix 7.0, the minimum version of TimescaleDB extension has been increased, thus you might encounter the following error if you’ve been conservative when upgrading the extension due to version mismatch.

Starting Zabbix Server. Zabbix 7.0.0 (revision 49955f1fb5c).
using configuration file: /etc/zabbix/zabbix_server.conf
TimescaleDB version 20902 is not officially supported. Recommended version is at least TimescaleDB Community Edition 2.10.0.
Zabbix Server stopped. Zabbix 7.0.0 (revision 49955f1fb5c).

To upgrade the timescaledb extension, you need to make sure you don’t upgrade to a non-supported version. For example with Zabbix 7.0 LTS released, the supported extension versions (2 Requirements (zabbix.com)) are between 2.10.0 to 2.14.0, with 2.15.x being the newest available release and is not supported by Zabbix.

Start with upgrading to a specific version, for example 2.14.2-el9.

dnf --showduplicates list timescaledb-2*
dnf install timescaledb-2-loader-postgresql-15-2.14.2-0.el9 timescaledb-2-postgresql-15-2.14.2-0.el9

Run the following command if prompted;
# timescaledb-tune –pg-config=/usr/pgsql-15/bin/pg_config

Restart the database-server and connect to it using -X to not load the extension (Timescale Documentation | Minor TimescaleDB upgrades).

systemctl status postgresql-15
systemctl restart postgresql-15
systemctl status postgresql-15
sudo -u postgres psql

To check the current database extension version, first connect to the database and then check the version;

psql (15.7)
Type "help" for help.

postgres=# \c zabbix
zabbix=# \dx
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | 2.9.2 | public | Enables scalable inserts and complex queries for time-series data
(2 rows)

To upgrade the database, connect using -X, connect to the zabbix database and run the upgrade command;

# sudo -u postgres psql -X
could not change directory to "/root": Permission denied
psql (15.7)
Type "help" for help.

postgres=# \c zabbix
You are now connected to database "zabbix" as user "postgres".
zabbix=#
ALTER EXTENSION timescaledb UPDATE;
ALTER EXTENSION
zabbix=# \dx
List of installed extensions
Name | Version | Schema | Description
-------------+---------+------------+-------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
timescaledb | 2.14.2 | public | Enables scalable inserts and complex queries for time-series data
(2 rows)

Once the database extension has been upgrade, start the zabbix server service.

Written By

Who am I? | Linkedin

View All Articles
U
U
Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.