This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

4 Migration to TimescaleDB

Overview

Support of a time-series database has been added since Zabbix 4.2 in the form of experimental support of TimescaleDB, a PostgreSQL-based database solution of automatically partitioning data into time-based chunks to support faster performance at scale.

Currently TimescaleDB is not supported by Zabbix proxy.

This section provides the steps necessary for migrating from existing PostgreSQL tables to TimescaleDB.

Configuration

We assume that TimescaleDB extension has been already installed on the database server (see installation instructions).

TimescaleDB extension must also be enabled for the specific DB by executing:

echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix

Running this command requires database administrator privileges.

If you use a database schema other than 'public' you need to add a SCHEMA clause to the command above. E.g.:
echo "CREATE EXTENSION IF NOT EXISTS timescaledb SCHEMA yourschema CASCADE;" | sudo -u postgres psql zabbix

Then run the timescaledb.sql script located in database/postgresql:

cat timescaledb.sql | sudo -u zabbix psql zabbix

Migration of existing history and trend data may take a lot of time. Zabbix server and frontend must be down for the period of migration.

The timescaledb.sql script sets the following housekeeping parameters (from AdministrationGeneralHousekeeping):

  • Override item history period
  • Override item trend period

In order to use partitioned housekeeping for history and trends both these options must be on. It's possible to use TimescaleDB partitioning only for trends (by setting Override item trend period) or only for history (Override item history period).