Databases 11 min read

How to Deploy Zabbix 4.4 with TimescaleDB on CentOS 7 – Step‑by‑Step Guide

This guide walks through installing Zabbix 4.4.0 on CentOS 7, configuring PostgreSQL, adding the TimescaleDB time‑series extension, setting up the Zabbix database, and tuning Linux, Nginx, and PHP so the monitoring platform runs smoothly with high‑performance time‑series storage.

Ops Development Stories
Ops Development Stories
Ops Development Stories
How to Deploy Zabbix 4.4 with TimescaleDB on CentOS 7 – Step‑by‑Step Guide

2019.10 Zabbix 4.4.0 was officially released, introducing a new Go‑based agent2 and many features. One of the most important new features is official support for TimescaleDB, a PostgreSQL‑based time‑series database.

TimescaleDB Overview

TimescaleDB is a PostgreSQL plug‑in that inherits all PostgreSQL capabilities and adds rich support for time‑series data, including GIS, JSON, key‑value, image feature values, range, arrays, composite types, custom types, etc. It is well suited for industrial time‑series scenarios and offers the following characteristics:

Time‑optimized storage

Automatic sharding by time and space (chunks)

Full SQL interface

Support for vertical and horizontal scaling

Automatic partitioning on time and space dimensions

Parallel query across multiple servers and chunks

Automatic chunk size adjustment

Internal write optimizations (batch commit, in‑memory index, transaction support, back‑filling)

Complex query optimizations (chunk selection, recent‑value fetch, limit push‑down, parallel aggregation)

Leverages PostgreSQL features such as GIS and JOIN, and supports PITR and streaming replication

Automatic retention policies that delete old data

Linux System Preparation

Check the OS version and install required packages:

<code>cat /etc/redhat-release</code>
<code>yum install epel-release</code>
<code>yum -y install sysstat traceroute net-tools telnet tree net-snmp-utils htop vim lrzsz tcpdump wget git</code>

Disable SELinux permanently and temporarily:

<code># Edit /etc/selinux/config and set SELINUX=disabled</code>
<code>setenforce 0</code>

Stop and disable the firewall:

<code>systemctl stop firewalld && systemctl disable firewalld</code>

Adjust ulimit for all users:

<code>* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536</code>

Optimize kernel parameters:

<code>vim /etc/sysctl.conf</code>
<code>vm.swappiness = 0
vm.max_map_count = 262144
net.core.somaxconn = 65535
net.ipv4.ip_forward = 1</code>
<code>sysctl -p</code>

PostgreSQL Installation

<code>yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm</code>
<code>yum install postgresql11</code>
<code>yum install postgresql11-server</code>
<code>/usr/pgsql-11/bin/postgresql-11-setup initdb</code>
<code>systemctl enable postgresql-11 && systemctl start postgresql-11</code>

TimescaleDB Deployment

Add the TimescaleDB YUM repository:

<code>vim /etc/yum.repos.d/timescale_timescaledb.repo</code>
<code>[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/7/$basearch
gpgcheck=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
enabled=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300</code>
<code>yum install -y timescaledb-postgresql-11</code>

Enable the extension in

postgresql.conf

:

<code>vim /var/lib/pgsql/11/data/postgresql.conf</code>
<code>shared_preload_libraries = 'timescaledb'</code>
<code>systemctl restart postgresql-11</code>

Zabbix TimescaleDB Database Setup

<code>sudo -u postgres psql</code>
<code>create user zabbix with password 'zabbixpwd123';
create database zabbix owner zabbix;
grant all privileges on database zabbix to zabbix;
</code>
<code>echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix</code>

Import Zabbix schema and TimescaleDB‑specific objects:

<code>zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix -h 192.168.99.221</code>
<code>zcat /usr/share/doc/zabbix-server-pgsql*/timescaledb.sql.gz | sudo -u zabbix psql zabbix -h 192.168.99.221</code>

Database deployment is now complete.

Zabbix Server Installation

<code>rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm</code>
<code>yum -y install zabbix-server-pgsql zabbix-web-pgsql</code>

Configure the server (edit

/etc/zabbix/zabbix_server.conf

):

<code>DBHost=192.168.99.221
DBName=zabbix
DBUser=zabbix
DBPassword=zabbixpwd123
DBPort=5432</code>
<code>systemctl start zabbix-server && systemctl enable zabbix-server</code>

PHP and Nginx Configuration

<code># yum install nginx php php-fpm php-mysql -y</code>
<code>systemctl start nginx && systemctl enable nginx</code>
<code>vim /etc/php-fpm.d/zabbix.conf   # set appropriate date.timezone and other parameters</code>
<code>systemctl restart php-fpm</code>

Web UI and Font Tweaks

Copy a suitable Chinese font to the server and create a symlink so Zabbix UI renders correctly:

<code># cp /path/to/SimKai.ttf /usr/share/fonts/dejavu/zabbix.ttf
# ln -s /usr/share/fonts/dejavu/zabbix.ttf /etc/alternatives/zabbix-web-font</code>

Verification

Test remote connection to the TimescaleDB‑backed Zabbix database:

<code>psql -U postgres -h 192.168.99.221</code>

Note: Zabbix Server supports TimescaleDB, but Zabbix Proxy does not.

monitoringDatabaselinuxPostgreSQLCentOSZabbixTimescaleDB
Ops Development Stories
Written by

Ops Development Stories

Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.