Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23110

Support for Galera Multi-Instance in systemd unit file

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              assen.totin Assen Totin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.