Hi fellow developers.
As part of integration solutions we often use MySQL with replication and offset indexing.
99% of the time this works fine. Just do not shut down the 2 Servers at the same time without giving them time to settle etc.
Monitoring / generating an alarm for Mysql Replication within ignition is a bit of a problem, let alone the whole re-synchronizing issue.
What i was thinking of doing is having a module for this purpose.
The module will need to meet following requirements / milestones:
- Gateway configuration:
1.1 give the addresses / connection details etc of the two redundant databases.
1.2 Local drive space which is shared across a network (will be used later for restoring replication if it brakes)
- Gateway display wicket on the Status or main page:
2.1 Displays the connection is OK/Valid to both Databases
2.2 Displays Main Parameter / Timeout information for replication (Similar to show slave status \ G)
2.3 Displays Last error
2.4 If an error occurred where the replication is broken Have a Fix Button available for Admin only.
2.5 Fix Button Action (Re-synching the two DB’s):
2.5.1 Get the “show master” Status of the Database that is OK and stop its slave
2.5.2 Backup same database to shared drive location
2.5.3 Restore Database backup to broken Database
2.5.4 Give the Restored Database the correct Masters Log position
2.5.5 Start up the Restored Databases slave
2.5.6 Get Restored Databases Master Position
2.5.7 Give the Masters Database the Slaves Database Master Position
2.5.8 Start up the Master Database slave
- Vision Component to display items like the Gateway wicket, but without the Fix Button
3.1 Also allow a SQLTag to be created to display Alarm Message etc
- Possibly email fault / Gateway log trace etc
Now i know this seems like a lot of work, but i think its doable.
Watch this space as i may have loads of questions coming as i am only starting to get this SDK up and running.
Haven’t programmed that much in java since 2004.
As a start some pointer on where to start would be nice.