Skip to content

Commit 47479a8

Browse files
author
Bob Grabar
committed
DOCS-308 ongoing edits 2
1 parent 78c1d9a commit 47479a8

File tree

1 file changed

+71
-71
lines changed

1 file changed

+71
-71
lines changed

source/administration/backups.txt

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Backup and Restoration Strategies
77
This document provides an inventory of database backup strategies for
88
use with MongoDB.
99

10-
- The :ref:`backup-overview` and :ref:`backup-considerations` sections
11-
describe the approaches for backing up your MongoDB environment.
10+
- :ref:`backup-overview` and :ref:`backup-considerations` describe the
11+
approaches for backing up your MongoDB environment.
1212

13-
- The :ref:`block-level-backup` or :ref:`database-dumps` sections
14-
describe specific strategies.
13+
- :ref:`block-level-backup` and :ref:`database-dumps` describe specific
14+
strategies.
1515

16-
- The :ref:`backups-with-sharding-and-replication` section describes
17-
considerations specific to :term:`replica sets <replica set>` and
18-
:term:`sharded clusters <sharded cluster>`.
16+
- :ref:`backups-with-sharding-and-replication` describes considerations
17+
specific to :term:`replica sets <replica set>` and :term:`sharded
18+
clusters <sharded cluster>`.
1919

2020
.. _backup-overview:
2121

@@ -29,11 +29,13 @@ up a new or replacement database instance.
2929

3030
With MongoDB, there are two major approaches to backups:
3131

32-
- Using system-level tools, like disk image snapshots. See
33-
:ref:`block-level-backup`.
32+
- Using system-level tools, like disk image snapshots.
3433

35-
- Using various capacities present in the :program:`mongodump` tool. See
36-
:ref:`database-dumps`.
34+
See :ref:`block-level-backup`.
35+
36+
- Using various capacities present in the :program:`mongodump` tool.
37+
38+
See :ref:`database-dumps`.
3739

3840
The methods described in this document operate by copying the data file
3941
on the disk level. If your system does not provide functionality for
@@ -149,8 +151,8 @@ Snapshots have the following limitations:
149151

150152
.. _backup-with-journaling:
151153

152-
With Journaling
153-
~~~~~~~~~~~~~~~
154+
Backup With Journaling
155+
~~~~~~~~~~~~~~~~~~~~~~
154156

155157
If your system has snapshot capability and your :program:`mongod` instance
156158
has journaling enabled, then you can use any kind of file system or
@@ -164,7 +166,7 @@ volume/block level snapshot tool to create backups.
164166
MongoDB.
165167

166168
To enable journaling on all other builds, specify
167-
":setting:`journal` = ``true`` in the configuration or use the
169+
:setting:`journal` = ``true`` in the configuration or use the
168170
:option:`--journal <mongod --journal>` run-time option for
169171
:program:`mongod`.
170172

@@ -177,12 +179,11 @@ LVM-based setups *within* a cloud/virtualized environment.
177179
.. note::
178180

179181
Running :term:`LVM` provides additional flexibility and enables the
180-
possibility of using snapshots to backup MongoDB.
182+
possibility of using snapshots to back up MongoDB.
181183

182-
If you use Amazon's EBS service in a software RAID 10 (e.g. 1+0)
183-
configuration, use :term:`LVM` to capture a consistent disk image.
184-
185-
Also consider, :ref:`backup-amazon-software-raid`.
184+
If you use Amazon's EBS service in a software RAID 10 configuration, use
185+
:term:`LVM` to capture a consistent disk image. Also, see the special
186+
considerations described in :ref:`backup-amazon-software-raid`.
186187

187188
The following sections provide an overview of a simple backup process
188189
using :term:`LVM` on a Linux system. While the tools, commands, and paths may
@@ -313,8 +314,12 @@ Remote Backup Storage
313314
`````````````````````
314315

315316
You can implement off-system backups using the :ref:`combined process
316-
<backup-restore-from-snapshot>` and SSH. Consider the following
317-
procedure:
317+
<backup-restore-from-snapshot>` and SSH.
318+
319+
This sequence is identical to procedures explained above, except that it
320+
archives and compresses the backup on a remote system using SSH.
321+
322+
Consider the following procedure:
318323

319324
.. code-block:: sh
320325

@@ -324,51 +329,48 @@ procedure:
324329
ssh [email protected] tar -xzf /opt/backup/mdb-snap01.tar.gz | dd of=/dev/vg0/mdb-new
325330
mount /dev/vg0/mdb-new /srv/mongodb
326331

