SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
MySQL 5.6 GTID in a nutshell
                         Miguel Ángel Nieto
            Percona Live University - Toronto
Who am I?
• Miguel Ángel

• I live in the north of Spain

• Support Engineer at Percona

• Hobbies:
  • Scuba Diving
  • Videogames
  • American TV Series
  • Beers


                                 www.percona.com
Agenda
I’m going to answer the following questions and give a
detailed overview that will let us to start working with it:
•   What is GTID?
•   What problems GTID solves?
•   How can I implement it?
•   How can I repair it?
•   How can I use it for HA and Failover?
•   Take in account...



                                               www.percona.com
What is GTID?




                www.percona.com
What is GTID?



8182213e-7c1e-11e2-a6e2-080027635ef5:1




                               www.percona.com
What is GTID?

And that thing is a GTID?

8182213e-7c1e-11e2-a6e2-080027635ef5:1


  Not impressed


                               www.percona.com
What is GTID?



8182213e-7c1e-11e2-a6e2-080027635ef5:1




SID. This is the server’s 128 bit identification number
(SERVER_UUID). It identifies where the transaction
was originated. Every server has its own SERVER_UUID.
                                        www.percona.com
What is GTID?



 8182213e-7c1e-11e2-a6e2-080027635ef5:1




GNO. This is the transaction identification number. It is a
sequence number that increments with every new
transaction.
                                           www.percona.com
What is GTID?
• This is how we can see the GTID inside the binary logs:
 # at 300
 #130221 13:08:58 server id 101 end_log_pos 348 CRC32 0xc18cdbda GTID [commit=yes]
 SET @@SESSION.GTID_NEXT= '8182213e-7c1e-11e2-a6e2-080027635ef5:2'/*!*/;
 # at 348
 BEGIN
 insert into t values(1)
 COMMIT/*!*/;
 # at 565
 #130221 13:09:03 server id 101 end_log_pos 613 CRC32 0x5b25189e GTID [commit=yes]
 SET @@SESSION.GTID_NEXT= '8182213e-7c1e-11e2-a6e2-080027635ef5:3'/*!*/;
 # at 697
 BEGIN
 insert into t values(100)
 COMMIT/*!*/;

• The GTID is replicated to Slave servers.


                                                                 www.percona.com
What problems GTID solves?
INSERT INTO t VALUES(100);
                              MASTER1

             bin-log.000407                               bin-log.000010
             10983                                        4




                                             SLAVE 1

bin-log.000133                          bin-log.001021
984                                     1098



                                            SLAVE 2

                                        bin-log.00333
                                        19833


                                                      www.percona.com
What problems GTID solves?
                              MASTER1

             bin-log.000419                               bin-log.000032
             2083                                         1033




                                             SLAVE 1

bin-log.000201                          bin-log.001021
388                                     1098



                                            SLAVE 2
 CHANGE MASTER TO                       bin-log.00333
 MASTER_LOG_FILE=????                   19833
 MASTER_LOG_POS=????
                                                      www.percona.com
What problems GTID solves?
INSERT INTO t VALUES(100);
                             MASTER1

                 uuid1:383                            uuid1:383




                                         SLAVE 1

    uuid1:383                          uuid1:383




                                         SLAVE 2

                                       uuid1:383



                                                   www.percona.com
What problems GTID solves?
                           MASTER1

               uuid1:398                            uuid1:398




                                       SLAVE 1

   uuid1:398                         uuid1:381




                                       SLAVE 2

CHANGE MASTER TO                     uuid1:381
MASTER_AUTO_POSITION = 1

                                                 www.percona.com
What problems GTID solves?
• It is possible to identify a transaction uniquely across
  the replication servers.

• Make the automation of failover process much easier.
  There is no need to do calculations, inspect the binary
  log and so on. Just MASTER_AUTO_POSITION=1.

• At application level it is easier to do WRITE/READ split.
  After a write on the MASTER you have a GTID so just
  check if that GTID has been executed on the SLAVE that
  you use for reads.

• Development of new automation tools isn’t a pain now.
                                                www.percona.com
How can I implement it?
• Three variables are needed in ALL servers of the
  replication chain

• gtid_mode: It can be ON or OFF (not 1 or 0). It enables
  the GTID on the server.
• log_bin: Enable binary logs. Mandatory to create a
  replication environment.
• log-slave-updates: Slave servers must log the
  changes that comes from the master in its own binary
  log.
• enforce-gtid-consistency: Statements that can’t be
  logged in a transactionally safe manner are denied by
  the server.
                                            www.percona.com
How can I implement it?
• enforce-gtid-consistency

    - CREATE TABLE ... SELECT statements.
ERROR 1786 (HY000): CREATE TABLE ... SELECT is forbidden when
ENFORCE_GTID_CONSISTENCY = 1.

    - CREATE TEMPORARY TABLE inside transactions.
ERROR 1787 (HY000): When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE
TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional
context only, and require that AUTOCOMMIT = 1.


    - Transactions that mixes updates on transactional
      and non-transactional tables.
ERROR 1785 (HY000): When ENFORCE_GTID_CONSISTENCY = 1, updates to non-
transactional tables can only be done in either autocommitted statements or single-statement
transactions, and never in the same statement as updates to transactional tables.

                                                                             www.percona.com
How can I implement it?
      New replication from scratch
                MASTER 1




  SLAVE 1                     SLAVE 2

                                        www.percona.com
How can I implement it?
         New replication from scratch

1) Create replication user on the master server.
2) Configure the parameters on all three servers:
   - gtid_mode
   - log_bin
   - log-slave-updates
   - enforce-gtid-consistency
   - server_id
3) Start all mysql services.
4) CHANGE MASTER TO... with
   MASTER_AUTO_POSITION=1 on the two slave
   servers.
                                        www.percona.com
How can I implement it?
                                           MASTER 1

                log-bin=mysql-bin
                server-id=1
                gtid_mode=ON
                log-slave-updates
                enforce-gtid-consistency




