Skip to content

Commit 78c1d9a

Browse files
author
Bob Grabar
committed
DOCS-308 ongoing edits
1 parent 8c37184 commit 78c1d9a

File tree

1 file changed

+80
-81
lines changed

1 file changed

+80
-81
lines changed

source/administration/backups.txt

Lines changed: 80 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,57 @@ Backup and Restoration Strategies
55
.. default-domain:: mongodb
66

77
This document provides an inventory of database backup strategies for
8-
use with MongoDB. Use the ":ref:`backup overview <backup-overview>`"
9-
and ":ref:`backup considerations <backup-considerations>`" sections as
10-
you develop the most appropriate strategy for backing up your MongoDB
11-
environment. Then, use the examples from the ":ref:`block level backup
12-
methods <block-level-backup>`" or the ":ref:`backups using mongodump
13-
<database-dumps>`" sections to implement the backup solution that is
14-
best suited to your deployment's needs.
15-
16-
A robust backup strategy and a well-tested corresponding restoration
17-
process is crucial for every production-grade deployment. Take the
18-
specific features of your deployment, your use patterns, and
19-
architecture into consideration as you develop your own backup system.
20-
21-
:term:`Replica sets <replica set>` and :term:`sharded clusters
22-
<sharded cluster>` require special considerations. See
23-
:ref:`backup considerations for sharded clusters and replica sets
24-
<backups-with-sharding-and-replication>`.
8+
use with MongoDB.
9+
10+
- The :ref:`backup-overview` and :ref:`backup-considerations` sections
11+
describe the approaches for backing up your MongoDB environment.
12+
13+
- The :ref:`block-level-backup` or :ref:`database-dumps` sections
14+
describe specific strategies.
15+
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>`.
2519

2620
.. _backup-overview:
2721

28-
Overview
29-
--------
22+
Backup Overview
23+
---------------
3024

31-
If you are familiar with backups systems in the context of database
32-
systems please skip ahead to :ref:`backup considerations <backup-considerations>`.
25+
A robust backup strategy and well tested restoration process are crucial
26+
for production-grade deployments. The goal of a backup strategy is to
27+
produce a full and consistent copy of the data that you can use to bring
28+
up a new or replacement database instance.
3329

3430
With MongoDB, there are two major approaches to backups:
35-
using system-level tools, like disk image snapshots, and using various
36-
capacities present in the :ref:`mongodump tool <database-dumps>`.
37-
The underlying goal of these strategies is to produce a full and consistent
38-
copy of the data that you can use to bring up a new or replacement
39-
database instance.
40-
41-
The methods described in this document operate by copying the data
42-
file on the disk level. If your system does not provide functionality
43-
for this kind of backup, see the section on :ref:`using database dumps
44-
for backups <database-dumps>` for more information.
45-
46-
Ensuring that the state captured by the backup is consistent and
47-
usable is the primary challenge of producing backups of database
48-
systems. Backups that you cannot produce reliably, or restore from
49-
feasibly are worthless.
50-
51-
Because every environment is unique it's important to regularly test
52-
the backups that you capture to ensure that your backup system is
31+
32+
- Using system-level tools, like disk image snapshots. See
33+
:ref:`block-level-backup`.
34+
35+
- Using various capacities present in the :program:`mongodump` tool. See
36+
:ref:`database-dumps`.
37+
38+
The methods described in this document operate by copying the data file
39+
on the disk level. If your system does not provide functionality for
40+
this kind of backup, see the section on :ref:`using database dumps for
41+
backups <database-dumps>` for more information.
42+
43+
Ensuring that the state captured by the backup is consistent and usable
44+
is the primary challenge of producing backups of database systems.
45+
Backups that you cannot produce reliably, or restore from feasibly are
46+
worthless.
47+
48+
As you develop your backup system, take into consideration the specific
49+
features of your deployment, your use patterns, and your architecture.
50+
51+
Because every environment is unique it's important to regularly test the
52+
backups that you capture to ensure that your backup system is
5353
practically, and not just theoretically, functional.
5454

