Advertisement
Guest User

zeus safe peers

a guest
Dec 12th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. #
  2. # Cluster settings
  3. #
  4.  
  5. configMasterAddress=0.0.0.1;
  6. configMasterPort=3307;
  7. configMasterUser=root;
  8. configMasterPassword=;
  9. dataMasterAddress=127.0.0.1;
  10. dataMasterPort=3307;
  11. dataMasterUser=root;
  12. dataMasterPassword=;
  13.  
  14. # If this is set, then we're going to make the peers table "safe" by setting
  15. # all other peers to 0.0.0.1 and eliminating hot standby appliances.
  16. normalizePeers=yes;
  17.  
  18. .
  19. .
  20. .
  21. .
  22. .
  23. if [ "${normalizePeers}" = "yes" ]; then
  24. echo "Creating a safe 'peers' table...";
  25. mysqlconfig -sN -e "UPDATE net.peers SET name = CONCAT( 'changeme-', server_id ), ip = '0.0.0.1';";
  26. case "${myProductTrain}" in
  27. 5.2)
  28. echo "Eliminating hot-standby appliances...";
  29. mysqldata -sN -e "UPDATE net.localsettings SET value = '' WHERE setting LIKE 'masterslave_%_ip';";
  30.  
  31. peerId=$( mysqldata -sN -e "SELECT value FROM net.localsettings WHERE setting = 'server_id';" );
  32. echo "Peer ID: ${peerId}";
  33. echo "Setting a Peer to represent this box...";
  34. mysqlconfig -sN -e "UPDATE net.peers SET ip = '127.0.0.1' WHERE server_id = '${peerId}';";
  35. ;;
  36. 5.3|5.4|5.5|5.6|5.7)
  37. echo "Eliminating hot-standby appliances...";
  38. mysqlconfig -sN -e "UPDATE net.peers SET primary_ip = '0.0.0.1', secondary_ip = NULL, active_appliance = 'PRIMARY';";
  39.  
  40. peerId=$( mysqldata -sN -e "SELECT value FROM local.settings WHERE setting = 'server_id';" );
  41. echo "Peer ID: ${peerId}";
  42. echo "Setting a Peer to represent this box...";
  43. mysqlconfig -sN -e "UPDATE net.peers SET ip = '127.0.0.1', primary_ip = '127.0.0.1' WHERE server_id = '${peerId}';";
  44. ;;
  45. *)
  46. echo "Unsupported product train: ${myProductTrain}";
  47. echo "This script does not know how to modify the peers table.";
  48. ;;
  49. esac;
  50. fi;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement