• Daniel Black's avatar
    systemd: multi-instance changes to -defaults-group-suffix=.%I · 3a0a570e
    Daniel Black authored
    When the multi-instance systemd service file was chosen it effectively
    relied on /etc/my.cnf.d/my{instancename}.cnf file to define its
    configuration file. This is problematic if running along side a
    single instance mariadb service which has /etc/my.cnf that reads all
    configuration file /etc/my.cnf.d/*.cnf.
    
    To prevent the service from auto starting up if a user has this
    previous configuration ConditionPathExists=!@sysconf2dir@/my%I.cnf
    to ensure that a user with the previous configuration isn't
    started in a non-intended mode. Documentation in the service file
    (should be release notes too), described a recommended migration.
    
    A new approach was to use --defaults-group-suffix=.%I as an
    arguement to mysqld and let the user define a [mysqld.{instancename}]
    group within the configuration file. This way existing global
    mysqld configuration options are read with the instance name
    having special overrides of datadir, port, socket etc.
    
    A systemd environment variable MYSQLD_MULTI_INSTANCE is used in the
    defination as it give the user flexability to use multiple
    segregation mechanisms between services. This is used multiple
    times within the service which all needed to be kept consistent.
    
    Another notable change is mysql_install_db being part of the
    ExecStartPre. This provides and auto-initialization for users
    that run multiple instances.
    3a0a570e
mariadb@.service.in 8.2 KB