5555
.. _backup-considerations:
5656

57-
Production Considerations
58-
-------------------------
57+
Production Considerations for Backup Strategies
58+
-----------------------------------------------
5959

6060
When evaluating a backup strategy for your node consider the following
6161
factors:
@@ -97,23 +97,23 @@ for your database. Remember that all backup plans must be:
9797

9898
.. _block-level-backup:
9999

100-
Block Level Methods
101-
-------------------
100+
Using Block Level Backup Methods
101+
--------------------------------
102102

103-
This section will provides an overview of using disk/block level
103+
This section provides an overview of using disk/block level
104104
snapshots (i.e. :term:`LVM` or storage appliance) to backup a MongoDB
105105
instance. These tools make a quick block-level backup of the device
106106
that holds MongoDB's data files. These methods complete quickly, work
107107
reliably, and typically provide the easiest backup systems method to
108108
implement.
109109

110110
Snapshots work by creating pointers between the live data and a
111-
special snapshot volume: these pointers are theoretically equivalent
112-
to "hard links." Then, as the working data diverges from the snapshot,
111+
special snapshot volume. These pointers are theoretically equivalent
112+
to "hard links." As the working data diverges from the snapshot,
113113
the snapshot process uses a copy-on-write strategy. As a result the snapshot
114114
only stores modified data.
115115

116-
After making the snapshot, you will mount the snapshot image on your
116+
After making the snapshot, you mount the snapshot image on your
117117
file system and copy data from the snapshot. The resulting backup
118118
contains a full copy of all data.
119119

@@ -129,8 +129,8 @@ Snapshots have the following limitations:
129129
backup occurs, the data files will reflect an inconsistent
130130
state. With :term:`journaling <journal>` all data-file states
131131
resulting from in-progress writes are recoverable; without
132-
journaling you must flush all pending writes and to disk before
133-
running the backup operation and ensure that no writes occur during
132+
journaling you must flush all pending writes to disk before
133+
running the backup operation and must ensure that no writes occur during
134134
the entire backup procedure.
135135

136136
If you do use journaling, the journal must reside on the same volume
@@ -153,7 +153,7 @@ With Journaling
153153
~~~~~~~~~~~~~~~
154154

155155
If your system has snapshot capability and your :program:`mongod` instance
156-
has journaling enabled then you can use any kind of file system or
156+
has journaling enabled, then you can use any kind of file system or
157157
volume/block level snapshot tool to create backups.
158158

159159
.. warning::
@@ -182,7 +182,7 @@ LVM-based setups *within* a cloud/virtualized environment.
182182
If you use Amazon's EBS service in a software RAID 10 (e.g. 1+0)
183183
configuration, use :term:`LVM` to capture a consistent disk image.
184184

185-
Also consider, :ref:`backup-amazon-software-raid`
185+
Also consider, :ref:`backup-amazon-software-raid`.
186186

187187
The following sections provide an overview of a simple backup process
188188
using :term:`LVM` on a Linux system. While the tools, commands, and paths may
@@ -194,7 +194,7 @@ high level overview of the backup operation.
194194
Create Snapshot
195195
```````````````
196196

197-
To create a snapshot with :term:`LVM` issue a command, as root, in the
197+
To create a snapshot with :term:`LVM`, issue a command, as root, in the
198198
following format:
199199

200200
.. code-block:: sh
@@ -239,7 +239,7 @@ Archive Snapshots
239239
`````````````````
240240

241241
After creating a snapshot, mount the snapshot and move the data to
242-
separate storage. Your system may wish to compress the backup images as
242+
separate storage. Your system might try to compress the backup images as
243243
you move the offline. Consider the following procedure to fully
244244
archive the data from the snapshot:
245245

@@ -248,19 +248,19 @@ archive the data from the snapshot:
248248
umount /dev/vg0/mdb-snap01
249249
dd if=/dev/vg0/mdb-snap01 | tar -czf mdb-snap01.tar.gz
250250

251-
This command sequence:
251+
The above command sequence:
252252

253-
1. Ensures that the ``/dev/vg0/mdb-snap01`` device is not mounted.
253+
- Ensures that the ``/dev/vg0/mdb-snap01`` device is not mounted.
254254

255-
2. Does a block level copy of the entire snapshot image using the
256-
``dd`` command, and compresses the result in a gziped tar archive
257-
in the current working directory.
255+
- Does a block level copy of the entire snapshot image using the ``dd``
256+
command, and compresses the result in a gziped tar archive in the
257+
current working directory.
258258

259-
.. warning::
259+
.. warning::
260260

261-
This command will create a large ``tar.gz`` file in your current
262-
working directory. Make sure that you run this command in a
263-
file system that has enough free space.
261+
This command will create a large ``tar.gz`` file in your current
262+
working directory. Make sure that you run this command in a file
263+
system that has enough free space.
264264

265265
Restore Snapshot
266266
````````````````
@@ -274,34 +274,33 @@ procedure:
274274
tar -xzf mdb-snap01.tar.gz | dd of=/dev/vg0/mdb-new
275275
mount /dev/vg0/mdb-new /srv/mongodb
276276

277-
This sequence:
277+
The above sequence:
278278

279-
1. Creates a new logical volume named ``mdb-new``, in the
280-
``/dev/vg0`` volume group. The path to the new device will be
281-
``/dev/vg0/mdb-new``.
279+
- Creates a new logical volume named ``mdb-new``, in the ``/dev/vg0``
280+
volume group. The path to the new device will be ``/dev/vg0/mdb-new``.
282281

283-
.. warning::
282+
.. warning::
284283

285-
This volume will have a maximum size of 1 gigabyte. The original
286-
file system must have had a total size of 1 gigabyte or smaller,
287-
or else the restoration will fail.
284+
This volume will have a maximum size of 1 gigabyte. The original
285+
file system must have had a total size of 1 gigabyte or smaller, or
286+
else the restoration will fail.
288287

289-
Change ``1G`` to your desired volume size.
288+
Change ``1G`` to your desired volume size.
290289

291-
2. Uncompresses and unarchives the ``mdb-snap01.tar.gz`` into the
292-
``mdb-new`` disk image.
290+
- Uncompresses and unarchives the ``mdb-snap01.tar.gz`` into the
291+
``mdb-new`` disk image.
293292

294-
3. Mounts the ``mdb-new`` disk image to the ``/srv/mongodb``
295-
directory. Modify the mount point to correspond to your MongoDB
296-
data file location, or other location as needed.
293+
- Mounts the ``mdb-new`` disk image to the ``/srv/mongodb`` directory.
294+
Modify the mount point to correspond to your MongoDB data file
295+
location, or other location as needed.
297296

298297
.. _backup-restore-from-snapshot:
299298

300299
Restore Directly from a Snapshot
301300
````````````````````````````````
302301

303-
To combine the above processes without writing to a compressed ``tar``
304-
archive, use the following sequence:
302+
To restore a backup without writing to a compressed ``tar`` archive, use
303+
the following sequence:
305304

306305
.. code-block:: sh
307306

@@ -395,11 +394,11 @@ tool. As a result you may:
395394

396395
.. _database-dumps:
397396

398-
Binary Dump/Restore Formats
399-
----------------------------
397+
Using Binary Database Dumps for Backups
398+
---------------------------------------
400399

401400
This section describes the process for writing the entire contents of
402-
your MongoDB instance, to a file in a binary format. This command
401+
your MongoDB instance to a file in a binary format. This command
403402
provides the best option for full system database backups if
404403
disk-level snapshots are not available.
405404

0 commit comments

Comments
 (0)