Failover
When the primary fails, promote a replica to primary. With GTID, the process is straightforward. Always verify replicas are caught up before promotion.
When the primary fails, promote a replica to primary. With GTID, the process is straightforward. Always verify replicas are caught up before promotion.
-- On the replica to promote:
STOP REPLICA;
RESET REPLICA ALL; -- remove connection to old primary
-- Verify all GTIDs applied
SHOW VARIABLES LIKE "gtid_executed";
-- Reconfigure application connection strings to point to new primary
-- Point remaining replicas to new primary:
CHANGE REPLICATION SOURCE TO
SOURCE_HOST="new_primary",
SOURCE_AUTO_POSITION=1;
START REPLICA;
Orchestrator, MHA, or InnoDB Cluster automate failover — manual promotion is error-prone under pressure.