Database, Datastore, Backup

Bloonix requires two databases. One database for management, another for storing metrics. For better performance, the metrics are stored in partitions, one partition per day.

To install the database and set up the backup script for the datastore, the bloonix-webgui-schema package is required.

Database

The database for management is installed by default with the user and database name blxdb. To do this, you must change to the directory /usr/share/bloonix/schema/, where the scripts for setting up the databases are located.

cd /usr/share/bloonix/schema/
./init-postgresql-database -i -m -o /etc/bloonix/database/main.conf

Datastore

The database for storing the metrics is installed in a similar way. The user and database name are blxds by default:

cd /usr/share/bloonix/schema/
./init-postgresql-database -i -d -o /etc/bloonix/datastore/main.conf

Backup

The backup of the management database can be done quite easily using the typical tools pg_dump and mysqldump. Bloonix provides a special backup and restore script for the datastore that contains the metrics. The scripts are

  • bloonix-datastore-backup
  • bloonix-datastore-restore

A cron job can be set up for the backup script, which can be executed every 15 minutes. The script incrementally backs up the datastore under /var/backup/bloonix-datastore.

Which DBMS should be used

Currently, PostgreSQL is the recommended and supported database system. Support for MariaDB and MySQL is limited due to several reasons.

One reason is that the available Python modules for MySQL and MariaDB in Debian and Rocky Linux have issues handling columns of type JSON. Because of this, the appropriate modules must be installed from external sources.

For MySQL, the mysql-connector module must be installed from the official MySQL website. For MariaDB, the mariadb module can be installed via pip:

pip3 install mariadb

Another important reason for recommending PostgreSQL is performance. PostgreSQL performs significantly better than MySQL/MariaDB, especially when storing large volumes of metrics in bigger setups.