Send to Kindle
Hi guys, today let’s learn about how to have a consistent backup
(snapshot)
First of all, in what situations do we use a snapshot?
1. Lets say that your production server now will have a replica,
how do you do the first load of data in this slave? what was the
master bin log position when you started the backup, during the
backup process, does anyone wrote any query to db?
2. In case you want to implement an incremental backup strategy,
you can take a snapshot once a week and in case you need to
restore you server, you just restore the snapshot and apply the
binary logs.
Then, let’s start.
To grantee this data integrity we will need 2 sessions open on
master, first one to lock all databases, second one to do the
copy
Then, let’s go:
Session 1:
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
You will receive an output like this:
…
[Read more]