[MDEV-23110] Support for Galera Multi-Instance in systemd unit file Created: 2020-07-07  Updated: 2020-07-07

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Assen Totin (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-19210 use environment file in systemd units... In Testing

 Description   

Currently, MariaDB ships two separate systemd unit files:

  • mariadb.service, used for running a single instance of MariaDB Server on the operating system; it has Galera support.
  • mariadb@.service, used for running multiple instances of MariaDB Server on the same operating system. It lacks Galera support.

This FR asks for the inclusion of necessary code from the first unit file into the second so that multiple MariaDB Server instances, each belonging to a separate Galera cluster, may co-exists and be conveniently managed on the same OS.

To clarify the use case again: several independent MariaDB Server instances using our current systemd cofig overloading mechanism, with each instance being part of a separate Galera cluster. The rationale behind this setup is proper utilisation of hardware resources where a single MariaDB Server instance may fall short of.

Changes to the mariadb@.service unit needed:

  • PermissionsStartOnly=true - in order to run the ExecStartPre stages as root
  • Several ExecStartPre to unset _WSREP_START_POSITION, to run galera_recovery, if found, and to set again _WSREP_START_POSITION with proper last known position.
  • Add "-u mysql" to mysql_install_db when run as ExecStartPre step.
  • Pass _WSREP_NEW_CLUSTER and _WSREP_START_POSITION to the mysqld binary in the ExecStart step.

A quick test done with such changes shows the setup is likely viable. Somewhat surprisingly, the current Fedora 32 builds of MariaDB 10.4.x series include a mariadb@.service unit file that seems to support Galera.


Generated at Thu Feb 08 09:19:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.