This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Name: MySQL_HOTREBUILD_SLAVE_from_MASTER.sh by Joshua_sign | |
# original version was MySQL_REBUILD_LIVE_SLAVE_from_MASTER by Matthew Crenshaw | |
# | |
# Purpose: Rebuilds live for one or all Databases of a SLAVE replication server based on a good running MASTER server | |
# This rebuilt action is done without stopping the MASTER MySQL server BUT by locking the MASTER server tables | |
# during the backup of master databases with the F method (minimal duration possible) | |
# or during the whole transfert with the P method. | |
# Note that a main difference with the original script of Matthew Crenshaw, this version is used for a symetric MASTER/SLAVE. | |
# In other words, the SLAVE can became a MASTER if the MASTER go down, and MASTER can became SLAVE if needed. |