Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The database that is out of sync is on Server-2, therefore, you are going to take a snapshot of the database from Server-1, then restore the snapshot onto Server-2 and restart the replication.

Obtain Channel Names

Depending on how your replication was setup channel names may have been included per node.  Usually your primary server will have the channel name 'server-1' and the secondary server will have the name 'server-2'  However if you are not sure this can be easily identified by login onto MySQL o each server and using the show slave status command..

Expand
titleHow to Show Slave Status...

Log into MySQL console on both machines, and run the show slave status query...

Code Block
languagesql
themeEmacs
mysql -u root -p

(Enter your password at prompt)

mysql> show slave status\G



Stop Replication between both servers

On both Server1 Server-1 and Server-2 machines, open a command prompt and change directory to C:\Program Files\Deepnet DualShield\mysql\bin

...

Hit return and enter the password when prompted.  Hit return again.  The process may take a few minutes, but when you see the curser again, it means the snapshot has been taken.

Copy the snapshot over to server-2

Type the following to reset slave :on server-1 only

Code Block
languagesql
themeEmacs
mysql> reset slave;

...

Stop the DualShield Server Service on (server-2 only)


Type the following query in the MySQL console to delete the current dualshield database: 

...

Code Block
languagesql
themeEmacs
mysql -u root -p DualShield < c:\path-to\backup.sql


You now ned to obtain the Master binary log file and log position from server-1.  Luckily this will have also been recorded in the backup file.

Open a command and prompt and CD to the directory you saved 'backup.sql'

Run the following command:

Code Block
themeEmacs
more backup.sql

The result will show the first few lines of the file, including the 'CHANGE MASTER TO...' query, which will be commented out. Use it as the command to change the slave status.

For example,

Image Added

You can literally copy and paste this CHANGE MASTER TO query statement to but you should also add the 'FOR CHANNEL statement at the end.  You can usually