MySQL Replication

Check

SHOW MASTER STATUS\G

SHOW REPLICA HOSTS;

SHOW REPLICA STATUS\G

For older versions of MySQL you will need to use SLAVE instead of REPLICA.. E.g.SHOW SLAVE HOSTS;SHOW SLAVE STATUS\G

SELECT @@SERVER_ID;

Must be different for each instance in the replication topology

SELECT @@INNODB_FLUSH_LOG_AT_TRX_COMMIT;

Recommended Setting: 1

SELECT @@SYNC_BINLOG;

Recommended Setting: 1

SELECT @@SKIP_NETWORKING;

Must be 0 for replication to work

Lost Master

If you just have 1 replica then this should be enough...

STOP REPLICA;

If you have more than 1 replica.. On the new Master to be...

STOP REPLICA;

RESET BINARY LOGS AND GTIDS;

On the other Slaves...

STOP REPLICA;

CHANGE REPLICATION SOURCE TO SOURCE_HOST='MyNewMaster';

START REPLICA;

For older versions of MySQL you will need to use SLAVE instead of REPLICA.. E.g.STOP SLAVE;START SLAVE;

Binary Log File Position Based Replication

TODO

Replication with Global Transaction Identifiers

TODO

MySQL Master-Master Replication

Master-master replication (with load balancer) introduces the possibility that two or more servers can replicate concurrent changes to each other. To prevent key conflicts by using the auto_increment_offset and auto_increment_increment configuration variables, to ensure AUTO_INCREMENT values will be unique to each server. 

auto-increment-increment = 2

auto-increment-offset = 2 or 1 

Appropriate load balancers would be:

Limitations

Bibliography