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

Multi instance config bug: main daemon (my.cnf) read config file of second one in conf.d

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 10.1.20
    • 10.4.6
    • Configuration
    • Debian 8 x64

    Description

      To start multiple instances of MariaDB, you added a /lib/systemd/system/mariadb@.service, indicating that we must create config file for the second daemon in /etc/mysql/conf.d/my{instancename}.cnf.

      But this file is read by the main daemon! In /etc/mysql/my.cnf, we found at the bottom:
      !includedir /etc/mysql/conf.d/*

      So the main daemon:

      • reads the port/socket/etc. from my.cnf
      • change those values later when reading my{instancename}.cnf

      I you comment the !includedir and add as many !include /etc/mysql/conf.d/{conf}.cnf you have, it works as expected.

      To my mind, the "clean" way of fixing it si to read those my{instancename}.cnf files from /etc/mysql, and NOT from /etc/mysql/conf.d.

      Attachments

        Issue Links

          Activity

            Worst Jérémie LEGRAND created issue -
            Worst Jérémie LEGRAND made changes -
            Field Original Value New Value
            Description To start multiple instances of MariaDB, you added a {{/lib/systemd/system/mariadb@.service}}, indicating that we must create config file for the second daemon in {{/etc/mysql/conf.d/my{instancename}.cnf}}.

            But this file is read by the main daemon! In /etc/mysql/my.cnf, we found at the bottom:
            {{!includedir /etc/mysql.conf.d/*}}

            So the main daemon:
            * reads the port/socket/etc. from my.cnf
            * change those values later when reading {{my{instancename}.cnf}}

            I you comment the {{!includedir}} and add as many {{!include /etc/mysql/conf.d/{conf}.cnf}} you have, it works as expected.


            To my mind, the "clean" way of fixing it si to read those {{my{instancename}.cnf}} files from {{/etc/mysql}}, and NOT from {{/etc/mysql/conf.d}}.
            To start multiple instances of MariaDB, you added a {{/lib/systemd/system/mariadb@.service}}, indicating that we must create config file for the second daemon in {{/etc/mysql/conf.d/my\{instancename\}.cnf}}.

            But this file is read by the main daemon! In /etc/mysql/my.cnf, we found at the bottom:
            {{!includedir /etc/mysql.conf.d/*}}

            So the main daemon:
            * reads the port/socket/etc. from my.cnf
            * change those values later when reading {{my{instancename}.cnf}}

            I you comment the {{!includedir}} and add as many {{!include /etc/mysql/conf.d/{conf}.cnf}} you have, it works as expected.


            To my mind, the "clean" way of fixing it si to read those {{my{instancename}.cnf}} files from {{/etc/mysql}}, and NOT from {{/etc/mysql/conf.d}}.
            Worst Jérémie LEGRAND made changes -
            Description To start multiple instances of MariaDB, you added a {{/lib/systemd/system/mariadb@.service}}, indicating that we must create config file for the second daemon in {{/etc/mysql/conf.d/my\{instancename\}.cnf}}.

            But this file is read by the main daemon! In /etc/mysql/my.cnf, we found at the bottom:
            {{!includedir /etc/mysql.conf.d/*}}

            So the main daemon:
            * reads the port/socket/etc. from my.cnf
            * change those values later when reading {{my{instancename}.cnf}}

            I you comment the {{!includedir}} and add as many {{!include /etc/mysql/conf.d/{conf}.cnf}} you have, it works as expected.


            To my mind, the "clean" way of fixing it si to read those {{my{instancename}.cnf}} files from {{/etc/mysql}}, and NOT from {{/etc/mysql/conf.d}}.
            To start multiple instances of MariaDB, you added a {{/lib/systemd/system/mariadb@.service}}, indicating that we must create config file for the second daemon in {{/etc/mysql/conf.d/my\{instancename\}.cnf}}.

            But this file is read by the main daemon! In /etc/mysql/my.cnf, we found at the bottom:
            {{!includedir /etc/mysql.conf.d/*}}

            So the main daemon:
            * reads the port/socket/etc. from my.cnf
            * change those values later when reading {{my\{instancename\}.cnf}}

            I you comment the {{!includedir}} and add as many {{!include /etc/mysql/conf.d/\{conf\}.cnf}} you have, it works as expected.


            To my mind, the "clean" way of fixing it si to read those {{my\{instancename\}.cnf}} files from {{/etc/mysql}}, and NOT from {{/etc/mysql/conf.d}}.
            elenst Elena Stepanova made changes -
            Fix Version/s 10.1 [ 16100 ]
            Assignee Sergey Vojtovich [ svoj ]
            elenst Elena Stepanova made changes -
            Labels systemd
            danblack Daniel Black added a comment -

            Apologies Worst - does https://github.com/MariaDB/server/pull/510 look acceptable?

            danblack Daniel Black added a comment - Apologies Worst - does https://github.com/MariaDB/server/pull/510 look acceptable?

            Hello,

            yes, to my mind it is a good idea to have suffixes. It is a clean way to configure the server.

            Worst Jérémie LEGRAND added a comment - Hello, yes, to my mind it is a good idea to have suffixes. It is a clean way to configure the server.
            danblack Daniel Black added a comment -

            Overdue PR.

            danblack Daniel Black added a comment - Overdue PR.
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Vicentiu Ciorbaru [ cvicentiu ]
            svoj Sergey Vojtovich made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            danblack Daniel Black added a comment -

            Seems this might be the very very last pre-GA chance to change this to a saner implementation. I have used this in anger (like MDEV-15685) and its quite flexible.

            danblack Daniel Black added a comment - Seems this might be the very very last pre-GA chance to change this to a saner implementation. I have used this in anger (like MDEV-15685 ) and its quite flexible.
            ProCycleDev ProCycleDev added a comment -

            +1

            Ubuntu 16.04

            This prevented the default service from starting when upgrading to the latest version of mariadb-server while using multiple instances.

            On ubuntu the install script does not seem to handle multiple instances at all and refuses to install if it can't stop mysql.service (which on my install has been disabled in favor of using the multiple instances).

            When I attempted to start mysql.service it tried to load the last server instance and naturally can't because the socket is already in use. So I was left with a broken system and needed to edit the mariadb@.service file to change the path to the instance configuration files.

            ProCycleDev ProCycleDev added a comment - +1 Ubuntu 16.04 This prevented the default service from starting when upgrading to the latest version of mariadb-server while using multiple instances. On ubuntu the install script does not seem to handle multiple instances at all and refuses to install if it can't stop mysql.service (which on my install has been disabled in favor of using the multiple instances). When I attempted to start mysql.service it tried to load the last server instance and naturally can't because the socket is already in use. So I was left with a broken system and needed to edit the mariadb@.service file to change the path to the instance configuration files.
            danblack Daniel Black added a comment -

            Thanks for your feedback ProCycleDev.

            There are probably some lingering issues with multiinstance in the packaging that need to be addressed however I though this was a good start.

            MDEV-12646 covers a lot of these issues for single instance.

            danblack Daniel Black added a comment - Thanks for your feedback ProCycleDev . There are probably some lingering issues with multiinstance in the packaging that need to be addressed however I though this was a good start. MDEV-12646 covers a lot of these issues for single instance.

            The associated PR removes Galera support from the systemd template unit file because of some unspecified problem with the SST scripts. I don't personally think that Galera support should be removed.

            What is the specific problem that the SST scripts have with the systemd template unit file when managing multiple instances?

            GeoffMontee Geoff Montee (Inactive) added a comment - The associated PR removes Galera support from the systemd template unit file because of some unspecified problem with the SST scripts. I don't personally think that Galera support should be removed. What is the specific problem that the SST scripts have with the systemd template unit file when managing multiple instances?
            serg Sergei Golubchik made changes -
            Assignee Vicentiu Ciorbaru [ cvicentiu ] Axel Schwenke [ axel ]
            danblack Daniel Black added a comment -

            GeoffMontee, no problem with Galera support (though I didn't explicitly test it) was hoping the removal would make it easier to assess/merge however this doesn't seem to be the case.

            pr #1143 / MDEV-19210 is quite compatible with the pr #510 (https://github.com/MariaDB/server/pull/1143#issuecomment-472393702) and I forsee merging both would maintain Galera support correctly in multiinstance scripts. Rather than trying to line up out of tree patches that wait for considerable months/years I'm going leave it to axel to manage the merging debt.

            danblack Daniel Black added a comment - GeoffMontee , no problem with Galera support (though I didn't explicitly test it) was hoping the removal would make it easier to assess/merge however this doesn't seem to be the case. pr #1143 / MDEV-19210 is quite compatible with the pr #510 ( https://github.com/MariaDB/server/pull/1143#issuecomment-472393702 ) and I forsee merging both would maintain Galera support correctly in multiinstance scripts. Rather than trying to line up out of tree patches that wait for considerable months/years I'm going leave it to axel to manage the merging debt.
            danblack Daniel Black made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.1 [ 16100 ]
            danblack Daniel Black made changes -
            Priority Critical [ 2 ] Blocker [ 1 ]
            danblack Daniel Black made changes -
            Fix Version/s 10.4.5 [ 23311 ]
            Fix Version/s 10.4 [ 22408 ]
            danblack Daniel Black added a comment -

            axel apologies for bullying this into 10.4, it had the wrong Fix Version and the foundation finally tested and reviewed in February 2019 along with other users. The faults that this fixes has left have lingered too long in major versions and really needs to a pre GA release.

            danblack Daniel Black added a comment - axel apologies for bullying this into 10.4, it had the wrong Fix Version and the foundation finally tested and reviewed in February 2019 along with other users. The faults that this fixes has left have lingered too long in major versions and really needs to a pre GA release.
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.4.5 [ 23311 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Description To start multiple instances of MariaDB, you added a {{/lib/systemd/system/mariadb@.service}}, indicating that we must create config file for the second daemon in {{/etc/mysql/conf.d/my\{instancename\}.cnf}}.

            But this file is read by the main daemon! In /etc/mysql/my.cnf, we found at the bottom:
            {{!includedir /etc/mysql.conf.d/*}}

            So the main daemon:
            * reads the port/socket/etc. from my.cnf
            * change those values later when reading {{my\{instancename\}.cnf}}

            I you comment the {{!includedir}} and add as many {{!include /etc/mysql/conf.d/\{conf\}.cnf}} you have, it works as expected.


            To my mind, the "clean" way of fixing it si to read those {{my\{instancename\}.cnf}} files from {{/etc/mysql}}, and NOT from {{/etc/mysql/conf.d}}.
            To start multiple instances of MariaDB, you added a {{/lib/systemd/system/mariadb@.service}}, indicating that we must create config file for the second daemon in {{/etc/mysql/conf.d/my\{instancename\}.cnf}}.

            But this file is read by the main daemon! In /etc/mysql/my.cnf, we found at the bottom:
            {{!includedir /etc/mysql/conf.d/*}}

            So the main daemon:
            * reads the port/socket/etc. from my.cnf
            * change those values later when reading {{my\{instancename\}.cnf}}

            I you comment the {{!includedir}} and add as many {{!include /etc/mysql/conf.d/\{conf\}.cnf}} you have, it works as expected.


            To my mind, the "clean" way of fixing it si to read those {{my\{instancename\}.cnf}} files from {{/etc/mysql}}, and NOT from {{/etc/mysql/conf.d}}.
            axel Axel Schwenke added a comment -

            pushed into 10.4 for upcoming 10.4.6

            axel Axel Schwenke added a comment - pushed into 10.4 for upcoming 10.4.6
            axel Axel Schwenke made changes -
            issue.field.resolutiondate 2019-06-14 13:49:46.0 2019-06-14 13:49:46.365
            axel Axel Schwenke made changes -
            Fix Version/s 10.4.6 [ 23412 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            GeoffMontee Geoff Montee (Inactive) made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 78912 ] MariaDB v4 [ 151446 ]

            People

              axel Axel Schwenke
              Worst Jérémie LEGRAND
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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