Hi,

I am planning to setup a (three-node) galera cluster, holding three different databases for three different mysql client servers.

I am isolating the three databases with users like db1-user@client1 / db2-user@client2 / db3-user@client3 and created grants accordingly.

Additionally we want to prevent any DB from filling up the datadir, so I created three lvm volumes db1/db2/db3 and mounted them under the datadir. (correct permissions, selinux, etc, etc)

Now, here is what AI (perplexity.ai) tells me abut doing this:

Manually creating a directory (e.g. with mkdir) directly under the MariaDB data 
directory is unsupported and can lead to inconsistencies or MariaDB not 
recognizing the database properly.

MariaDB includes tooling like mariadb-install-db to initialize the data 
directory and its system tables correctly, which is part of setting up the 
database environment safely.

However, as I've also tried all of this: it seems to work fine so far. As far as I can tell, the only difference is the absence of db.opt in the lvm-mounted db directories.

This is how I've now created the mounts to be:

/dev/mapper/mysql-tmp            458M   30M  428M   7% /var/lib/mysqltmp
/dev/mapper/mysql-mysql          458M  161M  297M  36% /var/lib/mysql
/dev/mapper/mysql-db1            458M   30M  428M   7% /var/lib/mysql/db1
/dev/mapper/mysql-db2            458M   30M  428M   7% /var/lib/mysql/db2
/dev/mapper/mysql-db3            458M   30M  428M   7% /var/lib/mysql/db3

Some questions I have:

Is mounting separate LVM volumes at individual database directories under the MariaDB data directory a good or safe practice, or should I avoid this to maintain compatibility with MariaDB tools and consistency?

What other or additional methods can help minimize the impact of a problematic database or user from affecting the others?

Are there other best practices I should consider in this Galera cluster setup?

Background: I have three client nodes, each primarily using one Galera node, with failover to the others via HAProxy. This setup has worked well so far.

I'm interested in your feedback and recommendations.

Thanks!
_______________________________________________
discuss mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to