Skip to content

Commit 4ec7f7f

Browse files
author
Bob Grabar
committed
DOCS-156 edits to block-level/snapshots tutorial
1 parent 96afe7c commit 4ec7f7f

File tree

2 files changed

+98
-83
lines changed

2 files changed

+98
-83
lines changed

source/administration/backups.txt

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=================
2-
Backup Strategies
3-
=================
1+
==================================
2+
Backing Up the MongoDB Environment
3+
==================================
44

55
.. default-domain:: mongodb
66

@@ -13,21 +13,11 @@ cannot effectively restore your database from the backup, then your
1313
backups are useless. You also should automate tests of backup
1414
restoration.
1515

16-
Use one of the following tools for backing up your MongoDB
17-
environment:
16+
This page describes the following:
1817

19-
- Use system-level tools that perform block-level backups (also called
20-
disk-image snapshots).
18+
- :ref:`backup-considerations`
2119

22-
See :doc:`/tutorial/backup-databases-with-filesystem-snapshots`.
23-
24-
- Use the :program:`mongodump` tool.
25-
26-
See :doc:`/tutorial/backup-databases-with-binary-database-dumps`.
27-
28-
In some cases, taking backups is difficult or impossible because of
29-
large data volumes, distributed architectures, and data transmission
30-
speeds. In these situations, increase the amount of replication.
20+
- :ref:`backup-approaches`
3121

3222
.. _backup-considerations:
3323

@@ -115,3 +105,29 @@ the performance of the primary. Replication itself provides some measure
115105
of redundancy. Nevertheless, keeping point-in time backups of your
116106
cluster to provide for disaster recovery and as an additional layer of
117107
protection is crucial.
108+
109+
.. _backup-approaches:
110+
111+
Approaches for Backing Up the MongoDB Environment
112+
-------------------------------------------------
113+
114+
The best option for backing up your MongoDB environment is to use
115+
block-level backups, which provide duplicate images of your device.
116+
Block-level backups, also called snapshots, complete quickly, work
117+
reliably, and typically provide the easiest backup systems to implement.
118+
119+
If block-level backup tools are not available, MongoDB provides the
120+
:program:`mongodump` tool, which performs binary-level backups. The
121+
:program:`mongodump` tool writes the entire contents of your MongoDB
122+
instance to a file in a binary format. If snapshots are not available,
123+
this approach provides the best option for full system database backups.
124+
125+
The following topics provide details and procedures on the two approaches:
126+
127+
- :doc:`/tutorial/backup-databases-with-filesystem-snapshots`.
128+
129+
- :doc:`/tutorial/backup-databases-with-binary-database-dumps`.
130+
131+
In some cases, taking backups is difficult or impossible because of
132+
large data volumes, distributed architectures, and data transmission
133+
speeds. In these situations, increase the amount of replication.

source/tutorial/backup-databases-with-filesystem-snapshots.txt

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ Backup Databases Using Block Level Backup Methods
44

55
.. default-domain:: mongodb
66

7-
This section provides an overview of using disk/block level
8-
snapshots (i.e. :term:`LVM` or storage appliance) to backup a MongoDB
9-
instance. These tools make a quick block-level backup of the device
7+
This section describes how to backup and restore a MongoDB instance
8+
using system-level tools (such as :term:`LVM` or storage appliance) that
9+
create block-level snapshots of the device
1010
that holds MongoDB's data files. These methods complete quickly, work
1111
reliably, and typically provide the easiest backup systems method to
1212
implement.
1313

14+
This page describes the following:
15+
16+
- :ref:`snapshots-overview`
17+
18+
- :ref:`lvm-backup-and-restore`
19+
20+
- :ref:`backup-without-journaling`
21+
22+
.. _snapshots-overview:
23+
24+
Snapshots Overview
25+
------------------
26+
1427
Snapshots work by creating pointers between the live data and a
1528
special snapshot volume. These pointers are theoretically equivalent
1629
to "hard links." As the working data diverges from the snapshot,
@@ -53,51 +66,58 @@ Snapshots have the following limitations:
5366

