@@ -6,13 +6,13 @@ Recover MongoDB Data following Unexpected Shutdown
6
6
7
7
If MongoDB does not shutdown cleanly [#clean-shutdown]_ the on-disk
8
8
representation of the data files will likely reflect an inconsistent
9
- state which leads to data corruption.
9
+ state which could lead to data corruption.
10
10
11
11
To prevent data inconsistency and corruption, always shut down the
12
12
database cleanly, and use the :ref:`durability journaling
13
13
<setting-journal>`. The journal writes data to disk every 100
14
- milliseconds by default, and ensurers that MongoDB will be able to
15
- recover a constant state even in the case of a unclean shutdown due to
14
+ milliseconds by default, and ensures that MongoDB will be able to
15
+ recover a constant state even in the case of an unclean shutdown due to
16
16
power loss or other system failure.
17
17
18
18
If you do not have journaling enabled, use the following procedure to
@@ -34,7 +34,7 @@ Indications
34
34
~~~~~~~~~~~
35
35
36
36
When you are aware of a :program:`mongod` instance running without
37
- journaling that stops unexpectedly you should always run the repair
37
+ journaling that stops unexpectedly, you should always run the repair
38
38
operation before starting MongoDB again.
39
39
40
40
If the ``mongod.lock`` file in the data directory specified by
@@ -57,7 +57,7 @@ contains the following line:
57
57
old lock file: /data/db/mongod.lock. probably means unclean shutdown
58
58
59
59
You must remove the lockfile **and** run the repair operation before
60
- starting the database normally using the following procedure.
60
+ starting the database normally using the following procedure:
61
61
62
62
Overview
63
63
~~~~~~~~
@@ -149,12 +149,14 @@ the following procedure:
149
149
150
150
In normal operation, you should **never** remove the ``mongod.lock``
151
151
file and start :program:`mongod`. Instead use one of the above methods
152
- to recover the database and remove the lock files. In dire you
153
- situations can remove the lockfile, and start the database using the
152
+ to recover the database and remove the lock files. In dire
153
+ situations you can remove the lockfile, and start the database using the
154
154
possibly corrupt files, and attempt to recover data from the database;
155
155
however, it's impossible to predict the state of the database in these
156
156
situations.
157
157
158
158
If you are not running with journaling, and your database shuts down
159
- unexpectedly for *any* reason, you should always assume that your
160
- database is in an inconsistent and likely corrupt state.
159
+ unexpectedly for *any* reason, you should always proceed *as if* your database
160
+ is in an inconsistent and likely corrupt state. If at all possible restore
161
+ from :doc:`backup </administration/backup>` or if running as a :term:`replica
162
+ set` re-sync from an intact member of the set.
0 commit comments