log-bin=mysql-bin                                               log-bin=mysql-bin
server-id=101                                                   server-id=102
gtid_mode=ON                                                    gtid_mode=ON
log-slave-updates                                               log-slave-updates
enforce-gtid-consistency                                        enforce-gtid-consistency


                           SLAVE 1                    SLAVE 2


                                                                    www.percona.com
How can I implement it?
                                 MASTER 1




                     SLAVE 1                SLAVE 2

CHANGE MASTER TO MASTER_HOST="127.0.0.1", MASTER_PORT=18675,
MASTER_USER="msandbox", MASTER_PASSWORD="msandbox", MASTER_AUTO_POSITION=1;

                                                           www.percona.com
How can I implement it?
     Move already running replication to GTID
1. Set the master as read_only and wait until the slaves catch
   up.
2. Stop all servers.
3. Configure the GTID variables in my.cnf.
4. Start all the servers:
    - Master should start in read_only mode.
    - Slaves should start with skip_slave_start.
5. CHANGE MASTER with MASTER_AUTO_POSITION=1 on
   the slaves.
6. START SLAVE; on slave servers.
7. SET GLOBAL read_only=0; on master server.
                                              www.percona.com
How can I implement it?
• Now we run two transactions on the master:
  CREATE TABLE t (i INT);
  INSERT INTO t VALUES(1);
• This is the status of slaves:
 slave1 > show slave statusG
 […]
               Master_Log_File:   mysql-bin.000001
           Read_Master_Log_Pos:   550
                Relay_Log_File:   mysql_sandbox18676-relay-bin.000002
                 Relay_Log_Pos:   760
         Relay_Master_Log_File:   mysql-bin.000001
 […]
              Master_Server_Id:   1
                   Master_UUID:   1c9cdcc8-7c33-11e2-a769-080027635ef5

 […]
            Retrieved_Gtid_Set: 1c9cdcc8-7c33-11e2-a769-080027635ef5:1-2
             Executed_Gtid_Set: 1c9cdcc8-7c33-11e2-a769-080027635ef5:1-2
                 Auto_Position: 1

                                                           www.percona.com
How can I implement it?
• Now we have new variables to check:
  - gtid_executed (ro): shows the transactions that
    have been executed in this server.
    1c9cdcc8-7c33-11e2-a769-080027635ef5:1-3

   - gtid_purged (ro): shows the transactions that have
     been purged from the binary log (purge binary logs
     to...).
     1c9cdcc8-7c33-11e2-a769-080027635ef5:1-2

   - gtid_next: the next GTID that will be used.
     SET @@SESSION.GTID_NEXT=
     '8182213e-7c1e-11e2-a6e2-080027635ef5:2'/*!*/;
                                            www.percona.com
How can I repair it?
• Even with GTID we have the same problem. MySQL
  replication can easily fail.
• The procedure to repair a replication is slightly different
  from the regular replication based on binary log position.
• There is a very good blog post written by a very good
  blogger that explains how to repair it:

  http://www.mysqlperformanceblog.com/2013/02/08/how-
  to-createrestore-a-slave-using-gtid-replication-in-
  mysql-5-6/




                                               www.percona.com
How can I repair it?
     • ERROR!
Slave_IO_Running: No
Slave_SQL_Running: Yes
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log:
'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the
master has purged binary logs containing GTIDs that the slave
requires.'

     • mysqldump supports GTID:
# mysqldump --all-databases --single-transaction --triggers --routines --
host=127.0.0.1 --port=18675 --user=msandbox --password=msandbox > dump.sql

# grep PURGED dump.sql
SET @@GLOBAL.GTID_PURGED='9a511b7b-7059-11e2-9a24-08002762b8af:
1-13';

     • Xtrabackup’s support for GTID is in Work in Progress.
                                                               www.percona.com
How can I repair it?
     • The server was already running as slave, so
       GTID_EXECUTED and GTID_PURGED has values:
slave1 > source test.sql;
ERROR 1840 (HY000): GTID_PURGED    can only be set when GTID_EXECUTED is
empty.

     • So, let’s empty GITD_EXECUTED. But... How? It is a
       read only variable!
slave1 > reset master;
slave1 > show global variables like 'GTID_EXECUTED';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| gtid_executed |        |
+---------------+-------+
slave1> source test.sql;
slave1> start slave;

                                                        www.percona.com
How can I repair it?
• Another way, injecting empty transactions

  http://dev.mysql.com/doc/refman/5.6/en/replication-
  gtids-failover.html#replication-gtids-failover-empty

• SQL_SLAVE_SKIP_COUNTER doesn’t work anymore
  with GTID

• We need to find what transaction is causing the
  replication to fail
   - From binary logs
   - From SHOW SLAVE STATUS (retrieved vs
     executed)
                                              www.percona.com
How can I repair it?
     • Slave failed:
               Last_SQL_Error: Error 'Duplicate entry '4' for key 'PRIMARY'' on
query. Default database: 'test'. Query: 'insert into t VALUES(NULL,'salazar')'
           Retrieved_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5
              Executed_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-4
     • So, this slave has retrieved transactions from 1 to 5 but
       only 1 to 4 has been applied. Seems that transaction 4
       is the problem here.
STOP SLAVE;
SET GTID_NEXT="7d72f9b4-8577-11e2-a3d7-080027635ef5:5";
BEGIN; COMMIT;
SET GTID_NEXT="AUTOMATIC";
START SLAVE;
[...]
Retrieved_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5
Executed_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5

                                                                www.percona.com
How can I repair it?
• mysqldump can be also used to create new slaves.
• It is a new slave so GTID_EXECUTED and
  GTID_PURGED are empty. No RESET MASTER is
  needed.


• Now we know how to create and repair a replication
  with GTID.




                                            www.percona.com
How can I use it for HA and
         Failover?
• We have seen how to implement and repair a GTID
  based replication.
