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:

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

Disable SELinux permanently and temporarily:

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

Stop and disable the firewall:

systemctl stop firewalld && systemctl disable firewalld

Adjust ulimit for all users:

* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536

Optimize kernel parameters:

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

PostgreSQL Installation

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

TimescaleDB Deployment

Add the TimescaleDB YUM repository:

vim /etc/yum.repos.d/timescale_timescaledb.repo
[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
yum install -y timescaledb-postgresql-11

Enable the extension in postgresql.conf:

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

Zabbix TimescaleDB Database Setup

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

Import Zabbix schema and TimescaleDB‑specific objects:

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

Database deployment is now complete.

Zabbix Server Installation

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

Configure the server (edit /etc/zabbix/zabbix_server.conf):

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

PHP and Nginx Configuration

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

Web UI and Font Tweaks

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

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

Verification

Test remote connection to the TimescaleDB‑backed Zabbix database:

psql -U postgres -h 192.168.99.221

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

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

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

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.