5467
.. _backup-with-journaling:
5568

56-
Backup With Journaling
57-
----------------------
69+
Snapshots With Journaling
70+
~~~~~~~~~~~~~~~~~~~~~~~~~
5871

59-
If your system has snapshot capability and your :program:`mongod` instance
60-
has journaling enabled, then you can use any kind of file system or
61-
volume/block level snapshot tool to create backups.
72+
If your :program:`mongod` instance has journaling enabled, then you can
73+
use any kind of file system or volume/block level snapshot tool to
74+
create backups.
6275

63-
.. warning::
76+
If you manage your own infrastructure on a Linux-based system, configure
77+
your system with :term:`LVM` to provide your disk packages and provide
78+
snapshot capability. You can also use LVM-based setups *within* a
79+
cloud/virtualized environment.
6480

65-
.. versionchanged:: 1.9.2
81+
.. note::
6682

67-
Journaling is only enabled by default on 64-bit builds of
68-
MongoDB.
83+
Running :term:`LVM` provides additional flexibility and enables the
84+
possibility of using snapshots to back up MongoDB.
6985

70-
To enable journaling on all other builds, specify
71-
:setting:`journal` = ``true`` in the configuration or use the
72-
:option:`--journal <mongod --journal>` run-time option for
73-
:program:`mongod`.
86+
Snapshots with Amazon EBS in a RAID 10 Configuration
87+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7488

75-
Many service providers provide a block-level backup service based on
76-
disk image snapshots. If you manage your own infrastructure on a
77-
Linux-based system, configure your system with :term:`LVM` to provide
78-
your disk packages and provide snapshot capability. You can also use
79-
LVM-based setups *within* a cloud/virtualized environment.
89+
If your deployment depends on Amazon’s Elastic Block Storage (EBS) with
90+
RAID configured within your instance, it is impossible to get a
91+
consistent state across all disks using the platform’s snapshot tool. As
92+
an alternative, you can do one of the following:
8093

81-
.. note::
94+
- Flush all writes to disk and create a write lock to ensure
95+
consistent state during the backup process.
8296

83-
Running :term:`LVM` provides additional flexibility and enables the
84-
possibility of using snapshots to back up MongoDB.
97+
If you choose this option see :ref:`backup-without-journaling`.
8598

86-
If you use Amazon's EBS service in a software RAID 10 configuration, use
87-
:term:`LVM` to capture a consistent disk image. Also, see the special
88-
considerations described in :ref:`backup-amazon-software-raid`.
99+
- Configure :term:`LVM` to run and hold your MongoDB data files on top of the
100+
RAID within your system.
89101

90-
The following sections provide an overview of a simple backup process
102+
If you choose this option, perform the LVM backup operation described
103+
in :ref:`lvm-backup-operation`.
104+
105+
.. _lvm-backup-and-restore:
106+
107+
Backup and Restore Using LVM on a Linux System
108+
----------------------------------------------
109+
110+
This section provides an overview of a simple backup process
91111
using :term:`LVM` on a Linux system. While the tools, commands, and paths may
92112
be (slightly) different on your system the following steps provide a
93113
high level overview of the backup operation.
94114

95115
.. _lvm-backup-operation:
96116

97-
Create Snapshot
98-
~~~~~~~~~~~~~~~
117+
Create a Snapshot
118+
~~~~~~~~~~~~~~~~~
99119

100-
To create a snapshot with :term:`LVM`, issue a command, as root, in the
120+
To create a snapshot with :term:`LVM`, issue a command as root in the
101121
following format:
102122

103123
.. code-block:: sh
@@ -138,25 +158,25 @@ data. Snapshots typically depend and reside on the same storage
138158
infrastructure as the original disk images. Therefore, it's crucial
139159
that you archive these snapshots and store them elsewhere.
140160

