This tutorial describes how to use DualShield's MySQL multi-source replication utility to create a multi-master replication system. 

Preparation

  1. Download MySqlReplication.zip file to the primary server and extract the files to a folder, e.g. "C:\MySQLSetupMM". There are two files: MySQLSetupMM.ps1 and MySQLLocal.ps1 in the zip.

  2. Run PowerShell as the administrator on the primary server. Set-ExecutionPolicy RemoteSigned

  3. Make sure your firewall is not blocking MySQL (default port 3306).

  4. Check your MySQL version and make sure it is 5.7.6 or later.

Configuration

  1. Stop the DualShield service on all servers (VERY IMPORTANT!)

  2. On the primary server, run PowerShell as the administrator. Change directory to the folder containing the replication utility files, i.e. "MySQLSetupMM.ps1" and "MySQLLocal.ps1"

  3. Execute the script file: "MySQLSetupMM.ps1". At the prompt, enter the IP address of each DualShield server, starting with the Primary server.


  4. Verify the parameters and press C to continue. 

  5. A file called "MySqlLocal.ps1" will be created on every non-primary server in the folder called "C:\DSMySQLLocal". 

  6. On each non-primary server, right click "MySQLLocal.ps1" script file and select "Run with PowerShell". (Make sure that you have followed point 2 in the preparation)

  7. Once "MySQLLocal.ps1" has been successfully executed on all non-primary server, return to the primary server and type any key to complete the setup.

  8. On every server, in MySQL command line, run "show slave status": 

    Both "Slave_IO_Running" and "Slave_SQL_Running" should be "Yes" 

  9. Finally, start the DualShield service on all server machines.