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

Implement simple failover script using GTID

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      GTID allows to automatically fail-over a master by promoting a slave as the
      new master, bringing it up-to-date with any other slaves and switching
      existing slaves to use the new master. The procedure is described in the
      documentation.

      https://mariadb.com/kb/en/global-transaction-id/#start-slave-until-master_gtid_posxxx

      We need a script that implements this procedure. The user can then run this
      script to promote a slave as a new master, simply by supplying connection
      information for all involved servers.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            stephane@skysql.com VAROQUI Stephane added a comment - - edited

            Could be possible to use the mysql.server table ? Could auto populate an information schema table when a slave connect and update a last seen date to produce warnings and errors in case of a outdated slave is picked by the command.

            I would rather see a command more than a script as. One would like to create a corosync cluster plugin to be loaded inside MariaDB, synchronize all server information_schema.servers table with the corosync Totem Single Ring Ordering and Membership Protocol and can call such failover command on the Synchronization Engine plugin

            Show
            stephane@skysql.com VAROQUI Stephane added a comment - - edited Could be possible to use the mysql.server table ? Could auto populate an information schema table when a slave connect and update a last seen date to produce warnings and errors in case of a outdated slave is picked by the command. I would rather see a command more than a script as. One would like to create a corosync cluster plugin to be loaded inside MariaDB, synchronize all server information_schema.servers table with the corosync Totem Single Ring Ordering and Membership Protocol and can call such failover command on the Synchronization Engine plugin
            Hide
            stephane@skysql.com VAROQUI Stephane added a comment -

            Possible to add an option to set last executed GTID in the information_schema.servers replicate with corosync cluster API any node could decide who is the most up to date slave in a consistante state, proxy and connection pools could enter the group member to make proper switch over without losing any command. Connection and SQL not in the group member could be refused.

            Show
            stephane@skysql.com VAROQUI Stephane added a comment - Possible to add an option to set last executed GTID in the information_schema.servers replicate with corosync cluster API any node could decide who is the most up to date slave in a consistante state, proxy and connection pools could enter the group member to make proper switch over without losing any command. Connection and SQL not in the group member could be refused.
            Hide
            mathnode Richard Bensley added a comment -

            Check this out, golang so no dependencies like perl/python/ruby needs at install:

            https://github.com/tanji/mariadb-tools

            Blog post:
            http://varokism.blogspot.co.uk/2015/06/slave-election-is-welcoming-gtid.html

            Show
            mathnode Richard Bensley added a comment - Check this out, golang so no dependencies like perl/python/ruby needs at install: https://github.com/tanji/mariadb-tools Blog post: http://varokism.blogspot.co.uk/2015/06/slave-election-is-welcoming-gtid.html

              People

              • Assignee:
                knielsen Kristian Nielsen
                Reporter:
                knielsen Kristian Nielsen
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: