fb_pixel

How to Install Zabbix 6.0 + PostgreSQL with TimeScale 2.0 on CentOS 8.0

Development | Software Testing
Description
What we will need:

  • RHEL / CentOS 8
  • PostgreSQL 13
  • TimescaleDB 2.0
  • Zabbix 6.0 pre release

# Update
sudo yum -y update
sudo systemctl reboot
Attachments
No attachments
Info
Description
Description
# PostgreSQL13
sudo dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo yum search postgresql13
sudo dnf install postgresql13 postgresql13-server

sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
or
/etc/init.d/postgresql initdb

# Add TimescaleDB repo
# Add TimescaleDB repo
sudo tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/$(rpm -E %{rhel})/\$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL

# Disable builtin postgres packages on CentOs 8
if command -v dnf; then sudo dnf -qy module disable postgresql; fi

# Now install appropriate package for PG version
sudo yum install -y timescaledb-2-postgresql-13

# Configure your database
sudo timescaledb-tune

# Restart PostgreSQL 13
sudo systemctl enable --now postgresql-13
sudo systemctl restart postgresql-13

# Check after reboot
sudo systemctl status postgresql-13

# Zabbix 6.0 pre release
rpm -Uvh https://repo.zabbix.com/zabbix/5.5/rhel/8/x86_64/zabbix-release-5.5-1.el8.noarch.rpm
dnf clean all
dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

# Enter password

sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
zcat /usr/share/doc/zabbix-sql-scripts/postgresql/create.sql.gz | sudo -u zabbix psql zabbix

# Enable TimescaleDB
echo "shared_preload_libraries = 'timescaledb'" >> /var/lib/pgsql/13/data/postgresql.conf
sudo systemctl restart postgresql-13

# TimescaleDB Install
echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
zcat /usr/share/doc/zabbix-server-pgsql*/timescaledb.sql.gz | sudo -u zabbix psql zabbix

Edit zabbix_server.conf
nano /etc/zabbix/zabbix_server.conf
DBPassword="Zabbix Password"

Edit pg_hba.conf
nano /var/lib/pgsql/13/data/pg_hba.conf

# Add new configurations
nano /var/lib/pgsql/13/data/pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            scram-sha-256
# IPv6 local connections:
host    all             all             ::1/128                 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            scram-sha-256
host    replication     all             ::1/128                 scram-sha-256

# New Zabbix 6.0
host    zabbix          zabbix          127.0.0.1/32            password

# Edit /etc/php-fpm.d/zabbix.conf
nano /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = "add your time zone"

# SELinux
setenforce 0

# Enable and restart
systemctl enable zabbix-server zabbix-agent httpd postgresql-13 
systemctl restart zabbix-server zabbix-agent httpd php-fpm postgresql-13

# Firewall rules
firewall-cmd --list-all
firewall-cmd --zone=public --permanent --add-port=80/tcp
firewall-cmd --zone=public --permanent --add-port=443/tcp
firewall-cmd --zone=public --permanent --add-port=10050/tcp
firewall-cmd --zone=public --permanent --add-port=10051/tcp
firewall-cmd --complete-reload
firewall-cmd --list-all

# FrontEnd Setup

# Click next
Set password to DB

# Set Server name
Zabbix 6.0

# Finish
Now open web browser http://localhost/zabbix
Login: Admin
Password: zabbix

on September 20th, 2021 (8:55 pm)
All coments
This job has not been commented yet.