~longbow/percona-xtrabackup/fix664986

« back to all changes in this revision

Viewing changes to doc/source/xtrabackup_bin/working_with_binary_logs.rst

  • Committer: Alexey Kopytov
  • Date: 2011-07-19 07:15:08 UTC
  • mfrom: (290.2.1 staging)
  • Revision ID: akopytov@gmail.com-20110719071508-lxkx7tgghohnevkn
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Working with Binary Logs
 
2
========================
 
3
 
 
4
The ``xtrabackup`` binary integrates with information that |InnoDB| stores in its transaction log about the corresponding binary log position for committed transactions. This enables it to print out the binary log position to which a backup corresponds, so you can use it to set up new replication slaves or perform point-in-time recovery.
 
5
 
 
6
Finding the Binary Log Position
 
7
-------------------------------
 
8
 
 
9
You can find the binary log position corresponding to a backup performing the ``--prepare`` process. If your backup is from a server with binary logging enabled, ``xtrabackup`` will create a file named ``xtrabackup_binlog_pos_innodb`` in the target directory. This file contains the binary log file name and position of the exact point in the binary log to which the prepared backup corresponds.
 
10
 
 
11
You will also see output similar to the following during the prepare stage: ::
 
12
 
 
13
  InnoDB: Last MySQL binlog file position 0 3252710, file name ./mysql-bin.000001
 
14
  ... snip ...
 
15
  [notice (again)]
 
16
    If you use binary log and don't use any hack of group commit, 
 
17
    the binary log position seems to be:
 
18
  InnoDB: Last MySQL binlog file position 0 3252710, file name ./mysql-bin.000001
 
19
 
 
20
The output should contain the same file name and position as the ``xtrabackup_binlog_pos_innodb`` file. The message about hacking group commit refers to an early implementation of emulated group commit in |Percona Server|.
 
21
 
 
22
Point-In-Time Recovery
 
23
----------------------
 
24
 
 
25
To perform a point-in-time recovery from an ``xtrabackup`` backup, you should prepare and restore the backup, and then replay binary logs from the point shown in the ``xtrabackup_binlog_pos_innodb`` file. 
 
26
 
 
27
A more detailed procedure is found :doc:`here <../innobackupex/pit_recovery_ibk>` (with |innobackupex|).
 
28
 
 
29
 
 
30
Setting Up a New Replication Slave
 
31
----------------------------------
 
32
 
 
33
To set up a new replica, you should prepare the backup, and restore it to the data directory of your new replication slave. Then in your ``CHANGE MASTER TO`` command, use the binary log filename and position shown in the ``xtrabackup_binlog_pos_innodb`` file to start replication.
 
34
 
 
35
A more detailed procedure is found in  :doc:`../howtos/setting_up_replication`.