141-
Archive Snapshots
142-
~~~~~~~~~~~~~~~~~
161+
Archive a Snapshot
162+
~~~~~~~~~~~~~~~~~~
143163

144164
After creating a snapshot, mount the snapshot and move the data to
145165
separate storage. Your system might try to compress the backup images as
146-
you move the offline. Consider the following procedure to fully
147-
archive the data from the snapshot:
166+
you move the offline. The following procedure fully
167+
archives the data from the snapshot:
148168

149169
.. code-block:: sh
150170

151171
umount /dev/vg0/mdb-snap01
152172
dd if=/dev/vg0/mdb-snap01 | tar -czf mdb-snap01.tar.gz -
153173

154-
The above command sequence:
174+
The above command sequence does the following:
155175

156176
- Ensures that the ``/dev/vg0/mdb-snap01`` device is not mounted.
157177

158-
- Does a block level copy of the entire snapshot image using the ``dd``
159-
command, and compresses the result in a gzipped tar archive in the
178+
- Performs a block level copy of the entire snapshot image using the ``dd``
179+
command and compresses the result in a gzipped tar archive in the
160180
current working directory.
161181

162182
.. warning::
@@ -167,19 +187,19 @@ The above command sequence:
167187

168188
.. _backup-restore-snapshot:
169189

170-
Restore Snapshot
171-
~~~~~~~~~~~~~~~~
190+
Restore a Snapshot
191+
~~~~~~~~~~~~~~~~~~
172192

173-
To restore a backup created with the above method, use the following
174-
procedure:
193+
To restore a snapshot created with the above method, issue the following
194+
sequence of commands:
175195

176196
.. code-block:: sh
177197

178198
lvcreate --size 1G --name mdb-new vg0
179199
tar -xzf mdb-snap01.tar.gz | dd of=/dev/vg0/mdb-new
180200
mount /dev/vg0/mdb-new /srv/mongodb
181201

182-
The above sequence:
202+
The above sequence does the following:
183203

184204
- Creates a new logical volume named ``mdb-new``, in the ``/dev/vg0``
185205
volume group. The path to the new device will be ``/dev/vg0/mdb-new``.
@@ -205,7 +225,7 @@ Restore Directly from a Snapshot
205225
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
206226

207227
To restore a backup without writing to a compressed ``tar`` archive, use
208-
the following sequence:
228+
the following sequence of commands:
209229

210230
.. code-block:: sh
211231

@@ -235,8 +255,8 @@ Consider the following procedure:
235255

236256
.. _backup-without-journaling:
237257

238-
Backup Without Journaling
239-
-------------------------
258+
Create Backups on Instances that do not Run Journaling
259+
------------------------------------------------------
240260

241261
If your :program:`mongod` instance does not run with journaling
242262
enabled, or if your journal is on a separate volume, obtaining a
@@ -281,24 +301,3 @@ member`).
281301
.. include:: /includes/note-disable-profiling-fsynclock.rst
282302

283303
.. include:: /includes/warning-fsync-lock-mongodump.rst
284-
285-
.. _backup-amazon-software-raid:
286-
287-
Amazon EBS in Software RAID 10 Configuration
288-
--------------------------------------------
289-
290-
If your deployment depends on Amazon's Elastic Block Storage (EBS)
291-
with RAID configured *within* your instance, it is impossible to get a
292-
consistent state across all disks using the platform's snapshot
293-
tool. As a result you may:
294-
295-
- Flush all writes to disk and create a write lock to ensure
296-
consistent state during the backup process.
297-
298-
If you choose this option see :ref:`backup-without-journaling`.
299-
300-
- Configure LVM to run and hold your MongoDB data files on top of the
301-
RAID within your system.
302-
303-
If you choose this option, perform the LVM backup operation described
304-
in :ref:`lvm-backup-operation`.

0 commit comments

Comments
 (0)