SQL replication periodically failing

Hi,

I am working on a fully redundant Ignition and MySQL system, but it seems to fail if one of the servers is turned off too long.

Both machines have:
Windows 7 Pro
Ignition 7.8.2
MySQL 5.7.12 Community Server

I have Ignition installed with redundancy working, but turn off the Ignition service while setting up the SQL replication.

I have MySQL installed on both servers with master-master replication setup according to this:

http://www.ryadel.com/en/mysql-master-master-replication-setup-in-5-easy-steps/

I confirmed that replication is running then I start the Master Ignition service, then the backup Ignition service.

It seems to fail if one of the computers is off for too long.

Has anyone setup redundant SQL DBs with Ignition running on the same two machines?

Hello

When you say it fails when one of the computers is off for too long, which computer are you talking about? The master ignition server, the redundant ignition server, or earth of the db servers? And how is it failing?

Hi David,

I was having trouble with one of the computers going to sleep, and the results from running SHOW SLAVE STATUS would contain “Slave_SQL_Running: No”:

I changed the server setup so that they no longer sleep, and I shut down the secondary for about an hour on Friday. Did not see any problems with it when it started back up.

I left the primary server off over the weekend and I just started it back up. The replication seems to start back up, but it did not get all the items so now the history for my primary has a huge missing chunk.

I say that the replication is running based on the results of running SHOW SLAVE STATUS containing “Slave_IO_Running: Yes, Slave_SQL_Running: Yes”

Just looked at it again. It appears that the replication finally caught up with the weekend backlog from having one of the servers off.

I think this is working now.

Hello Caleb,

I’m having the same issue with MySQL replication. The architecture I’m using includes two Ignition servers, set one as master and the other as backup. Each server is running a MySQL service, and the replication was configured as Master-Master, which means the active node will replicate every database’s change on the inactive node.

When both are running, the Active node replicates just fine on the other server. If the master falls down, the backup goes active and the replication keeps going fine most of the times. But sometimes I’ve got the status in the MySQL slave, “Slave_IO_Running: Yes, Slave_SQL_Running: No”, and still haven’t found the reason of why this is happening.

The system are both:
Windows Server 2012
Ignition 7.8.2
MySQL 5.7

The redundancy is working with the History Mode set as Full, and Stand by Activity Level Cold

If you found a solution for this situation, I’ll really appreciate your help.

Thanks and kind regards.

Carlos,

We finally changed which of our DB connections was pointed at which server and it seemed to do better.

So we have 4 DB connections on each Ignition server:

History
Auth
Audit
Alarms Journal

We set up the first two to go to “localhost” that is which ever server the ignition GW is setup on.

The other two we changed to go only to the master server by IP address. Those two seemed to be causing problems with the replication if both Master and Slave SQL DBs changed. No data should be lost because store and forward would catch the data.

For setting up the SQL replication we used most of the settings from:

ryadel.com/en/mysql-master-m … asy-steps/

but we added a line:
replicate-ignore-table=lcwtp_history.sqlth_sce

We didn’t test it as thoroughly as I would have liked, but it seemed to work fine.

If you decide to use that set up let me know how it goes.