• Now we are going to see it can help us with HA and
  failover:

  mysqlrpladmin: replication administration tool. For
  failover and switchover.

  mysqlfailover: replication heath heck and automatic
  failover tool.



                                              www.percona.com
How can I use it for HA and
         Failover?
• Where can I download these tools?

• https://launchpad.net/mysql-utilities

• MySQL Workbench:




                                          www.percona.com
How can I use it for HA and
         Failover?
• mysqlrpladmin is a tool used to perform planned
  maintenance tasks in our replication environment:

   • switchover: a planned stop for a master. Slave is
     promoted to new master. No possibility of
     transaction loss.

   • failover: a non-planned stop of the master and a
     slave promoted to new master. Last transaction can
     be lost. The tool will chose the most up-to-date
     slave.


                                            www.percona.com
How can I use it for HA and
         Failover?
• Some pre-requisites:
   • To make the autodiscover work the master-info-
     repository=TABLE should be enabled.
   • Slaves should have the replication user created in
     order to be elected as new masters.
  # mysqlrpladmin --master=root:msandbox@master:18675
  --discover-slaves-login=root:msandbox health
  # Discovering slaves for master at 127.0.0.1:18675
  # Checking privileges.
  # Replication Topology Health:
  +------------+--------+---------+--------+------------+---------+
  | host       | port    | role   | state | gtid_mode | health |
  +------------+--------+---------+--------+------------+---------+
  | master     | 18675 | MASTER | UP       | ON         | OK      |
  | SBslave1   | 18676 | SLAVE    | UP     | ON         | OK      |
  | SBslave2   | 18677 | SLAVE    | UP     | ON         | OK      |
  | SBslave3   | 18678 | SLAVE    | UP     | ON         | OK      |
  +------------+--------+---------+--------+------------+---------+

                                                         www.percona.com
How can I use it for HA and
         Failover?
• health: shows the health status of the replication
  servers.
• elect: shows which slave server should be elected as
  new master in case of a failover.
• failover: performs a failover selecting the most up-to-
  date slave.
• gtid: shows GTID information from all nodes
• reset, start, stop: reset, start or stop command on all
  slaves.
• switchover: do a slave promotion using the --new-
  master parameter.


                                              www.percona.com
How can I use it for HA and
           Failover?
 • We need to remove the master from the replication and
   promote a slave to a new master:
# mysqlrpladmin --demote-master --
master=msandbox:msandbox@master:18675 --new-
master=root:msandbox@sbslave1:18676 --
slaves=root:msandbox@sbslave1:18676,root:msandbox@sbslave2:
18677,root:msandbox@sbslave3:18678 switchover
# Performing switchover from master at master:18675 to slave at
sbslave1:18676.
# Switchover complete.
+-----------+--------+---------+--------+------------+---------+
| host      | port   | role    | state | gtid_mode | health |
+-----------+--------+---------+--------+------------+---------+
| sbslave1 | 18676 | MASTER | UP        | ON         | OK       |
| master    | 18675 | SLAVE    | UP     | ON         | OK       |
| sbslave2 | 18677 | SLAVE     | UP     | ON         | OK       |
| sbslave3 | 18678 | SLAVE     | UP     | ON         | OK       |
+-----------+--------+---------+--------+------------+---------+

                                                            www.percona.com
How can I use it for HA and
         Failover?
• mysqlfailover tool do a health check on the replication
  servers and run a failover automatically in case it is
  necessary.

• It monitors the master and in case of a failure on the
  health check it selects the best slave and performs the
  failover.

• You can give the tool a list of slaves that should be
  taken in account for master promotion. For example in
  case of different hardware characteristics.


                                                www.percona.com
How can I use it for HA and
          Failover?
• auto: performs an automatic failover.
• elect: the same as auto but if no candidates on the
  candidates list are viable it shows an error and exists.
• fail: doesn’t perform any failover, just shows an error an
  exist.

mysqlfailover --master=msandbox:msandbox@sbslave1:18676 --
slaves=root:msandbox@master:
18675,root:msandbox@sbslave2:18677,root:msandbox@sbslave3:18678 auto




                                                          www.percona.com
How can I use it for HA and
           Failover?
Failover Mode = auto     Next Interval = Sun Feb 24 13:45:04 2013

Master Information
------------------
Binary Log File    Position   Binlog_Do_DB   Binlog_Ignore_DB
mysql-bin.000002 552

GTID Executed Set
ce40779f-7e7b-11e2-b64d-080027635ef5:1-2

Replication Health Status
+-----------+--------+---------+--------+------------+---------+
| host      | port   | role    | state | gtid_mode | health |
+-----------+--------+---------+--------+------------+---------+
| sbslave1 | 18676 | MASTER | UP        | ON         | OK      |
| master    | 18675 | SLAVE    | UP     | ON         | OK      |
| sbslave2 | 18677 | SLAVE     | UP     | ON         | OK      |
| sbslave3 | 18678 | SLAVE     | UP     | ON         | OK      |
+-----------+--------+---------+--------+------------+---------+

Q-quit R-refresh H-health G-GTID Lists U-UUIDs


                                                                www.percona.com
How can I use it for HA and
         Failover?
• We kill the slave server and the automatic failover
  starts:
     Failover starting in 'auto' mode...
     # Candidate slave master:18675 will become the
     new master.
     # Preparing candidate for failover.
     # Creating replication user if it does not exist.
     # Stopping slaves.
     # Performing STOP on all slaves.
     # Switching slaves to new master.
     # Starting slaves.
     # Performing START on all slaves.
     # Checking slaves for errors.
     # Failover complete.




                                                         www.percona.com
How can I use it for HA and
         Failover?
