牛刀小試MySQL--GTID

來源:互聯網
上載者:User

標籤:標識   而且   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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.