Versions Compared

Key

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

...

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

...

Depending on how your replication was set up, 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 on each server and using the show slave status command..

...

Stop Replication between both servers

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

...

Code Block
languagesql
themeEmacs
mysql -u root -p

(Enter your password at prompt)

mysql> use dualshield;

mysql> stop slave;


Take a snapshot of the database on

...

Server1

Open an elevated command prompt and change directory to C:\Program Files\Deepnet DualShield\mysql\bin

...

Copy the snapshot over to server-2server2

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

Code Block
languagesql
themeEmacs
mysql> reset slave;



Restore the snapshot to

...

Server2

Stop the DualShield Server Service (server-2 only)

...

Import the database you copied over from Server-1Server1.

Open an elevated command prompt and change directory to C:\Program Files\Deepnet DualShield\mysql\bin

...

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

...

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.  Hopefully you will have already obtained the channel names using the show slave status command, as instructed earlier on in this wiki guide.

For example the CHANGE MASTER TO statement here would be.

Code Block
languagesql
themeEmacs
mysql> CHANGE MASTER TO MASTER_LOG_FILE='DAS111.000017', MASTER_LOG_POS=154 FOR CHANNEL 'Server-1';

The final thing to do on server2 is to reset master:

Code Block
languagesql
themeEmacs
mysql> reset master;


Restart Replication between both servers

Start slave on both servers:

Code Block
languagesql
themeEmacs
mysql> stop slave;


Check slave status on both servers:

Code Block
languagesql
themeEmacs
mysql> show slave status\G

 Make sure There are no errors and it is very important to check that Slave_IO and Slave_SQL are both running.

Image Added

If this is the case then you may start the Dualshield Server Service on server2

Image Added

Once Dualshield has fully restarted on the second server, run the show slave status command on both servers, one more time.