標籤:標識 而且 row l資料庫 順序分配 stat position span 超級
GTID的概念何為GITD
GTID(global transaction identifier)是全域事務標識符,在MySQL5.6版本中作為一個超級特性被推出。事務標識不僅對於Master(起源)的伺服器來說是惟一的,而且在整個複寫拓撲架構來說,也是全域唯一的。
1.GTID的格式
GTID = source_id:transaction_id
GTID分為兩部分,source_id和transaction_id。source_id是通過使用MySQL服務的server_uuid來表示 。transaction_id 是在事務提交的時候由系統順序分配的一個序號。
使用show master status查看當前執行個體執行過的GTID事務資訊。如下:
([email protected]) [Ztest]> show master status\G;*************************** 1. row *************************** File: mysql-bin.000005 Position: 1959 Binlog_Do_DB: Binlog_Ignore_DB: Executed_Gtid_Set: 4160e9b3-58d9-11e8-b174-005056af6f24:1-101 row in set (0.00 sec)
可以看出,本執行個體的source_id為4160e9b3-58d9-11e8-b174-005056af6f24,transaction_id為1-10,說明是提交了10個事務。
MySQL資料庫服務的uuid的查詢方式。
([email protected]) [(none)]> show GLOBAL VARIABLES like ‘server_uuid‘;+---------------+--------------------------------------+| Variable_name | Value |+---------------+--------------------------------------+| server_uuid | 4160e9b3-58d9-11e8-b174-005056af6f24 |+---------------+--------------------------------------+1 row in set (0.02 sec)
牛刀小試MySQL--GTID