MySQL Replication

1 to many

Through many years of experience from Marine to pharma environments, I’ve devopeloped a setup for MySQL replications channel to restart replication after a power failure onboard a vessel or any other place where MySQL replication could be used, using the binlog to get the replication channels up and running again, to get the liveView in the shipping headquarter or to collect data from vessels journey – as replication direction is 1 to Many – 1 table onboard the vessel – Many tables in the same database – pr setup.
Since onboard a vessel they often have black ship, a power outtake –  which means that Databases are not closed directly – and having a new binlog file#, but the # prior is not pointing at the new binlog file# – so it’ll stop there untill someone or something says otherwise,
and here its where my scripts are used to: •  Check if the vessel are online (by ping)

• if the vessel is online – get the table name

•  Check the timestamp on the local DB at HQ against the Vessels DB

•  if there’s movement in the binlog – it is online, and trying to get update
• If movement in binlog – wait

• if not – restart the replication channel without a new binlog

• The 3 time no movement in binlog – add +1 to the latest binlog at the HQ and restart the channel with the new binlog
•  If not getting updated after 5 tries – it’ll send a mail to shipping – to have a look on why it will not restart the replication.

This is a way to have a successfully setup with binlog files.