Doctorbal/zabbix-postgres-partitioning

Fresh install

Closed this issue ยท 3 comments

how should i proceed on a fresh installation? which step should I import the create.sql?

Excellent question @amar3lo!

I realized I did not mention that in the guide as this was mainly addressed to migrating to a partitioned database from an already running Zabbix instance.

To use partitioning on a fresh install on the following specifications:

  • Zabbix version 4.0
  • Debain 9 OS Distro
  • PostgreSQL v.11
  1. Install PostgreSQL v11.
  2. Prepare Zabbix Database.
  3. Create Empty history* and trends* Tables, install pg_partman, ensure make the necessary changes in the postgresql.conf file, create the partitioned tables. Alternatively you can use my ansible role to install pg_partman which performs the previous blocks. Ensure you read the comments in the defaults/main.yml file.
  4. Then import the Zabbix 4.0 schema by performing the following:
$ cd /tmp
$ wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-3+stretch_all.deb
$ sudo dpkg -i zabbix-release_4.0-3+stretch_all.deb
$ sudo apt update
$ sudo apt-get install --no-install-recommends zabbix-server-pgsql
# Now import the schema. You will get errors stating some tables and indexes already exist but ignore those as they were purposefully set on the partitioning portion.
$ zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix
  1. Continue with the rest of the installation.

Let me know how it goes and if you run into any issues.

All the best,
Andreas

I have no words to express my gratitude!!! it works like a charm, thank you!

Awesome to hear @amar3lo ! I'm going to add this into the guide as well so others can follow this for a fresh install. Thanks for verifying that it worked seamlessly.