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 configurationDetermine good server 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 umstellenIf there is a HAPROXY, then remove the servers on the broken master BROKEN MASTER side from the distribution (also the slave BROKEN SLAVE on this side). On BOTH Master Server Translations Ignore |
Make a backup of the good Master DB on the BROKEN Master Server Previous to Release 3.12: Translations Ignore |
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
As of release 3.12 please use the following command:
On the BROKEN master server, reset the slave and restore the backup translations-ignoreMySQL Dump - From jtel Portal release 3.12 until latest release
On the BROKEN master server, determine the master position from the master.sql, and then reinitialize the slave Translations Ignore |
On the BROKEN master server Check the slave Translations Ignore |
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 |
On the BROKEN master server lock all tables and note master position Translations Ignore |
The positions of SHOW MASTER STATUS are required in the following command. On the GOOD master server, reposition and start the replication. Translations Ignore |
Unlock the tables on the BROKEN master server Translations Ignore |
Check Masters and Slaves On all servers now Translations Ignore |
and check that everything is running smoothly It is usually not necessary to restore the slaves attached to both masters. If it is, they can be re-initialized with the normal slave recovery procedure. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sv translation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 |
Translations Ignore |
Auf den KAPUTTEN Master Server den Slave Prüfen Translations Ignore |
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 |
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
Déterminer le bon serveur Il faut d'abord décider quel est le "bon" serveur. Si HAPROXY est en service, alors le bon maître est celui sur lequel les données sont actuellement écrites. Rediffuser HAPROXY S'il y a une HAPROXIE, supprimez les serveurs sur le brisé côté master de la distribution (également l'esclave de ce côté). Sur LES DEUX serveurs master Translations Ignore |
Faites une sauvegarde de la bonne Master DB sur le Serveur principal BRISÉ Précédent à la version 3.12 : Translations Ignore |
A partir de la version 3.12, veuillez utiliser la commande suivante : Translations Ignore |
Dans le Serveur maître BRISÉ, réinitialiser l'esclave et restaurer la sauvegarde Translations Ignore |
Dans le Serveur maître BRISÉ, déterminer la position du maître à partir du master.sql, puis réinitialiser l'esclave
Dans leServeur maître BRISÉ Vérifier l'esclave Check the slave on the BROKEN MASTER
Seulement si tout va bien et que la réplication est à jour, alors continuez. L'état peut être surveillé avec la commande suivante : 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
Lock Tables on BROKEN MASTER Dans le Serveur maître BRISÉ verrouiller toutes les tables et noter la position du maître
Les postes de SHOW MASTER STATUS sont requis dans la commande suivante. Dans le BON serveur maître, repositionner et commencer la réplication. On the GOOD MASTER, reposition and start the replication.
Déverrouillez les tableaux sur le Serveur maître BRISÉ Unlock the tables on the BROKEN master server
Contrôler les maîtres et les esclaves Sur tous les serveurs maintenant Final Checks - All Serverstranslations-ignoreCheck the GOOD MASTER, THE GOOD SLAVE, THE BROKEN MASTER AND THE BROKEN SLAVE
et vérifier que tout fonctionne bien Il n'est généralement pas nécessaire de rétablir les esclaves attachés aux deux maîtres. Si c'est le cas, ils peuvent être réinitialisés avec la procédure normale de récupération des esclaves.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 | ||
---|---|---|
| ||