MariaDB: Enable possibility for Replication

Hi,

I currently heavily use the Addon core-mariadb for storing all HA-data for 90 days. I use 90 days as I LOVE statistics and as my HA is running on a RPI4 with 8GB RAM and a 240GB SSD I also have plenty of space available.

As of now my database has a size of 14GB, so a nightly full backup takes several hours and because of the needed “lock” of the db during the backup I miss a lot of data.

To cirument this I excluded the addon from the nightly backup, which has the drawback that in case of a broken system I loos all my historical data.

My thought on this, as I have several servers running in my home environment (including Synology NAS) is to enable replication from the HA-mariadb addon (primary) to another DB in my network (replica).

For this to work the mariadb configuration needs to be tweaked:
In the section [mysqld] in the file /etc/my.cnf.d/mariadb-server.cnf the following needs to be added:
server-id=5272015 (random number)
log_bin=mysql-bin
log_error=mysql-bin.err

I don’t know if this will add any additional load to the server.

A perhaps “better” solution would be to allow the modification of the mysqld-parameters in the configuration of the addon, but as I’m not a docker- / HA-addon-developer-specialist I don’t know if this is possible at all.

What do you guys think about this?

Regards
Joerg

I use a simple pair of triggers to ‘copy on insert’ for HA tables if my interest to a archive db, I use postgresql. I do this within the same physical db instance, but I do think it is possible to have the triggers copy the record to another physical db. I think the same functions are available in mariadb. If in fact possible to copy to another server, yes, if HD fails on HA machine, you will lose 60 days of full HA data, however the data you are interested in most likely with be on the other machine.

Good hunting!