log_bin = mysql-bin
log-slave-updates = 1
binlog_format = row
sync-master-info = 1
sync_binlog = 1
#relay log
skip_slave_start = 1
配置后,重启 MySQL 服务:
[root@mysql-master ~]# systemctl restart mysqld
登录 MySQL,并查看 Master 状态, 发现多了一项 Executed_Gtid_Set
:
mysql> show master status;
±------------------±---------±-------------±-----------------±------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
±------------------±---------±-------------±-----------------±------------------+
| mysql-bin.000001 | 154 | | | |
±------------------±---------±-------------±-----------------±------------------+
1 row in set (0.00 sec)
mysql> show global variables like ‘%uuid%’;
±--------------±-------------------------------------+
| Variable_name | Value |
±--------------±-------------------------------------+
| server_uuid | 317e2aad-1565-11e9-9c2e-005056ac6820 |
±--------------±-------------------------------------+
1 row in set (0.00 sec)
查看确认 GTID 功能打开:
mysql> show global variables like ‘%gtid%’;
±---------------------------------±------+
| Variable_name | Value |
±---------------------------------±------+
| binlog_gtid_simple_recovery | ON |
| enforce_gtid_consistency | ON |
| gtid_executed | |
| gtid_executed_compression_period | 1000 |
| gtid_mode | ON |
| gtid_owned | |
| gtid_purged | |
| session_track_gtids | OFF |
±---------------------------------±------+
8 rows in set (0.00 sec)
查看确认 Binlog 日志功能打开:
mysql&g