GTID主從復制
阿新 • • 發佈:2019-02-12
val 從庫 tid mysqld roo variable oba rest 主從 MySQL主從復制
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| enforce_gtid_consistency | ON | #執行GTID一致
| gtid_executed | |
| gtid_mode | ON | #開啟GTID模塊
| gtid_owned | |
| gtid_purged | |
+--------------------------+-------+
http://blog.51cto.com/13523963/2349224
GTID主從復制
只需在mysql主從復制配置文件下加參數即可:
#編輯mysql配置文件(主庫從庫都需要修改)
[root@mysql-db01 ~]# vim /etc/my.cnf
#在[mysqld]標簽下添加
[mysqld]
gtid_mode=ON
log_slave_updates
enforce_gtid_consistency
#重啟數據庫
[root@mysql-db01 ~]# /etc/init.d/mysqld restart
#檢查GTID狀態
mysql> show global variables like ‘%gtid%‘;
| Variable_name | Value |
+--------------------------+-------+
| enforce_gtid_consistency | ON | #執行GTID一致
| gtid_executed | |
| gtid_mode | ON | #開啟GTID模塊
| gtid_owned | |
| gtid_purged | |
GTID主從復制