Mariadb from 12

I’m finally getting around to using the systemd version of mariadb and having trouble getting the database to start.

Past/background: Starting with 12 sp1 suse went from a init.d script to systemd to run mariadb. Well that didn’t work to well for as we had many DB servers running multiple instances and the systemd didn’t handle it well. So what we did was:

  1. add “.off” to the service files in /usr/lib/systemd/system
  2. copy the init.d script from 12 sp0 to /etc/init.d
  3. then run systemctl daemon-reload.
    This has worked for every DB server we had.

Now every time there’s an update to mariadb we have had to do this process. I’m trying to get away from it but i’m running into this problem.

Little more info: the database files are not in the default location that suse places them. We do use /etc/my.cnf and specify the file locations in here. That includes the multiple DB instances.

Not sure why it’s not working but after looking at the mysql-systemd-helper it appears to require that the files be in the default locations.

Any other ideas are welcome. Thanks

Hi saits1947,

if you want to adopt to the scheme handled by mysql-systemd-helper, why not split up my.cnf and i.e. symlink the SUSE-assumed data directory locations to the ones used by you? Because then it’d basically built-in, so no tweaking of systemd units were required.

many DB servers running multiple instances and the systemd didn’t handle it well

Depending on the root cause of “not handling well”, maybe my above suggestion won’t work for you and we’d have to find an alternative solution:

Since you’ve currently configured /etc/my.cnf to contain multiple sections (likely matching what’s described in https://dev.mysql.com/doc/refman/8.0/en/using-systemd.html), you’d need a different approach and might need to create a modified version of mysql-systemd-helper (and “systemctl edit mysql@.service” to reference your version of the starter script), which wouldn’t reference different config files, but start mysqld with group suffixes according to the instance name (–defaults-group-suffix).

But as you’d also be starting multiple instances of the mysqld process - why not just split up the config and adopt to the data dir scheme that’s implemented in the current starter script (i.e. by setting symlinks, if not being able to i.e mount accordingly), this might save you lots of trouble during updates.

Regards,
J

https://www.suse.com/support/kb/doc/?id=7023920