Systemd 10.1.16 DataDir

Maria DB seems to be very specific as to where it wants to run for 10.1.16 with systemd. Default CentOS deployments as done on one of our other sites do not allow the kind of space that a shared hosting server would require in /var/lib to be able to deliver, and grow. This is no huge problem: move it to the /home directory - where the bulk of the data is - and happy days. This became the default deployment for quite some time for that particular site.
However, when attempting to update the version of MariaDB that is in use - this spanner gets thrown into the works
"As of MariaDB 10.1.16, the data directory cannot reside in /home, /usr, /etc, /boot, or /root directories on systemd equipped systems.

You must move your MariaDB data directory outside of these directories before continuing with this upgrade."
Which is a restriction well worth being aware of - in short systemd mariaDB 10.1.16.
Why on earth anyone would want to run it from /etc/ /root/ /boot/ evades me completely - and /usr/ also seems like an odd choice - but you could argue a case for home /home/ - however it is not to be.
The obvious choice would be to use symlinks and hope it doesn't look too closely. So ln -s /home/mysql_data /var/lib/mysql or some such, then change the /etc/my.cnf to reflect the new changes to the data directory. This is not a game changer - but it is something to keep in mind moving forward.
In the case of this host, it transpires there was sufficient space - so the move was done with a service maria stop, cp -pr /home/mysql_data/* /var/lib/mysql, then an edit of the /etc/my.cnf to reflect the new data dir, and then restart. Then let cPanel work its magic on the upgrade.
More than anything - something to plan for. Thanks for the continued pain in the ass systemd.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: