Quote:
Originally Posted by catkin
We don't have a MySQL master/slave setup because our network connections are unreliable and I understand the master will freeze if it loses connection with the slave.
|
The master will continue just fine if the slave loses / closes the connection.
Simplistically:
With MySQL replication the Master doesn't actually care what the slaves are doing. The Master just ticks along and writes its binlog, the slave keeps track of how far along the master binlog it is (the file and the file position) and when it connects it says to the master "send me from here" and reads along and updates its knowledge of position. If the connection drops then the slaves knows it's read up to position X/Y and when it re-connects it does the same again.
However, if you have a short binlog retention time on the Master and the connection is lost beyond that time (for example if you only hold 1 day worth of binlog and lose connection for 25 hours) then you've problems.
We have a monitoring script that runs on our slave servers which checks the SQL replication processes are running and also how out of sync the slave is from the master and if it exceeds a threshold it sends a "passive" alert to our Nagios instance.
Quote:
Originally Posted by catkin
So we need some other way to avoid loosing data if the MySQL server crashes.[..]
80% of the data is historical and unchanging.
|
Consider adding a timestamp column to each table called "last_modified", set the default value to CURRENT_TIMESTAMP and set "on update CURRENT_TIMESTAMP" Then you can do a "selective dump" of only the changed items and import that selective dump in to your slave database.