Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

No Data Loaded in Master

Note

This method only works if the database is empty. If the database is not empty, then replication should be restored as described below.


Translations Ignore


Code Block
# 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='<passwort>',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:

WhatMasterSlave
Replicate the first master to the second master.acd-dbm1acd-dbm2
Replicate the second master to the first master.acd-dbm2acd-dbm1
Replicate the first master to the first slave. acd-dbm1acd-dbs1
Replicate the second master to the second slave. acd-dbm2acd-dbs2

Master is not Empty

If the master is not empty, then use one of the following pages to reconstruct replication:

Restore MySQL Master Slave Replication wiederherstellen

Restore MySQL Master-Master Replikation wiederherstellenReplication

Sv translation
languagede

Status
colourRed
titleThis page is only available in English

Bisher wurden keine Daten auf den Master eingespielt (Master ist leer)

Dies funktioniert nur dann, wenn überhaupt keine Daten in den Datenbanken eingespielt wurden. 

Die Datenbanken sind also komplett leer (bis auf die Konfiguration bisher).

In diesen Fall kann die Replikation einfach wie folgt initialisiert werden:

Translations Ignore
Code Block
titleMySQL Commands for Replication Initialisation
# To the respective master (also for master-master)
mysql> SHOW MASTER STATUS\G

# To the slave
# Here adjust <acd-dbm> as well as <Name Logfile> and <Position LogFile>:
mysql> CHANGE MASTER TO MASTER_HOST='<acd-dbm>',MASTER_USER='repl',MASTER_PASSWORD='<passwort>',MASTER_LOG_FILE='<Name LogFile>', MASTER_LOG_POS=<Position LogFile>;

# Start Slave
mysql> START SLAVE;

# Check status
mysql> SHOW SLAVE STATUS\G

Daten wurden eingespielt (Master ist nicht leer)

Je nach dem welche Architektur installiert wird, wird die Replikation wie auf den verlinkten Seiten eingerichtet:

Hinweis:

  • Die Replikation kann auch wiederhergestellt werden, als ob es vorher gelaufen wäre - es gibt keine Notwendikeit zwischen einer Erstinstallation oder Wiederherstellung zu unterscheiden.

MySQL Master Slave Replication wiederherstellen

MySQL Master-Master Replikation wiederherstellen