327-
This sequence is identical to procedures explained above, except that
328-
it archives and compresses the backup on a remote system using SSH.
329-
330332
.. _backup-without-journaling:
331333

332-
Without Journaling
333-
~~~~~~~~~~~~~~~~~~
334+
Backup Without Journaling
335+
~~~~~~~~~~~~~~~~~~~~~~~~~
334336

335337
If your :program:`mongod` instance does not run with journaling
336338
enabled, or if your journal is on a separate volume, obtaining a
337-
functional backup of a consistent state is more complicated. Flush all
339+
functional backup of a consistent state is more complicated. As described in this section, you must flush all
338340
writes to disk and lock the database to prevent writes during the
339-
backup process. If you have a :term:`replica set` configuration, use a
341+
backup process. If you have a :term:`replica set` configuration, then for your backup, use a
340342
:term:`secondary` that is not receiving reads (i.e. :term:`hidden
341-
member`) for backup purposes.
343+
member`).
342344

343-
You can flush writes to disk, and "lock" the database to prevent
344-
further writes with the :method:`db.fsyncLock()` command in the
345-
:program:`mongo` shell, as follows:
345+
1. To flush writes to disk and to "lock" the database (to prevent
346+
further writes), issue the :method:`db.fsyncLock()` method in the
347+
:program:`mongo` shell:
346348

347-
.. code-block:: javascript
349+
.. code-block:: javascript
348350

349-
db.fsyncLock();
351+
db.fsyncLock();
350352

351-
Perform the :ref:`backup operation described above
352-
<lvm-backup-operation>` at this point. To unlock the database after
353-
the snapshot has completed, use the following command in the
354-
:program:`mongo` shell:
353+
#. Perform the backup operation described in :ref:`lvm-backup-operation`.
355354

356-
.. code-block:: javascript
355+
#. To unlock the database after the snapshot has completed, use the
356+
following command in the :program:`mongo` shell:
357357

358-
db.fsyncUnlock();
358+
.. code-block:: javascript
359359

360-
.. note::
360+
db.fsyncUnlock();
361361

362-
Version 1.9.0 added :method:`db.fsyncLock()` and
363-
:method:`db.fsyncUnlock()` helpers to the :program:`mongo` shell.
364-
Prior to this version, use the following commands:
362+
.. note::
365363

366-
.. code-block:: javascript
364+
Version 1.9.0 added :method:`db.fsyncLock()` and
365+
:method:`db.fsyncUnlock()` helpers to the :program:`mongo` shell.
366+
Prior to this version, use the following commands:
367+
368+
.. code-block:: javascript
367369

368-
db.runCommand( { fsync: 1, lock: true } );
369-
db.runCommand( { fsync: 1, lock: false } );
370+
db.runCommand( { fsync: 1, lock: true } );
371+
db.runCommand( { fsync: 1, lock: false } );
370372

371-
.. include:: /includes/note-disable-profiling-fsynclock.rst
373+
.. include:: /includes/note-disable-profiling-fsynclock.rst
372374

373375
.. _backup-amazon-software-raid:
374376

@@ -383,24 +385,23 @@ tool. As a result you may:
383385
- Flush all writes to disk and create a write lock to ensure
384386
consistent state during the backup process.
385387

386-
If you choose this option see the section on ":ref:`Backup without
387-
Journaling <backup-without-journaling>`"
388+
If you choose this option see :ref:`backup-without-journaling`.
388389

389390
- Configure LVM to run and hold your MongoDB data files on top of the
390391
RAID within your system.
391392

392-
If you choose this option see the section that outlines the
393-
":ref:`LVM backup operation <lvm-backup-operation>`"
393+
If you choose this option, perform the LVM backup operation described
394+
in :ref:`lvm-backup-operation`.
394395

395396
.. _database-dumps:
396397

397398
Using Binary Database Dumps for Backups
398399
---------------------------------------
399400

400401
This section describes the process for writing the entire contents of
401-
your MongoDB instance to a file in a binary format. This command
402-
provides the best option for full system database backups if
403-
disk-level snapshots are not available.
402+
your MongoDB instance to a file in a binary format. If
403+
disk-level snapshots are not available, this approach
404+
provides the best option for full system database backups.
404405

405406
.. seealso::
406407

@@ -415,15 +416,14 @@ disk-level snapshots are not available.
415416
Database Dump with :program:`mongodump`
416417
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
417418

418-
The :program:`mongodump` utility performs a live backup the data, or
419+
The :program:`mongodump` utility can perform a live backup of data or
419420
can work against an inactive set of database
420421
files. The :program:`mongodump` utility can create a dump for an entire
421-
server/database/collection (or part of a collection using of query,)
422+
server/database/collection (or part of a collection using of query),
422423
even when the database is running and active. If you run
423-
:program:`mongodump` without any arguments the command will connect to
424+
:program:`mongodump` without any arguments, the command will connect to
424425
the local database instance (e.g. ``127.0.0.1`` or ``localhost``) and
425-
create a database backup in in the current directory named
426-
``dump/``.
426+
create a database backup named ``dump/`` and place it in the current directory.
427427

428428
.. include:: /includes/note-mongodump-compatibility-2.2.rst
429429

@@ -438,11 +438,11 @@ database dump. For example:
438438
This command creates a dump in of the database in the ``dump/``
439439
directory of only the collection named ``collection`` in the
440440
database named ``test``. :program:`mongodump` provides the
441-
":option:`--oplog <mongodump --oplog>`" option that forces the dump
441+
:option:`--oplog <mongodump --oplog>` option that forces the dump
442442
operation to use the operation log to take a point-in-time snapshot of
443443
the database.
444444

445-
With ":option:`--oplog <mongodump --oplog>`" , :program:`mongodump`
445+
With :option:`--oplog <mongodump --oplog>`, :program:`mongodump`
446446
copies all the data from the source database, as well as all of the
447447
:term:`oplog` entries from the beginning of the backup procedure to
448448
until the backup procedure completes. This backup procedure, in
@@ -451,7 +451,7 @@ restore a backup that reflects a consistent and specific moment in
451451
time.
452452

453453
If your MongoDB instance is not running, you can use the
454-
":option:`--dbpath <mongodump --dbpath>`" option to specify the
454+
:option:`--dbpath <mongodump --dbpath>` option to specify the
455455
location to your MongoDB instance's database files. :program:`mongodump`
456456
reads from the data files directly with this operation. This
457457
locks the data directory to prevent conflicting writes. The
@@ -463,8 +463,8 @@ configuration. Consider the following example:
463463

464464
mongodump --dbpath /srv/mongodb
465465

466-
Additionally, the ":option:`--host <mongodump --host>`" and
467-
":option:`--port <mongodump --port>`" options allow you to specify a
466+
Additionally, the :option:`--host <mongodump --host>` and
467+
:option:`--port <mongodump --port>` options allow you to specify a
468468
non-local host to connect to capture the dump. Consider the following
469469
example:
470470

@@ -490,7 +490,7 @@ the ``dump-2011-10-25`` directory to the :program:`mongod` instance
490490
running on the localhost interface. By default, :program:`mongorestore`
491491
will look for a database dump in the ``dump/`` directory and restore
492492
that. If you wish to restore to a non-default host, the
493-
":option:`--host <mongorestore --host>`" and ":option:`--port <mongorestore --port>`"
493+
:option:`--host <mongorestore --host>` and :option:`--port <mongorestore --port>`
494494
options allow you to specify a non-local host to connect to capture
495495
the dump. Consider the following example:
496496

@@ -536,14 +536,14 @@ interacting with your shell environment.
536536
Here, :program:`mongorestore` restores the database dump located in
537537
``dump/`` folder into the data files located at ``/srv/mongodb``, with
538538
the :option:`--dbpath <mongorestore --dbpath>` option. Additionally,
539-
the ":option:`--journal <mongorestore --journal>`" option ensures that
539+
the :option:`--journal <mongorestore --journal>` option ensures that
540540
:program:`mongorestore` records all operation in the durability
541541
:term:`journal`. The journal prevents data file corruption if anything
542542
(e.g. power failure, disk failure, etc.) interrupts the restore
543543
operation.
544544

545-
.. seealso:: ":doc:`/reference/mongodump`" and
546-
":doc:`/reference/mongorestore`."
545+
.. seealso:: :doc:`/reference/mongodump` and
546+
:doc:`/reference/mongorestore`.
547547

548548
.. _backups-with-sharding-and-replication:
549549

@@ -653,8 +653,8 @@ following sequence:
653653
.. note::
654654

655655
In this situation :program:`mongodump` will read from
656-
:term:`secondary` nodes. See: ":ref:`mongodump feature
657-
<mongodump-behavior>`" for more information.
656+
:term:`secondary` nodes. See: :ref:`mongodump feature
657+
<mongodump-behavior>` for more information.
658658

659659
2. Record a backup of all shards
660660

0 commit comments

Comments
 (0)