GTID Replication
Global Transaction Identifiers (GTIDs) uniquely identify every committed transaction. GTID-based replication does not require tracking log file positions.
Global Transaction Identifiers (GTIDs) uniquely identify every committed transaction. GTID-based replication does not require tracking log file positions.
-- my.cnf (primary and replica)
-- gtid_mode = ON
-- enforce_gtid_consistency = ON
-- log_bin = ON
-- binlog_format = ROW
-- On replica:
CHANGE REPLICATION SOURCE TO
SOURCE_HOST="primary",
SOURCE_USER="replicator",
SOURCE_PASSWORD="pass",
SOURCE_AUTO_POSITION=1; -- GTID auto-positions
START REPLICA;
SHOW VARIABLES LIKE "gtid_executed";
GTID replication makes failover easier — replicas can resync without manual log position tracking.