89301

89301



Creating a Data Snapshot Using mysąldump

One way to create a snapshot of the data in an existing master database is to use

the mysąldump tool.

Once the data dump has been completed, you then import this data into the slave before starting the replication process.

To obtain a snapshot of the data using mysąldump:

1.    If you have not already locked the tables on the server to prevent statements that update data from

executing:

Start a session on the server by connecting to it with the command-line Client, and flush all tables

and błock write statements by executing the FLUSH TABLES WITH READ LOCK statement:

ray3ql>FLUSH TABLES WITH READ LOCK;

Remember to use SHOW MASTER STATUS and record the binary log detailsfor use when starting

up the slave. The point in time of your snapshot and the binary log position must match. See

Section 16.1.1.4, “Obtaining the Replication Master Binary Log Coordinates”.

2.    In another session, use mysąldump to create a dump either of all the databases you want to

replicate, or of selected individual databases. For example:

shel l>nysqldump —all-databases —lock-all-tables >dbdump.db

An alternative to using a bare dump, is to use the —master-data option, which automatically

appends the CHANGE MASTER TO statement reąuired on the slave to start the replication process.

shell>itysqldump —all-databases —master-data >dbdump.db

3.    In the Client where you acąuired the read lock, release the lock:

mysql>UNLOCK TABLES;

Alternath/ely, exit the first session to release the read lock.

When choosing databases to include in the dump, remember to filter out databases on each slave that

you do not want to include in the replication process.

Either to copy the dump file to the slave, or use the file from the master when connecting remotely to the slave to import the data.



Wyszukiwarka

Podobne podstrony:
Sienicki, HM3 Utul I Word Study WORD STUDY: Stanu and Affixes Using confcxt clucs is one way to dwco
image020 ł*geothermal resources One way to help avert the impending energy crisis is to use Nat
Suspension Guide1 ★ SETUP GUIDE YAMAHA RB ★ There s only one way to ride an R6 fast - nail it like a
image020 ł*geothermal resources One way to help avert the impending energy crisis is to use Nat
(* The following is one way to solve ((A + B) x C) + (A - (D x C) + B). This example shows how the a
help1 3 Too much tension on the llne will break It. One way to remedy thls Is to reduce the drag, wh
guy0001 Write the correct form of the verb in brackets to complete the sentences. Use one of these&n
Crochet Borders00 #118STrrCHES & NOTES Notę: Using only words to describe the placement of the h
- 3 - Another feature of th© "Austrian way" was th© use of incomes policy in order to prev
Cartoon?kes ?bbie Brown 7 To make his legs. split 250g (8oz) of the brown in half. Roli one half
VPC02 New Virtual Machinę Wizard Options You can create a new virtual machinę or add an existing one
Stanisław Gucma, Maciej Gucma of ship’s position comes down to establishing the position of the wate

więcej podobnych podstron