Sv translation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IntroductionThis page describes the process of rebuilding a Master-Master DB & Replication. Since the MySQL Dump command locks the tables, there is no need to create it when there is no traffic on the machine. It can be done during operational hours. With --master-data the command mysqldump stores the correct position for inserting the replication on the slave server. ProcedureDetermine Good MasterIn a system with Master-Master replication, one of the masters is active and processing queries from the other jtel cluster members. This is the server from which the MySQL Dump is taken, since this master has the latest data and is up to date.
Haproxy configurationIf there is a HAPROXY, then remove the servers on the BROKEN MASTER side from the distribution (also the BROKEN SLAVE on this side). STOP SLAVELogin to MySQL on both the GOOD MASTER and the BROKEN MASTER to stop the slave SQL. Leave MySQL again afterwards. Use the following commands for this:
Phase 1 - MySQL DumpA MySQL Dump of the GOOD MASTER is now created. Perform the following steps to create a MySQL Dump and save it to the STORE:
jtel Portal software releaseLog in to the Load Balancer of the cluster and execute the following commands as the jtel user
Create Backup Directory
Create MySQL Dump
MySQL Dump - Until jtel Portal release 3.12
Guter Server ermitteln Zuerst muss entschieden werden, welcher der "guter" Server ist. Wenn HAPROXY im Betrieb ist, dann ist der guter Master der auf den die Daten derzeit geschrieben werden. HAPROXY umstellen Falls es ein HAPROXY gibt, dann die Server auf der Kaputten Master Seite aus der Verteilung herausnehmen (auch den Slave auf dieser Seite). Auf BEIDE Master Server Translations Ignore |
Auf den KAPUTTEN Master Server eine Sicherung der guten Master DB anfertigen Vor Release 3.12: Translations Ignore |
Ab Release 3.12 bitte folgenden Befehl nutzen:
Auf den KAPUTTEN Master Server, den Slave resetten, und Sicherung einspielen Translations Ignore |
Auf den KAPUTTEN Master Server aus den master.sql die Master Position ermitteln, und dann den Slave reinitialisieren Translations Ignore |
Auf den KAPUTTEN Master Server den Slave Prüfen Translations Ignore |
Erst wenn alles OK, und die Replikation aktuell ist, dann weitermachen. Den Status kann man mit folgenden Befehl beobachten: Translations Ignore |
Auf den KAPUTTEN Master Server alle Tabellen locken und Master Position notieren Translations Ignore |
Die Positionen von SHOW MASTER STATUS werden im folgenden Kommando benötigt. Auf den GUTEN Master Server die Replikation neu positionieren und starten Translations Ignore |
Auf den KAPUTTEN Master Server die Tabellen Locks aufheben Translations Ignore |
Master und Slaves Prüfen Auf allen Servern nun Translations Ignore |
und prüfen dass alles richtig läuft Es ist normalerweise nicht nötig, die Slaves die an beide Master hängen ebenfalls zu wiederherstellen. Wenn doch, können diese mit der normalen Prozedur für das Wiederherstellen des Slaves neu initialisiert werden. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sv translation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MySQL Dump - From jtel Portal release 3.12 until latest release
MySQL Dump - From Release 3.32
Guter Server ermitteln Zuerst muss entschieden werden, welcher der "guter" Server ist. Wenn HAPROXY im Betrieb ist, dann ist der guter Master der auf den die Daten derzeit geschrieben werden. HAPROXY umstellen Falls es ein HAPROXY gibt, dann die Server auf der Kaputten Master Seite aus der Verteilung herausnehmen (auch den Slave auf dieser Seite). Auf BEIDE Master Server Translations Ignore |
Auf den KAPUTTEN Master Server eine Sicherung der guten Master DB anfertigen Vor Release 3.12:
Ab Release 3.12 bitte folgenden Befehl nutzen:
MySQL Dump - From MySQL 8.0.27To Check for MySQL Version, log in to the master database server and execute the following command
Auf den KAPUTTEN Master Server, den Slave resetten, und Sicherung einspielen Translations Ignore |
Brief Explanation of the mysqldump command
Phase 2 - Import Dump on BROKEN MASTER
Import Dump - tmux
Import Dump - No tmux
Update Replication Parameterson BROKEN MASTER
Determine the replication parameters from the GOOD MASTER and reinitialize the BROKEN MASTER
Translations Ignore | Code Block |
Auf den KAPUTTEN Master Server den Slave Prüfen Check the slave on the BROKEN MASTER
Den Status kann man mit folgenden Befehl beobachten: Only if everything is OK, and the replication is up to date, then continue. The status can be monitored with the following command: Translations Ignore |
Auf den KAPUTTEN Master Server alle Tabellen locken und Master Position notieren Lock Tables on BROKEN MASTER
Die Positionen von SHOW MASTER STATUS werden im folgenden Kommando benötigt. Auf den GUTEN Master Server die Replikation neu positionieren und starten Translations Ignore | Code Block | On the GOOD MASTER, reposition and start the replication.
Auf den KAPUTTEN Master Server die Tabellen Locks aufheben Unlock the tables on the BROKEN master server
Master und Slaves Prüfen Auf allen Servern nun Final Checks - All Serverstranslations-ignoreCheck the GOOD MASTER, THE GOOD SLAVE, THE BROKEN MASTER AND THE BROKEN SLAVE
Final Checks - Haproxy configurationIf there is a HAPROXY, then add the servers on the BROKEN MASTER side from the distribution (also the BROKEN SLAVE on this side). |
Sv translation | ||
---|---|---|
| ||
Sv translation | ||
---|---|---|
| ||