What is the concept of Gtid GITD
GTID (Global transaction Identifier) is the global transaction identifier that was introduced as a super feature in the MySQL5.6 version. The transaction ID is unique not only to the Master (Origin) server, but also to the overall replication topology.
Format of 1.GTID
GTID = source_id:transaction_id
Gtid is divided into two parts, source_id and transaction_id. SOURCE_ID is represented by the Server_uuid that uses the MySQL service. TRANSACTION_ID is a sequence number that is assigned by the system order at the time the transaction is committed.
Use show master status to view the Gtid transaction information that the current instance has performed. As follows:
master1row *************************** File: mysql-bin.000005 1959 Binlog_Do_DB: Binlog_Ignore_DB: Executed_Gtid_Set: 4160e9b3-58d9-11e8-b174-005056af6f24:1-101rowinset (0.00 sec)
可以看出,本实例的source_id为4160e9b3-58d9-11e8-b174-005056af6f24,transaction_id为1-10,说明是提交了10个事务。
The query method for the UUID of the MySQL database service.
([email protected]) [(none)]> GLOBALlike‘server_uuid‘;+---------------+--------------------------------------+Value |+---------------+--------------------------------------+| server_uuid | 4160e9b3-58d9-11e8-b174-005056af6f24 |+---------------+--------------------------------------+1rowinset (0.02 sec)
Kind Mysql--gtid