No Data Loaded in Master
This method only works if the database is empty. If the database is not empty, then replication should be restored as described below.
CAUTION PASSWORD
# On the master mysql> SHOW MASTER STATUS\G # On the slave # Use the values for <Name Logfile> and <Position LogFile> from the output above: mysql> CHANGE MASTER TO MASTER_HOST='acd-dbm',MASTER_USER='repl',MASTER_PASSWORD='<password>',MASTER_LOG_FILE='<Name LogFile>', MASTER_LOG_POS=<Position LogFile>; # On the slave - start the Slave mysql> START SLAVE; # On the slave - check status mysql> SHOW SLAVE STATUS\G
Simple Master Slave
For a simple master slave installation, the above commands will be input only once.
Master-Master Replication
For Master-Master replication with two additional slaves, the replication is setup as follows:
What | Master | Slave |
---|---|---|
Replicate the first master to the second master. | acd-dbm1 | acd-dbm2 |
Replicate the second master to the first master. | acd-dbm2 | acd-dbm1 |
Replicate the first master to the first slave. | acd-dbm1 | acd-dbs1 |
Replicate the second master to the second slave. | acd-dbm2 | acd-dbs2 |
Master is not Empty
If the master is not empty, then use one of the following pages to reconstruct replication: