@@ -45,14 +45,23 @@ Enable Journaling
45
45
To enable journaling, start :program:`mongod` with the
46
46
:option:`--journal` command line option.
47
47
48
- If :program:`mongod` decides to preallocate the files, it will not start
49
- listening on port 27017 until this process completes, which can take a
50
- few minutes. Your applications and the shell will not be able to connect
51
- to the database until the process completes.
48
+ If the :program:`mongod` process preallocates the files, the process
49
+ delays listening on port 27017 until preallocation completes, which can
50
+ take a few minutes. Your applications and the shell will not be able to
51
+ connect to the database until the process completes.
52
52
53
53
Disable Journaling
54
54
~~~~~~~~~~~~~~~~~~
55
55
56
+ .. warning::
57
+
58
+ Do not disable journaling on production systems. If your MongoDB
59
+ system stops unexpectedly from a power failure or other condition,
60
+ and if you are not running with journaling, then you must recover
61
+ from an unaffected :term:`replica set` member or backup, as described
62
+ in :doc:`repair
63
+ </tutorial/recover-data-following-unexpected-shutdown>`.
64
+
56
65
To disable journaling, start :program:`mongod` with the
57
66
:option:`--nojournal <mongod --nojournal>` command line option.
58
67
@@ -152,7 +161,7 @@ Use the following commands and methods to monitor journal status:
152
161
Change the Group Commit Interval
153
162
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154
163
155
- .. versionchanged:: 1.9.2
164
+ .. versionchanged:: 2.0
156
165
157
166
You can set the group commit interval using the
158
167
:option:`--journalCommitInterval <mongod --journalCommitInterval>`
@@ -229,10 +238,7 @@ needed.
229
238
The ``private view`` stores data for use in :doc:`read operations
230
239
</core/read-operations>`. The ``private view`` is mapped to the ``shared view``
231
240
and is the first place MongoDB applies new :doc:`write operations
232
- </core/write-operations>`, mean read operations get the most up-to-date
233
- data. Keep in mind that because the ``private view`` is a second mapping
234
- of data files, journaling often doubles the amount of virtual memory
235
- :program:`mongod` uses.
241
+ </core/write-operations>`.
236
242
237
243
The journal is an on-disk view that stores new write operations
238
244
after they have been applied to the ``private cache`` but before they
@@ -246,11 +252,10 @@ the ``shared view`` for eventual upload to the data files.
246
252
How Journaling Records Write Operations
247
253
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248
254
249
- MongoDB copies the write operations to the journal in batches
250
- called group commits. By default, MongoDB performs a group commit every
251
- 100 milliseconds, which means a series of operations over 100
252
- milliseconds are committed as a single batch. This is done to achieve
253
- high performance.
255
+ MongoDB copies the write operations to the journal in batches called
256
+ group commits. By default, MongoDB performs a group commit every 100
257
+ milliseconds, which means a series of operations over 100 milliseconds
258
+ are committed as a single batch. This is done to improve performance.
254
259
255
260
Journaling stores raw operations that allow MongoDB to reconstruct the
256
261
following:
@@ -259,16 +264,16 @@ following:
259
264
- index modifications
260
265
- changes to the namespace files
261
266
262
- As users perform :doc:`write operations </core/write-operations>`,
263
- MongoDB writes the data first to the ``private view`` in RAM. MongoDB
264
- then copies the write operations in batches from the ``private view`` to
265
- the journal, which stores the operations on disk to ensure durability.
266
- MongoDB adds write operations as entries on the journal's forward
267
- pointer. Each entry on the pointer describes which bytes the write
268
- operation changed in the data files.
267
+ As :doc:`write operations </core/write-operations>` occur, MongoDB
268
+ writes the data to the ``private view`` in RAM and then copies the write
269
+ operations in batches to the journal. The journal stores the operations
270
+ on disk to ensure durability. MongoDB adds the operations as entries on
271
+ the journal's forward pointer. Each entry describes which bytes the
272
+ write operation changed in the data files.
269
273
270
274
MongoDB next applies the journal's write operations to the ``shared
271
- view``. At this point, the ``shared view`` becomes inconsistent with the data files.
275
+ view``. At this point, the ``shared view`` becomes inconsistent with the
276
+ data files.
272
277
273
278
At default intervals of 60 seconds, MongoDB asks the operating system to
274
279
flush the ``shared view`` to disk. This brings the data files up-to-date
0 commit comments