• Failover done:
 Failover Mode = auto     Next Interval = Sun Feb 24 13:51:31 2013

 Master Information
 ------------------
 Binary Log File    Position   Binlog_Do_DB   Binlog_Ignore_DB
 mysql-bin.000002 552

 GTID Executed Set
 ce40779f-7e7b-11e2-b64d-080027635ef5:1-2

 Replication Health Status
 +-----------+--------+---------+--------+------------+---------+
 | host      | port   | role    | state | gtid_mode | health |
 +-----------+--------+---------+--------+------------+---------+
 | master    | 18675 | MASTER | UP       | ON         | OK      |
 | sbslave2 | 18677 | SLAVE     | UP     | ON         | OK      |
 | sbslave3 | 18678 | SLAVE     | UP     | ON         | OK      |
 +-----------+--------+---------+--------+------------+---------+


                                                           www.percona.com
How can I use it for HA and
         Failover?
• --exec-after
• --exec-before

• You can use your own -pre and -post scripts to do a
  variety of different tasks:
   - Send a mail.
   - Move a virtual IP.
   - Electrocute the DBA.
   - ...




                                             www.percona.com
Take in account...
• 5.6 is a new GA release so there can be bugs...
  http://bugs.mysql.com/bug.php?id=68460

• There have been some problems to make GTID
  compatible with MyISAM. From 5.6.9 it is possible to run
  single statements updating MyISAM tables. Be
  cautious.

• mysql_upgrade --write-binlog=ON can’t connect to a
  server with GTID enabled. So from 5.6 by default
  mysql_upgrade has write-binlog disabled.


                                             www.percona.com
That’s all Folks!
miguel.nieto@percona.com




                           www.percona.com

Contenu connexe

Tendances

Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyJean-François Gagné
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyJean-François Gagné
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyJean-François Gagné
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1Jean-François Gagné
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting Mydbops
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comJean-François Gagné
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High AvailabilityColin Charles
 
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...Jean-François Gagné
 
Pseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology ManagementPseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology ManagementShlomi Noach
 
M|18 Under the Hood: Galera Cluster
M|18 Under the Hood: Galera ClusterM|18 Under the Hood: Galera Cluster
M|18 Under the Hood: Galera ClusterMariaDB plc
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsMariaDB plc
 
M|18 Deep Dive: InnoDB Transactions and Replication
M|18 Deep Dive: InnoDB Transactions and ReplicationM|18 Deep Dive: InnoDB Transactions and Replication
M|18 Deep Dive: InnoDB Transactions and ReplicationMariaDB plc
 
MariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Corporation
 
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitationsMySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityOSSCube
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance OptimisationMydbops
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Henrik Ingo
 
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
High Availability with Galera Cluster - SkySQL Road Show 2013 in BerlinHigh Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
High Availability with Galera Cluster - SkySQL Road Show 2013 in BerlinMariaDB Corporation
 

Tendances (20)

Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
 
MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting MySQL GTID Concepts, Implementation and troubleshooting
MySQL GTID Concepts, Implementation and troubleshooting
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.com
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...
MySQL Parallel Replication (LOGICAL_CLOCK): all the 5.7 (and some of the 8.0)...
 
Pseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology ManagementPseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology Management
 
M|18 Under the Hood: Galera Cluster
M|18 Under the Hood: Galera ClusterM|18 Under the Hood: Galera Cluster
M|18 Under the Hood: Galera Cluster
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change Methods
 
M|18 Deep Dive: InnoDB Transactions and Replication
M|18 Deep Dive: InnoDB Transactions and ReplicationM|18 Deep Dive: InnoDB Transactions and Replication
M|18 Deep Dive: InnoDB Transactions and Replication
 
MariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly Available
 
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitationsMySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
MySQL Sandbox 3
MySQL Sandbox 3MySQL Sandbox 3
MySQL Sandbox 3
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011
 
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
High Availability with Galera Cluster - SkySQL Road Show 2013 in BerlinHigh Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
 

En vedette

MySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: FailoverMySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: FailoverUlf Wendel
 
Zookeeper: Wait-free Coordination for Internet-scale Systems
Zookeeper: Wait-free Coordination for Internet-scale SystemsZookeeper: Wait-free Coordination for Internet-scale Systems
Zookeeper: Wait-free Coordination for Internet-scale SystemsLeandro Lera Romero
 
Kaazing Gateway + Apache Active MQ + Javascript + Stomp
Kaazing Gateway + Apache Active MQ + Javascript + StompKaazing Gateway + Apache Active MQ + Javascript + Stomp
Kaazing Gateway + Apache Active MQ + Javascript + StompIrontec
 
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioaUrko Zurutuza
 
Proxysql use case scenarios plam 2016
Proxysql use case scenarios    plam 2016Proxysql use case scenarios    plam 2016
Proxysql use case scenarios plam 2016Alkin Tezuysal
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!Paradigma Digital
 
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API ExamplesApache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API ExamplesBinu George
 
01 elemental electronica
01   elemental electronica01   elemental electronica
01 elemental electronicaxavazquez
 
02 seguridad
02   seguridad02   seguridad
02 seguridadxavazquez
 
Hadoop: MapReduce para procesar grandes cantidades de datos
Hadoop: MapReduce para procesar grandes cantidades de datosHadoop: MapReduce para procesar grandes cantidades de datos
Hadoop: MapReduce para procesar grandes cantidades de datosRaul Ochoa
 
MySQL - High Availability - Load Balacing - Cluster
MySQL - High Availability - Load Balacing - ClusterMySQL - High Availability - Load Balacing - Cluster
MySQL - High Availability - Load Balacing - ClusterMiguel Angel Nieto
 
Plan de orientación biología2016
Plan de orientación biología2016Plan de orientación biología2016
Plan de orientación biología2016blogdevon
 

En vedette (20)

Curso básico Linux
Curso básico LinuxCurso básico Linux
Curso básico Linux
 
MySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: FailoverMySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: Failover
 
Zookeeper: Wait-free Coordination for Internet-scale Systems
Zookeeper: Wait-free Coordination for Internet-scale SystemsZookeeper: Wait-free Coordination for Internet-scale Systems
Zookeeper: Wait-free Coordination for Internet-scale Systems
 
