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
The DBMS PostgreSQL is currently supported. There is only limited support for MariaDB and MySQL. There are various reasons for this.
One of the reasons is that the Python modules for MySQL and MariaDB, which are available in the Debian and Rocky Linux repositories, have some problems with handling columns of type JSON. For this reason, the right Python modules for MySQL and MariaDB must be installed over other sources.
For MySQL, the Python module mysql-connector must be installed from the official website at mysql.com.
When using MariaDB, the module “mariadb” must be installed via “pip”.
pip3 install mariadb
Another reason why we recommend using PostgreSQL is performance. PostgreSQL performs significantly better than MySQL/MariaDB and this is especially important when storing metrics in larger setups.