Can I run mysqld on top of glusterfs?

Solution 1:

Due to a reasonably long delay with no answers, I have found out by trial and error.

The answer is : Yes, I can run mysqld on top of glusterfs.

I set this up on Ubuntu and briefly here are the steps:

  • Install Ubuntu
  • Install and configure glusterfs
  • Install mysql-server
  • Configure /etc/mysql/my.cnf to set datadir /mnt/glusterfs instead of /var/lib/mysql
  • Set up the databases
  • Configure AppAmor to allow the above to work (or disable appamor )

The real problem comes in how MySQL handles locks.

However you can pass all of this off to glusterfs to handle so that many mysqld processes (running on separate nodes) can access the same database files on /mnt/glusterfs. You need to read this carefully.

  • Disable the query cache, switch on external locking and disable delays to writing.

Solution 2:

Attempted this on a K8 cluster. MySQL running inside of a container, GlusterFS installed directly on the node (non-containerized). MySQL container had an affinity set to always run on the same node as GFS, mounting volume using K8's native GFS volume driver.

Experienced random high latency for WordPress sites, even with NGINX FastCGI (PHP-FPM) caching enabled. Switched over to hostPath volume for MySQL container, latency problems went away.

Solution 3:

I do not think that is possible. Richard, the link you provided is talking about MyIsam and they say that is not recommended anyway. I read somewhere (I do not remember where) that using innoDB files shared by several nodes will lead to data corruption.

Solution 4:

I don't know why you want to access the same DB files from different MySQL server processes but if the reason is performance you should have a look at Galera.

Integrated in Maria DB and Percona XTRA DB Cluster