Kaazing Gateway + Apache Active MQ + Javascript + Stomp
Kaazing Gateway + Apache Active MQ + Javascript + StompKaazing Gateway + Apache Active MQ + Javascript + Stomp
Kaazing Gateway + Apache Active MQ + Javascript + Stomp
 
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa
 
Monitorización
MonitorizaciónMonitorización
Monitorización
 
Proxysql use case scenarios plam 2016
Proxysql use case scenarios    plam 2016Proxysql use case scenarios    plam 2016
Proxysql use case scenarios plam 2016
 
Conferencia 2: El esquema
Conferencia 2: El esquemaConferencia 2: El esquema
Conferencia 2: El esquema
 
Mysql Administracion
Mysql AdministracionMysql Administracion
Mysql Administracion
 
Replicación Mysql
Replicación MysqlReplicación Mysql
Replicación Mysql
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
 
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API ExamplesApache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
 
Comparativa tipos de placa
Comparativa tipos de placaComparativa tipos de placa
Comparativa tipos de placa
 
01 elemental electronica
01   elemental electronica01   elemental electronica
01 elemental electronica
 
02 seguridad
02   seguridad02   seguridad
02 seguridad
 
Hadoop: MapReduce para procesar grandes cantidades de datos
Hadoop: MapReduce para procesar grandes cantidades de datosHadoop: MapReduce para procesar grandes cantidades de datos
Hadoop: MapReduce para procesar grandes cantidades de datos
 
MySQL - High Availability - Load Balacing - Cluster
MySQL - High Availability - Load Balacing - ClusterMySQL - High Availability - Load Balacing - Cluster
MySQL - High Availability - Load Balacing - Cluster
 
Introducción a Solr
Introducción a SolrIntroducción a Solr
Introducción a Solr
 
Seminario Apache Solr
Seminario Apache SolrSeminario Apache Solr
Seminario Apache Solr
 
Plan de orientación biología2016
Plan de orientación biología2016Plan de orientación biología2016
Plan de orientación biología2016
 

Similaire à MySQL 5.6 GTID in a nutshell

MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016Wagner Bianchi
 
Pseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology managementPseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology managementShlomi Noach
 
Errant GTIDs breaking replication @ Percona Live 2019
Errant GTIDs breaking replication @ Percona Live 2019Errant GTIDs breaking replication @ Percona Live 2019
Errant GTIDs breaking replication @ Percona Live 2019Dieter Adriaenssens
 
Managing and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with OrchestratorManaging and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with OrchestratorShlomi Noach
 
Sprint 130
Sprint 130Sprint 130
Sprint 130ManageIQ
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 
Replication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party ExtinctionReplication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party ExtinctionBen Mildren
 
Sprint 131
Sprint 131Sprint 131
Sprint 131ManageIQ
 
CCNA Lab 1-Configuring a Switch Part I
CCNA Lab 1-Configuring a Switch Part ICCNA Lab 1-Configuring a Switch Part I
CCNA Lab 1-Configuring a Switch Part IAmir Jafari
 
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...Cuneyt Goksu
 
Replication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDReplication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDMydbops
 
CCNA : Intro to Cisco IOS - Part 2
CCNA : Intro to Cisco IOS - Part 2CCNA : Intro to Cisco IOS - Part 2
CCNA : Intro to Cisco IOS - Part 2GLC Networks
 
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...Mydbops
 
Cisco labs practical2
Cisco labs practical2Cisco labs practical2
Cisco labs practical2Tai Lam
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsJean-François Gagné
 
리눅스 드라이버 실습 #3
리눅스 드라이버 실습 #3리눅스 드라이버 실습 #3
리눅스 드라이버 실습 #3Sangho Park
 

Similaire à MySQL 5.6 GTID in a nutshell (20)

MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
 
Replication skeptic
Replication skepticReplication skeptic
Replication skeptic
 
Pseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology managementPseudo gtid & easy replication topology management
Pseudo gtid & easy replication topology management
 
Errant GTIDs breaking replication @ Percona Live 2019
Errant GTIDs breaking replication @ Percona Live 2019Errant GTIDs breaking replication @ Percona Live 2019
Errant GTIDs breaking replication @ Percona Live 2019
 
Managing and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with OrchestratorManaging and Visualizing your Replication Topologies with Orchestrator
Managing and Visualizing your Replication Topologies with Orchestrator
 
Sprint 130
Sprint 130Sprint 130
Sprint 130
 
Muda Proposal
Muda ProposalMuda Proposal
Muda Proposal
 
GTIDs Explained
GTIDs ExplainedGTIDs Explained
GTIDs Explained
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
Replication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party ExtinctionReplication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party Extinction
 
Sc manual
Sc manualSc manual
Sc manual
 
Sprint 131
Sprint 131Sprint 131
Sprint 131
 
CCNA Lab 1-Configuring a Switch Part I
CCNA Lab 1-Configuring a Switch Part ICCNA Lab 1-Configuring a Switch Part I
CCNA Lab 1-Configuring a Switch Part I
 
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
Understanding IBM Tivoli OMEGAMON for DB2 Batch Reporting, Customization and ...
 
Replication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTIDReplication Troubleshooting in Classic VS GTID
Replication Troubleshooting in Classic VS GTID
 
CCNA : Intro to Cisco IOS - Part 2
CCNA : Intro to Cisco IOS - Part 2CCNA : Intro to Cisco IOS - Part 2
CCNA : Intro to Cisco IOS - Part 2
 
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster Wi...
 
Cisco labs practical2
Cisco labs practical2Cisco labs practical2
Cisco labs practical2
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitations
 
리눅스 드라이버 실습 #3
리눅스 드라이버 실습 #3리눅스 드라이버 실습 #3
리눅스 드라이버 실습 #3
 

Plus de Miguel Angel Nieto (9)

Query planner
Query plannerQuery planner
Query planner
 
