Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Cluster settings
- #
- configMasterAddress=0.0.0.1;
- configMasterPort=3307;
- configMasterUser=root;
- configMasterPassword=;
- dataMasterAddress=127.0.0.1;
- dataMasterPort=3307;
- dataMasterUser=root;
- dataMasterPassword=;
- # If this is set, then we're going to make the peers table "safe" by setting
- # all other peers to 0.0.0.1 and eliminating hot standby appliances.
- normalizePeers=yes;
- .
- .
- .
- .
- .
- if [ "${normalizePeers}" = "yes" ]; then
- echo "Creating a safe 'peers' table...";
- mysqlconfig -sN -e "UPDATE net.peers SET name = CONCAT( 'changeme-', server_id ), ip = '0.0.0.1';";
- case "${myProductTrain}" in
- 5.2)
- echo "Eliminating hot-standby appliances...";
- mysqldata -sN -e "UPDATE net.localsettings SET value = '' WHERE setting LIKE 'masterslave_%_ip';";
- peerId=$( mysqldata -sN -e "SELECT value FROM net.localsettings WHERE setting = 'server_id';" );
- echo "Peer ID: ${peerId}";
- echo "Setting a Peer to represent this box...";
- mysqlconfig -sN -e "UPDATE net.peers SET ip = '127.0.0.1' WHERE server_id = '${peerId}';";
- ;;
- 5.3|5.4|5.5|5.6|5.7)
- echo "Eliminating hot-standby appliances...";
- mysqlconfig -sN -e "UPDATE net.peers SET primary_ip = '0.0.0.1', secondary_ip = NULL, active_appliance = 'PRIMARY';";
- peerId=$( mysqldata -sN -e "SELECT value FROM local.settings WHERE setting = 'server_id';" );
- echo "Peer ID: ${peerId}";
- echo "Setting a Peer to represent this box...";
- mysqlconfig -sN -e "UPDATE net.peers SET ip = '127.0.0.1', primary_ip = '127.0.0.1' WHERE server_id = '${peerId}';";
- ;;
- *)
- echo "Unsupported product train: ${myProductTrain}";
- echo "This script does not know how to modify the peers table.";
- ;;
- esac;
- fi;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement