Merge lp:~hrvojem/percona-xtrabackup/docfix into lp:percona-xtrabackup/2.0

Proposed by Hrvoje Matijakovic
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 379
Proposed branch: lp:~hrvojem/percona-xtrabackup/docfix
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 452 lines (+163/-94)
8 files modified
doc/source/conf.py (+3/-1)
doc/source/glossary.rst (+4/-4)
doc/source/howtos/recipes_ibkx_inc.rst (+1/-1)
doc/source/howtos/setting_up_replication.rst (+150/-85)
doc/source/howtos/ssh_server.rst (+1/-1)
doc/source/innobackupex/innobackupex_option_reference.rst (+2/-1)
doc/source/innobackupex/preparing_a_backup_ibk.rst (+1/-1)
doc/source/xtrabackup_bin/preparing_the_backup.rst (+1/-0)
To merge this branch: bzr merge lp:~hrvojem/percona-xtrabackup/docfix
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+88670@code.launchpad.net

Description of the change

Fixed some errors that were reporting when building the html docs
Fixed bug #914422

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Hrvoje,

The changes look generally good to me. I just had a number of minor comments/questions:

1. |Percona Toolkit| is defined as a macro for ":term:`Percona Toolkit`", but is not actually used anywhere?

There's also an inconsistency. |XtraBackup| and |Percona Server| are defined as just emphasized text rather than terms. Shouldn't |Percona Toolkit| be defined in the same way?

2. s/reffer/refer/g ?

3. Please keep "innobackupex" in examples and not replace it with "innobackupex-1.5.1", as the latter is an old name, it's currently just a symlink to innobackupex.

4. Any specific reasons for removing streaming backups from the replication setup guidelines? It's not like it's wrong, I'm just curious.

5. I'm not sure "mv /path/to/mysql/TIMESTAMP /path/to/mysql/datadir" will do the right thing. I think it will move all files to a subdirectory of datadir, which is not what we really want to do?

6. Shouldn't we make it clear somehow that TIMESTAMP in examples should not be typed literally, but replaced with the actual directory name?

7. s/slights variation/slight variations/ ? (I know it's not your text, but might be a good idea to fix spelling once you are touching that line)

8. s/previuos/previous/

9. Please don't reuse branches for different MPs. As a result, this MP now contains fixes for both bug #878457 and bug #914422. Which makes it harder to manage and review.

review: Needs Fixing
Revision history for this message
Hrvoje Matijakovic (hrvojem) wrote :

On 16.01.2012 14:35, Alexey Kopytov wrote:
> Review: Needs Fixing
>
> Hrvoje,
>
> The changes look generally good to me. I just had a number of minor comments/questions:
>
> 1. |Percona Toolkit| is defined as a macro for ":term:`Percona Toolkit`", but is not actually used anywhere?
>
> There's also an inconsistency. |XtraBackup| and |Percona Server| are defined as just emphasized text rather than terms. Shouldn't |Percona Toolkit| be defined in the same way?
>
fixed
> 2. s/reffer/refer/g ?
fixed
>
> 3. Please keep "innobackupex" in examples and not replace it with "innobackupex-1.5.1", as the latter is an old name, it's currently just a symlink to innobackupex.
fixed
>
> 4. Any specific reasons for removing streaming backups from the replication setup guidelines? It's not like it's wrong, I'm just curious.
>
No special reason. I somehow figured out this was more simple solution.
But I can make another one with streaming or put it back as it was.

> 5. I'm not sure "mv /path/to/mysql/TIMESTAMP /path/to/mysql/datadir" will do the right thing. I think it will move all files to a subdirectory of datadir, which is not what we really want to do?

root@arrakis:/# mv /tmp/2012-01-16_11-14-43 /tmp/test/mysql
root@arrakis:/# ls -lah /tmp/test/mysql
total 31M
drwxr-xr-x 6 root root 4,0K Sij 16 11:19 .
drwxr-xr-x 3 root root 4,0K Sij 16 14:41 ..
-rw-r--r-- 1 root root 324 Sij 16 11:14 backup-my.cnf
drwxr-xr-x 2 root root 4,0K Sij 16 11:15 cacti
-rw-r--r-- 1 root root 18M Sij 16 11:19 ibdata1
-rw-r--r-- 1 root root 5,0M Sij 16 11:19 ib_logfile0
-rw-r--r-- 1 root root 5,0M Sij 16 11:19 ib_logfile1

>
> 6. Shouldn't we make it clear somehow that TIMESTAMP in examples should not be typed literally, but replaced with the actual directory name?

I've changed it to $TIMESTAMP and added the short note: You need to
select path where your snapshot has been taken, for example
/home/backups/2012-01-16_11-14-43

>
> 7. s/slights variation/slight variations/ ? (I know it's not your text, but might be a good idea to fix spelling once you are touching that line)
fixed
>
> 8. s/previuos/previous/
fixed
>
> 9. Please don't reuse branches for different MPs. As a result, this MP now contains fixes for both bug #878457 and bug #914422. Which makes it harder to manage and review.
yeah sorry about that one.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Looks good now.

review: Approve
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Changing to In Progress to take additional notes in bug #914422 into account.

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote :

OK to merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/source/conf.py'
--- doc/source/conf.py 2011-09-24 04:42:37 +0000
+++ doc/source/conf.py 2012-01-17 09:06:25 +0000
@@ -44,7 +44,7 @@
4444
45# General information about the project.45# General information about the project.
46project = u'Percona XtraBackup'46project = u'Percona XtraBackup'
47copyright = u'2011, Percona Inc'47copyright = u'2012, Percona Inc'
4848
49# The version info for the project you're documenting, acts as replacement for49# The version info for the project you're documenting, acts as replacement for
50# |version| and |release|, also used in various other places throughout the50# |version| and |release|, also used in various other places throughout the
@@ -100,6 +100,8 @@
100100
101.. |MyISAM| replace:: :term:`MyISAM`101.. |MyISAM| replace:: :term:`MyISAM`
102102
103.. |Percona Toolkit| replace:: *Percona Toolkit*
104
103.. |LSN| replace:: :term:`LSN`105.. |LSN| replace:: :term:`LSN`
104106
105.. |XtraBackup| replace:: *XtraBackup*107.. |XtraBackup| replace:: *XtraBackup*
106108
=== modified file 'doc/source/glossary.rst'
--- doc/source/glossary.rst 2011-07-07 05:32:50 +0000
+++ doc/source/glossary.rst 2012-01-17 09:06:25 +0000
@@ -18,7 +18,7 @@
18 or start the server with ``--innodb_file_per_table``.18 or start the server with ``--innodb_file_per_table``.
1919
20 innodb_expand_import20 innodb_expand_import
21 This feature of |Percona Server| implements the abililty to import arbitrary :term:`.ibd` files exported using the |XtraBackup| :option:`--export` option.21 This feature of |Percona Server| implements the ability to import arbitrary :term:`.ibd` files exported using the |XtraBackup| :option:`--export` option.
22 22
23 See the `the full documentation <http://www.percona.com/docs/wiki/percona-server:features:innodb_import_table_from_xtrabackup?redirect=2>`_ for more information.23 See the `the full documentation <http://www.percona.com/docs/wiki/percona-server:features:innodb_import_table_from_xtrabackup?redirect=2>`_ for more information.
2424
@@ -55,7 +55,7 @@
55 innodb_buffer_pool_size=8MB55 innodb_buffer_pool_size=8MB
5656
57 InnoDB57 InnoDB
58 Storage engine which provides ACID-compilant transactions and foreing key support, among others improvements over :term:`MyISAM`. It is the default engine for |MySQL| as of the 5.5 series.58 Storage engine which provides ACID-compliant transactions and foreign key support, among others improvements over :term:`MyISAM`. It is the default engine for |MySQL| as of the 5.5 series.
5959
60 MyISAM60 MyISAM
61 Previous default storage engine for |MySQL| for versions prior to 5.5. It doesn't fully support transactions but in some scenarios may be faster than :term:`InnoDB`. Each table is stored on disk in 3 files: :term:`.frm`, :term:`.MYD`, :term:`.MYI`61 Previous default storage engine for |MySQL| for versions prior to 5.5. It doesn't fully support transactions but in some scenarios may be faster than :term:`InnoDB`. Each table is stored on disk in 3 files: :term:`.frm`, :term:`.MYD`, :term:`.MYI`
@@ -91,10 +91,10 @@
91 Each table using the :program:`MERGE` storage engine, besides of a :term:`.frm` file, will have :term:`.MRG` file containing the names of the |MyISAM| tables associated with it.91 Each table using the :program:`MERGE` storage engine, besides of a :term:`.frm` file, will have :term:`.MRG` file containing the names of the |MyISAM| tables associated with it.
9292
93 .TRG93 .TRG
94 File containing the TRiGgers associated to a table, e.g. `:file:`mytable.TRG`. With the :term:`.TRN` file, they represent all the Trigger definitions.94 File containing the Triggers associated to a table, e.g. `:file:`mytable.TRG`. With the :term:`.TRN` file, they represent all the Trigger definitions.
9595
96 .TRN96 .TRN
97 File containing the TRiggers' Names associated to a table, e.g. `:file:`mytable.TRN`. With the :term:`.TRG` file, they represent all the Trigger definitions.97 File containing the Triggers' Names associated to a table, e.g. `:file:`mytable.TRN`. With the :term:`.TRG` file, they represent all the Trigger definitions.
9898
99 .ARM99 .ARM
100 Each table with the :program:`Archive Storage Engine` has ``.ARM`` file which contains the metadata of it.100 Each table with the :program:`Archive Storage Engine` has ``.ARM`` file which contains the metadata of it.
101101
=== modified file 'doc/source/howtos/recipes_ibkx_inc.rst'
--- doc/source/howtos/recipes_ibkx_inc.rst 2011-07-07 05:32:50 +0000
+++ doc/source/howtos/recipes_ibkx_inc.rst 2012-01-17 09:06:25 +0000
@@ -38,7 +38,7 @@
3838
39*The final data will be in the base backup directory*, not in the incremental one. In this example, ``/path/to/backup/dir/2011-12-24_23-01-00`` or ``$FULLBACKUP``.39*The final data will be in the base backup directory*, not in the incremental one. In this example, ``/path/to/backup/dir/2011-12-24_23-01-00`` or ``$FULLBACKUP``.
4040
41If you want to apply more incremental backups, repeat this step with the next one. It is important that you do this in the chronological order in where the the backups were done.41If you want to apply more incremental backups, repeat this step with the next one. It is important that you do this in the chronological order in where the backups were done.
4242
43You can check the file xtrabackup_checkpoints at the directory of each one.43You can check the file xtrabackup_checkpoints at the directory of each one.
4444
4545
=== modified file 'doc/source/howtos/setting_up_replication.rst'
--- doc/source/howtos/setting_up_replication.rst 2012-01-04 03:37:24 +0000
+++ doc/source/howtos/setting_up_replication.rst 2012-01-17 09:06:25 +0000
@@ -1,84 +1,140 @@
1.. _replication_howto:1.. _replication_howto:
22
3========================================================================3========================================================================
4 How to setup a slave for replication in 5 simple steps with Xtrabackup4 How to setup a slave for replication in 6 simple steps with Xtrabackup
5========================================================================5========================================================================
66
7 Data is, by far, the most valuable part of a system. Having a backup done systematically and available for a rapid recovery in case of failure is admittedly essential to a system. However, it is not common practice because of its costs, infrastructure needed or even the boredom associated to the task. Xtrabackup is designed to solve this problem.7 Data is, by far, the most valuable part of a system. Having a backup done systematically and available for a rapid recovery in case of failure is admittedly essential to a system. However, it is not common practice because of its costs, infrastructure needed or even the boredom associated to the task. Xtrabackup is designed to solve this problem.
88
9 You can have almost real-time backups in 5 simple steps by setting up a replication environment with |XtraBackup|. 9 You can have almost real-time backups in 6 simple steps by setting up a replication environment with |XtraBackup|.
1010
11 *Percona* |XtraBackup| is a tool for backing up your data extremely easy and without interruption. It performs "hot backups" on unmodified versions of |MySQL| servers (5.0 and 5.1), as well as |MariaDB| and *Percona Servers*. It is a totally free and open source software distributed only under the *GPLv2* license.11 *Percona* |XtraBackup| is a tool for backing up your data extremely easy and without interruption. It performs "hot backups" on unmodified versions of |MySQL| servers (5.0, 5.1 and 5.5), as well as |MariaDB| and *Percona Servers*. It is a totally free and open source software distributed only under the *GPLv2* license.
1212
13All the things you will need13All the things you will need
14============================14============================
1515
16Setting up a slave for replication with |XtraBackup| is really a very straightforward procedure. In order to keep it simple, here is a list of the things you need to follow the steps without hassles:16Setting up a slave for replication with |XtraBackup| is really a very straightforward procedure. In order to keep it simple, here is a list of the things you need to follow the steps without hassles:
1717
18* ``The Master`` 18* ``TheMaster``
19 A system with a |MySQL|-based server installed, configured and running. This system will be called ``The Master``, as it is where your data is stored and the one to be replicated. We will assume the following about this system:19 A system with a |MySQL|-based server installed, configured and running. This system will be called ``TheMaster``, as it is where your data is stored and the one to be replicated. We will assume the following about this system:
2020
21 * the |MySQL| server is able to communicate with others by the standard TCP/IP port;21 * the |MySQL| server is able to communicate with others by the standard TCP/IP port;
2222
23 * the *SSH* server is installed and configured;23 * the *SSH* server is installed and configured;
2424
25 * you have an user account in the system with the appropiate permissions;25 * you have an user account in the system with the appropriate permissions;
2626
27 * you have a MySQL's user account with appropiate privileges.27 * you have a MySQL's user account with appropriate privileges.
2828
2929 * server has binlogs enabled and server-id set up to 1.
30* ``The Slave`` 30
31 Another system, with a |MySQL|-based server installed on it. We will reffer to this machine as ``The Slave`` and we will assume the same things we did about ``The Master``.31
32* ``TheSlave``
33 Another system, with a |MySQL|-based server installed on it. We will refer to this machine as ``TheSlave`` and we will assume the same things we did about ``TheMaster``.
3234
33* ``Xtrabackup``35* ``Xtrabackup``
34 The backup tool we will use. It should be installed in both computers for convenience.36 The backup tool we will use. It should be installed in both computers for convenience.
3537
36STEP 1: Make a backup on ``The Master`` and stream it to ``The Slave``38STEP 1: Make a backup on ``TheMaster`` and prepare it
37======================================================================39=====================================================
3840
39At ``The Master``, issue the following to a shell:41At ``TheMaster``, issue the following to a shell:
4042
41.. code-block:: console43.. code-block:: console
4244
43 TheMaster$ innobackupex --user=yourDBuser --password=MaGiCdB1 \ 45 TheMaster$ innobackupex --user=yourDBuser --password=MaGiCdB1 /path/to/backupdir
44 --stream=tar /tmp/ | \46
45 ssh user@THESLAVE "tar xfi - -C /var/lib/mysql"47After this is finished you should get:
4648
47You have told |XtraBackup| (through the |innobackupex| script) to connect to the database server using your database user and password, and do a hot backup of all your data in it (all |MyISAM|, |InnoDB| tables and indexes in them).49.. code-block:: console
4850
49Instead of writing it to a file, we printed it to ``STDOUT``, so it can be piped - via :command:`ssh` - to :command:`tar` in ``The Slave``, which will extract the files directly to ``The Slave`` 's data directory.51 innobackupex: completed OK!
52
53This will make a copy of your |MySQL| data dir to the /path/to/backupdir/$TIMESTAMP. You have told |XtraBackup| (through the |innobackupex| script) to connect to the database server using your database user and password, and do a hot backup of all your data in it (all |MyISAM|, |InnoDB| tables and indexes in them).
54
55In order for snapshot to be consistent you need to prepare the data:
56
57.. code-block:: console
58
59 TheMaster$ innobackupex --user=yourDBuser --password=MaGiCdB1 /
60 --apply-log /path/to/backupdir/$TIMESTAMP/
61
62You need to select path where your snapshot has been taken, for example /home/backups/2012-01-16_11-14-43. If everything is ok you should get the same OK message. Now the transaction logs are applied to the data files, and new ones are created: your data files are ready to be used by the MySQL server.
5063
51|XtraBackup| knows where your data is by reading your :term:`my.cnf`. If you have your configuration file in a non-standard place, you should use the flag :option:`--defaults-file` ``=/location/of/my.cnf``.64|XtraBackup| knows where your data is by reading your :term:`my.cnf`. If you have your configuration file in a non-standard place, you should use the flag :option:`--defaults-file` ``=/location/of/my.cnf``.
5265
53If, instead of ``--stream=tar /tmp/``, you give a directory to |innobackupex|, then the backup will be kept in ``The Master`` 's filesystem. A subdirectory will be created on the path you gave it and its name will be the current timestamp. You should copy that entire subdirectory to ``The Slave``, for example, with ``scp -r 2011-12-31_23-59-59``.66If you want to skip writing the username/password every time you want to access the MySQL, you can set it up in your $HOME folder. Just edit .my.cnf and add:
5467
55STEP 2: Apply the logs to the data68.. code-block:: console
56==================================69
5770 [client]
58At ``The Slave``, tell |XtraBackup| to apply the binary logs to the data with:71 user=root
5972 pass=MaGiCdB1
60.. code-block:: console73
6174This is will give you root access to MySQL.
62 TheSlave$ innobackupex --apply-log --use-memory=2G /var/lib/mysql75
6376STEP 2: Copy backed up data to TheSlave
64Now the transaction logs are applied to the data files, and new ones are created: your data files are ready to be used by the MySQL server. 77========================================
6578
66The :option:`--use-memory` ``=2G`` option indicates Xtrabackup to use 2 Gigabytes of RAM for the process. Adjust this amount to your situation in order to speed up the task. 79Use rsync or scp to copy the data from Master to Slave. If you're syncing the data directly to slave's data directory it's advised to stop the mysqld there.
6780
68STEP 3: Configure The Slave's MySQL server81.. code-block:: console
82
83 TheMaster$ rsync -avprP -e ssh /path/to/backupdir/$TIMESTAMP TheSlave:/path/to/mysql/
84
85After data has been copied you can back up the original or previously installed |MySQL| datadir:
86
87.. code-block:: console
88
89 TheSlave$ mv /path/to/mysql/datadir /path/to/mysql/datadir_bak
90
91and move the snapshot from ``TheMaster`` in its place:
92
93.. code-block:: console
94
95 TheSlave$ mv /path/to/mysql/$TIMESTAMP /path/to/mysql/datadir
96
97After you copy data over, make sure |MySQL| has proper permissions to access them.
98
99.. code-block:: console
100
101 TheSlave$ chown mysql:mysql /path/to/mysql/datadir
102
103In case the ibdata and iblog files are located in different directories outside of the datadir, you will have to put them in their proper place after the logs have been applied.
104
105STEP 3: Configure The Master's MySQL server
106===========================================
107
108Add the appropriate grant in order for slave to be able to connect to master:
109
110.. code-block:: mysql
111
112 TheMaster|mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'$slaveip'
113 IDENTIFIED BY '$slavepass';
114
115Also make sure that firewall rules are correct and that ``TheSlave`` can connect to ``TheMaster``.
116
117STEP 4: Configure The Slave's MySQL server
69==========================================118==========================================
70119
71First copy the :term:`my.cnf` file from ``The Master`` to ``The Slave``:120First copy the :term:`my.cnf` file from ``TheMaster`` to ``TheSlave``:
72121
73.. code-block:: console122.. code-block:: console
74123
75 TheSlave$ scp user@TheMaster:/etc/mysql/my.cnf /etc/mysql/my.cnf124 TheSlave$ scp user@TheMaster:/etc/mysql/my.cnf /etc/mysql/my.cnf
76125
77and start/restart :command:`mysqld` on ``The Slave``.126then change the following options in /etc/mysql/my.cnf:
78127
79You can do this without problems because you are replicating the "whole server". As it is the first slave that ``The Master`` has, |MySQL| will do the rest automatically.128.. code-block:: console
80129
81STEP 4: Start the replication130 server-id=2
131
132and start/restart :command:`mysqld` on ``TheSlave``.
133
134In case you're using init script to start mysqld, be sure that the password for that user has been updated and it's the same as one on ``TheMaster``. For example, Debian and Ubuntu use debian-sys-maint user to do that. Password can be seen and updated in :file:`/etc/mysql/debian.cnf`.
135
136
137STEP 5: Start the replication
82=============================138=============================
83139
84Look at the content of the file :file:`xtrabackup_binlog_info`, it will be something like:140Look at the content of the file :file:`xtrabackup_binlog_info`, it will be something like:
@@ -86,15 +142,16 @@
86.. code-block:: console142.. code-block:: console
87143
88 TheSlave$ cat /var/lib/mysql/xtrabackup_binlog_info144 TheSlave$ cat /var/lib/mysql/xtrabackup_binlog_info
89 TheMaster-bin.000001 481145 TheMaster-bin.000001 481
90146
91Execute the ``CHANGE MASTER`` statement on a mysql console but remember to add to it your database user and password in ``The Master``:147Execute the ``CHANGE MASTER`` statement on a MySQL console and use the username and password you've set up in STEP 3:
92148
93.. code-block:: mysql149.. code-block:: mysql
94150
95 TheSlave|mysql> CHANGE MASTER TO 151 TheSlave|mysql> CHANGE MASTER TO
96 MASTER_USER='DBuserInTheMaster',152 MASTER_HOST='$masterip',
97 MASTER_PASSWORD='m4g1cM4st3r',153 MASTER_USER='repl',
154 MASTER_PASSWORD='$slavepass',
98 MASTER_LOG_FILE='TheMaster-bin.000001', 155 MASTER_LOG_FILE='TheMaster-bin.000001',
99 MASTER_LOG_POS=481;156 MASTER_LOG_POS=481;
100157
@@ -104,7 +161,7 @@
104161
105 TheSlave|mysql> START SLAVE;162 TheSlave|mysql> START SLAVE;
106163
107STEP 5: Check164STEP 6: Check
108=============165=============
109166
110You should check that everything went OK with:167You should check that everything went OK with:
@@ -119,56 +176,64 @@
119 Seconds_Behind_Master: 13176 Seconds_Behind_Master: 13
120 ...177 ...
121178
122The ``Seconds_Behind_Master`` means the ``SQL`` currently being executed has a ``current_timestamp`` of 13 seconds ago. It is an estimation of the lag between ``The Master`` and ``The Slave``. Note that at the begining, a high value should be shown because ``The Slave`` has to "catch up" with ``The Master``.179Both ``IO`` and ``SQL`` threads need to be running. The ``Seconds_Behind_Master`` means the ``SQL`` currently being executed has a ``current_timestamp`` of 13 seconds ago. It is an estimation of the lag between ``TheMaster`` and ``TheSlave``. Note that at the beginning, a high value could be shown because ``TheSlave`` has to "catch up" with ``TheMaster``.
123180
124Adding more slaves to The Master181Adding more slaves to The Master
125================================182================================
126183
127You can use this procedure with slights variation to add new slaves to a master. We will use |Xtrabackup| to clone an already configured slave. We will continue using the previuos scenario for convenience but we will add ``The NEW Slave`` to the plot.184You can use this procedure with slight variation to add new slaves to a master. We will use |Xtrabackup| to clone an already configured slave. We will continue using the previous scenario for convenience but we will add ``TheNewSlave`` to the plot.
128185
129At ``The Slave``, do a full backup and stream it to ``The New Slave``:186At ``TheSlave``, do a full backup:
130187
131.. code-block:: console188.. code-block:: console
132189
133 TheSlave$ innobackupex --user=yourDBuser --password=MaGiCiGaM \ 190 TheSlave$ innobackupex --user=yourDBuser --password=MaGiCiGaM /
134 --stream=tar /tmp/ --slave-info | \191 --slave-info /path/to/backupdir
135 ssh user@TheNEWSlave "tar xfi - -C /var/lib/mysql"192
136193By using the :option:`--slave-info` Xtrabackup creates additional file called :file:`xtrabackup_slave_info`.
137and apply the logs on ``The NEW Slave``:194
138195Apply the logs:
139.. code-block:: console196
140197.. code-block:: console
141 TheNEWSlave$ innobackupex --apply-log --use-memory=2G /var/lib/mysql198
142199 TheSlave$ innobackupex --apply-log --use-memory=2G /path/to/backupdir/$TIMESTAMP/
143and copy the configuration file from ``The Slave``:200
201Copy the directory from the ``TheSlave`` to ``TheNewSlave``:
202
203.. code-block:: console
204
205 rsync -avprP -e ssh /path/to/backupdir/$TIMESTAMP TheNewSlave:/path/to/mysql/datadir
206
207Add additional grant on the master:
208
209.. code-block:: mysql
210
211 TheMaster|mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'$newslaveip'
212 IDENTIFIED BY '$slavepass';
213
214Copy the configuration file from ``TheSlave``:
144215
145.. code-block:: console216.. code-block:: console
146217
147 TheNEWSlave$ scp user@TheSlave:/etc/mysql/my.cnf /etc/mysql/my.cnf218 TheNEWSlave$ scp user@TheSlave:/etc/mysql/my.cnf /etc/mysql/my.cnf
148219
149Now comes a slight variation on the procedure: before starting the |MySQL| server, set the variable ``server_id`` in :term:`my.cnf` to a value greater than 2, for example, with220Make sure you change the server-id variable in :file:`/etc/mysql/my.cnf` to 3 and disable the replication on start:
150221
151.. code-block:: console222.. code-block:: console
152223
153 TheNEWSlave$ echo '\nSERVER_ID=3' >> /etc/mysql/my.cnf224 skip-slave-start
154225 server-id=3
155This is because on a replication environment with one master and one slave, if the variable is not setted (as default) |MySQL| assumes 1 for ``server_id`` in the master and 2 in the slave. If you don't change it, |MySQL| will assume a value of 2 in ``The New Slave`` again: the replication will fail because all servers involved must have a different ``server_id``.
156226
157After setting ``server_id``, start :command:`mysqld`.227After setting ``server_id``, start :command:`mysqld`.
158228
159As we backed up a slave that was doing a replication, in a :command:`mysql` console tell the server to stop doing it:229Fetch the master_log_file and master_log_pos from the file :file:`xtrabackup_slave_info`, execute the statement for setting up the master and the log file for ``The NEW Slave``:
160
161.. code-block:: mysql
162
163 TheNEWSlave|mysql> STOP SLAVE;
164
165With the help of the file :file:`xtrabackup_slave_info`, execute the statement for setting up the master and the log file for ``The NEW Slave``:
166230
167.. code-block:: mysql231.. code-block:: mysql
168232
169 TheNEWSlave|mysql> CHANGE MASTER TO 233 TheNEWSlave|mysql> CHANGE MASTER TO
170 MASTER_USER='DBuserInTheMaster',234 MASTER_HOST='$masterip'
171 MASTER_PASSWORD='m4g1cM4st3r',235 MASTER_USER='repl',
236 MASTER_PASSWORD='$slavepass',
172 MASTER_LOG_FILE='TheMaster-bin.000001', 237 MASTER_LOG_FILE='TheMaster-bin.000001',
173 MASTER_LOG_POS=481;238 MASTER_LOG_POS=481;
174239
@@ -178,4 +243,4 @@
178243
179 TheSlave|mysql> START SLAVE;244 TheSlave|mysql> START SLAVE;
180245
181and we have a The NEW Slave replicating The Master.246If both IO and SQL threads are running when you check the ``TheNewSlave``, server is replicating ``TheMaster``.
182247
=== modified file 'doc/source/howtos/ssh_server.rst'
--- doc/source/howtos/ssh_server.rst 2011-07-07 05:32:50 +0000
+++ doc/source/howtos/ssh_server.rst 2012-01-17 09:06:25 +0000
@@ -7,7 +7,7 @@
7 ubuntu$ sudo apt-get install openssh-server7 ubuntu$ sudo apt-get install openssh-server
8 archlinux$ sudo pacman -S openssh8 archlinux$ sudo pacman -S openssh
99
10You may need to take a look at your distribution's documentation or search for a tutorial in the internet to configure it if you haven't done it before. 10You may need to take a look at your distribution's documentation or search for a tutorial in the Internet to configure it if you haven't done it before.
1111
12Some links of them are:12Some links of them are:
1313
1414
=== modified file 'doc/source/innobackupex/innobackupex_option_reference.rst'
--- doc/source/innobackupex/innobackupex_option_reference.rst 2011-11-15 14:54:45 +0000
+++ doc/source/innobackupex/innobackupex_option_reference.rst 2012-01-17 09:06:25 +0000
@@ -89,6 +89,7 @@
89.. option:: --no-lock89.. option:: --no-lock
9090
91 Use this option to disable table lock with ``FLUSH TABLES WITH READ LOCK``. Use it only if ALL your tables are InnoDB and you **DO NOT CARE** about the binary log position of the backup.91 Use this option to disable table lock with ``FLUSH TABLES WITH READ LOCK``. Use it only if ALL your tables are InnoDB and you **DO NOT CARE** about the binary log position of the backup.
92 If you are considering to use :option:`--no-lock` because your backups are failing to acquire the lock, this could be because of incoming replication events preventing the lock from succeeding. Please try using :option:`--safe-slave-backup` to momentarily stop the replication slave thread, this may help the backup to succeed and you then don't need to resort to using :option:`--no-lock`.
9293
93.. option:: --ibbackup = 'autodetect'94.. option:: --ibbackup = 'autodetect'
9495
@@ -112,7 +113,7 @@
112113
113.. option:: --extra-lsndir114.. option:: --extra-lsndir
114115
115 This option accepts a string argument that specifies the directory in which to save an extra copy of the :file:`xtrabackup_checkpoints` file. It is passed directly to |xtrabackup| 's :option:`--extra-lsndir` option. See the :program:`xtrabackup` documentation for details.116 This option accepts a string argument that specifies the directory in which to save an extra copy of the :file:`xtrabackup_checkpoints` file. It is passed directly to |xtrabackup|'s :option:`--extra-lsndir` option. See the :program:`xtrabackup` documentation for details.
116117
117.. option:: --remote-host118.. option:: --remote-host
118119
119120
=== modified file 'doc/source/innobackupex/preparing_a_backup_ibk.rst'
--- doc/source/innobackupex/preparing_a_backup_ibk.rst 2011-07-07 05:32:50 +0000
+++ doc/source/innobackupex/preparing_a_backup_ibk.rst 2012-01-17 09:06:25 +0000
@@ -19,7 +19,7 @@
19==============19==============
20reading the configuration from the files in the backup directory,20reading the configuration from the files in the backup directory,
2121
22|innobackupex| replayed the committed transactions in the logfiles (some transactions could have been done while the backup was being done) and rolled back the uncommitted ones. Once this is done, all the information lay in the tablespace (the InnoDB files), and the logfiles are re-created.22|innobackupex| replayed the committed transactions in the log files (some transactions could have been done while the backup was being done) and rolled back the uncommitted ones. Once this is done, all the information lay in the tablespace (the InnoDB files), and the log files are re-created.
2323
24This implied calling :program:`xtrabackup --prepare` twice with the right binary (determined through the :file:`xtrabackup_binary` or by connecting the server). More details of this process are shown in the :doc:`xtrabackup section <../xtrabackup_bin/preparing_the_backup>`.24This implied calling :program:`xtrabackup --prepare` twice with the right binary (determined through the :file:`xtrabackup_binary` or by connecting the server). More details of this process are shown in the :doc:`xtrabackup section <../xtrabackup_bin/preparing_the_backup>`.
2525
2626
=== modified file 'doc/source/xtrabackup_bin/preparing_the_backup.rst'
--- doc/source/xtrabackup_bin/preparing_the_backup.rst 2012-01-03 10:14:48 +0000
+++ doc/source/xtrabackup_bin/preparing_the_backup.rst 2012-01-17 09:06:25 +0000
@@ -36,6 +36,7 @@
36All following prepares (third and following) will not change the already prepared data files, you can only see that output says36All following prepares (third and following) will not change the already prepared data files, you can only see that output says
3737
38.. code-block:: console38.. code-block:: console
39
39 xtrabackup: This target seems to be already prepared.40 xtrabackup: This target seems to be already prepared.
40 xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.41 xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
4142

Subscribers

People subscribed via source and target branches