Curso SMTP avanzado
Curso SMTP avanzadoCurso SMTP avanzado
Curso SMTP avanzado
 
Apache avanzado
Apache avanzadoApache avanzado
Apache avanzado
 
Tomcat y Jboss
Tomcat y JbossTomcat y Jboss
Tomcat y Jboss
 
Curso SMTP
Curso SMTPCurso SMTP
Curso SMTP
 
Curso Squid avanzado
Curso Squid avanzadoCurso Squid avanzado
Curso Squid avanzado
 
Apache
ApacheApache
Apache
 
Nfs, Nis, DHCP
Nfs, Nis, DHCPNfs, Nis, DHCP
Nfs, Nis, DHCP
 
Administración Zimbra
Administración ZimbraAdministración Zimbra
Administración Zimbra
 

Dernier

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 

Dernier (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 

MySQL 5.6 GTID in a nutshell

  • 1. MySQL 5.6 GTID in a nutshell Miguel Ángel Nieto Percona Live University - Toronto
  • 2. Who am I? • Miguel Ángel • I live in the north of Spain • Support Engineer at Percona • Hobbies: • Scuba Diving • Videogames • American TV Series • Beers www.percona.com
  • 3. Agenda I’m going to answer the following questions and give a detailed overview that will let us to start working with it: • What is GTID? • What problems GTID solves? • How can I implement it? • How can I repair it? • How can I use it for HA and Failover? • Take in account... www.percona.com
  • 4. What is GTID? www.percona.com
  • 6. What is GTID? And that thing is a GTID? 8182213e-7c1e-11e2-a6e2-080027635ef5:1 Not impressed www.percona.com
  • 7. What is GTID? 8182213e-7c1e-11e2-a6e2-080027635ef5:1 SID. This is the server’s 128 bit identification number (SERVER_UUID). It identifies where the transaction was originated. Every server has its own SERVER_UUID. www.percona.com
  • 8. What is GTID? 8182213e-7c1e-11e2-a6e2-080027635ef5:1 GNO. This is the transaction identification number. It is a sequence number that increments with every new transaction. www.percona.com
  • 9. What is GTID? • This is how we can see the GTID inside the binary logs: # at 300 #130221 13:08:58 server id 101 end_log_pos 348 CRC32 0xc18cdbda GTID [commit=yes] SET @@SESSION.GTID_NEXT= '8182213e-7c1e-11e2-a6e2-080027635ef5:2'/*!*/; # at 348 BEGIN insert into t values(1) COMMIT/*!*/; # at 565 #130221 13:09:03 server id 101 end_log_pos 613 CRC32 0x5b25189e GTID [commit=yes] SET @@SESSION.GTID_NEXT= '8182213e-7c1e-11e2-a6e2-080027635ef5:3'/*!*/; # at 697 BEGIN insert into t values(100) COMMIT/*!*/; • The GTID is replicated to Slave servers. www.percona.com
  • 10. What problems GTID solves? INSERT INTO t VALUES(100); MASTER1 bin-log.000407 bin-log.000010 10983 4 SLAVE 1 bin-log.000133 bin-log.001021 984 1098 SLAVE 2 bin-log.00333 19833 www.percona.com
  • 11. What problems GTID solves? MASTER1 bin-log.000419 bin-log.000032 2083 1033 SLAVE 1 bin-log.000201 bin-log.001021 388 1098 SLAVE 2 CHANGE MASTER TO bin-log.00333 MASTER_LOG_FILE=???? 19833 MASTER_LOG_POS=???? www.percona.com
  • 12. What problems GTID solves? INSERT INTO t VALUES(100); MASTER1 uuid1:383 uuid1:383 SLAVE 1 uuid1:383 uuid1:383 SLAVE 2 uuid1:383 www.percona.com
  • 13. What problems GTID solves? MASTER1 uuid1:398 uuid1:398 SLAVE 1 uuid1:398 uuid1:381 SLAVE 2 CHANGE MASTER TO uuid1:381 MASTER_AUTO_POSITION = 1 www.percona.com
  • 14. What problems GTID solves? • It is possible to identify a transaction uniquely across the replication servers. • Make the automation of failover process much easier. There is no need to do calculations, inspect the binary log and so on. Just MASTER_AUTO_POSITION=1. • At application level it is easier to do WRITE/READ split. After a write on the MASTER you have a GTID so just check if that GTID has been executed on the SLAVE that you use for reads. • Development of new automation tools isn’t a pain now. www.percona.com
  • 15. How can I implement it? • Three variables are needed in ALL servers of the replication chain • gtid_mode: It can be ON or OFF (not 1 or 0). It enables the GTID on the server. • log_bin: Enable binary logs. Mandatory to create a replication environment. • log-slave-updates: Slave servers must log the changes that comes from the master in its own binary log. • enforce-gtid-consistency: Statements that can’t be logged in a transactionally safe manner are denied by the server. www.percona.com
  • 16. How can I implement it? • enforce-gtid-consistency - CREATE TABLE ... SELECT statements. ERROR 1786 (HY000): CREATE TABLE ... SELECT is forbidden when ENFORCE_GTID_CONSISTENCY = 1. - CREATE TEMPORARY TABLE inside transactions. ERROR 1787 (HY000): When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. - Transactions that mixes updates on transactional and non-transactional tables. ERROR 1785 (HY000): When ENFORCE_GTID_CONSISTENCY = 1, updates to non- transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables. www.percona.com
  • 17. How can I implement it? New replication from scratch MASTER 1 SLAVE 1 SLAVE 2 www.percona.com
  • 18. How can I implement it? New replication from scratch 1) Create replication user on the master server. 2) Configure the parameters on all three servers: - gtid_mode - log_bin - log-slave-updates - enforce-gtid-consistency - server_id 3) Start all mysql services. 4) CHANGE MASTER TO... with MASTER_AUTO_POSITION=1 on the two slave servers. www.percona.com
  • 19. How can I implement it? MASTER 1 log-bin=mysql-bin server-id=1 gtid_mode=ON log-slave-updates enforce-gtid-consistency log-bin=mysql-bin log-bin=mysql-bin server-id=101 server-id=102 gtid_mode=ON gtid_mode=ON log-slave-updates log-slave-updates enforce-gtid-consistency enforce-gtid-consistency SLAVE 1 SLAVE 2 www.percona.com
  • 20. How can I implement it? MASTER 1 SLAVE 1 SLAVE 2 CHANGE MASTER TO MASTER_HOST="127.0.0.1", MASTER_PORT=18675, MASTER_USER="msandbox", MASTER_PASSWORD="msandbox", MASTER_AUTO_POSITION=1; www.percona.com
  • 21. How can I implement it? Move already running replication to GTID 1. Set the master as read_only and wait until the slaves catch up. 2. Stop all servers. 3. Configure the GTID variables in my.cnf. 4. Start all the servers: - Master should start in read_only mode. - Slaves should start with skip_slave_start. 5. CHANGE MASTER with MASTER_AUTO_POSITION=1 on the slaves. 6. START SLAVE; on slave servers. 7. SET GLOBAL read_only=0; on master server. www.percona.com
  • 22. How can I implement it? • Now we run two transactions on the master: CREATE TABLE t (i INT); INSERT INTO t VALUES(1); • This is the status of slaves: slave1 > show slave statusG […] Master_Log_File: mysql-bin.000001 Read_Master_Log_Pos: 550 Relay_Log_File: mysql_sandbox18676-relay-bin.000002 Relay_Log_Pos: 760 Relay_Master_Log_File: mysql-bin.000001 […] Master_Server_Id: 1 Master_UUID: 1c9cdcc8-7c33-11e2-a769-080027635ef5 […] Retrieved_Gtid_Set: 1c9cdcc8-7c33-11e2-a769-080027635ef5:1-2 Executed_Gtid_Set: 1c9cdcc8-7c33-11e2-a769-080027635ef5:1-2 Auto_Position: 1 www.percona.com
  • 23. How can I implement it? • Now we have new variables to check: - gtid_executed (ro): shows the transactions that have been executed in this server. 1c9cdcc8-7c33-11e2-a769-080027635ef5:1-3 - gtid_purged (ro): shows the transactions that have been purged from the binary log (purge binary logs to...). 1c9cdcc8-7c33-11e2-a769-080027635ef5:1-2 - gtid_next: the next GTID that will be used. SET @@SESSION.GTID_NEXT= '8182213e-7c1e-11e2-a6e2-080027635ef5:2'/*!*/; www.percona.com
  • 24. How can I repair it? • Even with GTID we have the same problem. MySQL replication can easily fail. • The procedure to repair a replication is slightly different from the regular replication based on binary log position. • There is a very good blog post written by a very good blogger that explains how to repair it: http://www.mysqlperformanceblog.com/2013/02/08/how- to-createrestore-a-slave-using-gtid-replication-in- mysql-5-6/ www.percona.com
  • 25. How can I repair it? • ERROR! Slave_IO_Running: No Slave_SQL_Running: Yes Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.' • mysqldump supports GTID: # mysqldump --all-databases --single-transaction --triggers --routines -- host=127.0.0.1 --port=18675 --user=msandbox --password=msandbox > dump.sql # grep PURGED dump.sql SET @@GLOBAL.GTID_PURGED='9a511b7b-7059-11e2-9a24-08002762b8af: 1-13'; • Xtrabackup’s support for GTID is in Work in Progress. www.percona.com
  • 26. How can I repair it? • The server was already running as slave, so GTID_EXECUTED and GTID_PURGED has values: slave1 > source test.sql; ERROR 1840 (HY000): GTID_PURGED can only be set when GTID_EXECUTED is empty. • So, let’s empty GITD_EXECUTED. But... How? It is a read only variable! slave1 > reset master; slave1 > show global variables like 'GTID_EXECUTED'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | gtid_executed | | +---------------+-------+ slave1> source test.sql; slave1> start slave; www.percona.com
  • 27. How can I repair it? • Another way, injecting empty transactions http://dev.mysql.com/doc/refman/5.6/en/replication- gtids-failover.html#replication-gtids-failover-empty • SQL_SLAVE_SKIP_COUNTER doesn’t work anymore with GTID • We need to find what transaction is causing the replication to fail - From binary logs - From SHOW SLAVE STATUS (retrieved vs executed) www.percona.com
  • 28. How can I repair it? • Slave failed: Last_SQL_Error: Error 'Duplicate entry '4' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'insert into t VALUES(NULL,'salazar')' Retrieved_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5 Executed_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-4 • So, this slave has retrieved transactions from 1 to 5 but only 1 to 4 has been applied. Seems that transaction 4 is the problem here. STOP SLAVE; SET GTID_NEXT="7d72f9b4-8577-11e2-a3d7-080027635ef5:5"; BEGIN; COMMIT; SET GTID_NEXT="AUTOMATIC"; START SLAVE; [...] Retrieved_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5 Executed_Gtid_Set: 7d72f9b4-8577-11e2-a3d7-080027635ef5:1-5 www.percona.com
  • 29. How can I repair it? • mysqldump can be also used to create new slaves. • It is a new slave so GTID_EXECUTED and GTID_PURGED are empty. No RESET MASTER is needed. • Now we know how to create and repair a replication with GTID. www.percona.com
  • 30. How can I use it for HA and Failover? • We have seen how to implement and repair a GTID based replication. • Now we are going to see it can help us with HA and failover: mysqlrpladmin: replication administration tool. For failover and switchover. mysqlfailover: replication heath heck and automatic failover tool. www.percona.com
  • 31. How can I use it for HA and Failover? • Where can I download these tools? • https://launchpad.net/mysql-utilities • MySQL Workbench: www.percona.com
  • 32. How can I use it for HA and Failover? • mysqlrpladmin is a tool used to perform planned maintenance tasks in our replication environment: • switchover: a planned stop for a master. Slave is promoted to new master. No possibility of transaction loss. • failover: a non-planned stop of the master and a slave promoted to new master. Last transaction can be lost. The tool will chose the most up-to-date slave. www.percona.com
  • 33. How can I use it for HA and Failover? • Some pre-requisites: • To make the autodiscover work the master-info- repository=TABLE should be enabled. • Slaves should have the replication user created in order to be elected as new masters. # mysqlrpladmin --master=root:msandbox@master:18675 --discover-slaves-login=root:msandbox health # Discovering slaves for master at 127.0.0.1:18675 # Checking privileges. # Replication Topology Health: +------------+--------+---------+--------+------------+---------+ | host | port | role | state | gtid_mode | health | +------------+--------+---------+--------+------------+---------+ | master | 18675 | MASTER | UP | ON | OK | | SBslave1 | 18676 | SLAVE | UP | ON | OK | | SBslave2 | 18677 | SLAVE | UP | ON | OK | | SBslave3 | 18678 | SLAVE | UP | ON | OK | +------------+--------+---------+--------+------------+---------+ www.percona.com
  • 34. How can I use it for HA and Failover? • health: shows the health status of the replication servers. • elect: shows which slave server should be elected as new master in case of a failover. • failover: performs a failover selecting the most up-to- date slave. • gtid: shows GTID information from all nodes • reset, start, stop: reset, start or stop command on all slaves. • switchover: do a slave promotion using the --new- master parameter. www.percona.com
  • 35. How can I use it for HA and Failover? • We need to remove the master from the replication and promote a slave to a new master: # mysqlrpladmin --demote-master -- master=msandbox:msandbox@master:18675 --new- master=root:msandbox@sbslave1:18676 -- slaves=root:msandbox@sbslave1:18676,root:msandbox@sbslave2: 18677,root:msandbox@sbslave3:18678 switchover # Performing switchover from master at master:18675 to slave at sbslave1:18676. # Switchover complete. +-----------+--------+---------+--------+------------+---------+ | host | port | role | state | gtid_mode | health | +-----------+--------+---------+--------+------------+---------+ | sbslave1 | 18676 | MASTER | UP | ON | OK | | master | 18675 | SLAVE | UP | ON | OK | | sbslave2 | 18677 | SLAVE | UP | ON | OK | | sbslave3 | 18678 | SLAVE | UP | ON | OK | +-----------+--------+---------+--------+------------+---------+ www.percona.com
  • 36. How can I use it for HA and Failover? • mysqlfailover tool do a health check on the replication servers and run a failover automatically in case it is necessary. • It monitors the master and in case of a failure on the health check it selects the best slave and performs the failover. • You can give the tool a list of slaves that should be taken in account for master promotion. For example in case of different hardware characteristics. www.percona.com
  • 37. How can I use it for HA and Failover? • auto: performs an automatic failover. • elect: the same as auto but if no candidates on the candidates list are viable it shows an error and exists. • fail: doesn’t perform any failover, just shows an error an exist. mysqlfailover --master=msandbox:msandbox@sbslave1:18676 -- slaves=root:msandbox@master: 18675,root:msandbox@sbslave2:18677,root:msandbox@sbslave3:18678 auto www.percona.com
  • 38. How can I use it for HA and Failover? Failover Mode = auto Next Interval = Sun Feb 24 13:45:04 2013 Master Information ------------------ Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB mysql-bin.000002 552 GTID Executed Set ce40779f-7e7b-11e2-b64d-080027635ef5:1-2 Replication Health Status +-----------+--------+---------+--------+------------+---------+ | host | port | role | state | gtid_mode | health | +-----------+--------+---------+--------+------------+---------+ | sbslave1 | 18676 | MASTER | UP | ON | OK | | master | 18675 | SLAVE | UP | ON | OK | | sbslave2 | 18677 | SLAVE | UP | ON | OK | | sbslave3 | 18678 | SLAVE | UP | ON | OK | +-----------+--------+---------+--------+------------+---------+ Q-quit R-refresh H-health G-GTID Lists U-UUIDs www.percona.com
  • 39. How can I use it for HA and Failover? • We kill the slave server and the automatic failover starts: Failover starting in 'auto' mode... # Candidate slave master:18675 will become the new master. # Preparing candidate for failover. # Creating replication user if it does not exist. # Stopping slaves. # Performing STOP on all slaves. # Switching slaves to new master. # Starting slaves. # Performing START on all slaves. # Checking slaves for errors. # Failover complete. www.percona.com
  • 40. How can I use it for HA and Failover? • Failover done: Failover Mode = auto Next Interval = Sun Feb 24 13:51:31 2013 Master Information ------------------ Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB mysql-bin.000002 552 GTID Executed Set ce40779f-7e7b-11e2-b64d-080027635ef5:1-2 Replication Health Status +-----------+--------+---------+--------+------------+---------+ | host | port | role | state | gtid_mode | health | +-----------+--------+---------+--------+------------+---------+ | master | 18675 | MASTER | UP | ON | OK | | sbslave2 | 18677 | SLAVE | UP | ON | OK | | sbslave3 | 18678 | SLAVE | UP | ON | OK | +-----------+--------+---------+--------+------------+---------+ www.percona.com
  • 41. How can I use it for HA and Failover? • --exec-after • --exec-before • You can use your own -pre and -post scripts to do a variety of different tasks: - Send a mail. - Move a virtual IP. - Electrocute the DBA. - ... www.percona.com
  • 42. Take in account... • 5.6 is a new GA release so there can be bugs... http://bugs.mysql.com/bug.php?id=68460 • There have been some problems to make GTID compatible with MyISAM. From 5.6.9 it is possible to run single statements updating MyISAM tables. Be cautious. • mysql_upgrade --write-binlog=ON can’t connect to a server with GTID enabled. So from 5.6 by default mysql_upgrade has write-binlog disabled. www.percona.com