> This page location: /docs.md > /docs/management.md > /docs/manual/core/journaling.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

<!--
Tab options on this page. Append to the .md URL to filter:
  ?tabs=<id,...>   select specific tabs (e.g. ?tabs=nodejs,shell)
  ?allTabs=true    include every tab
  (no param)       default: one tab per tabset

Available tabs:
  other tabs: standalone, replset, shardedcluster
-->

# Configure Journaling for Self-Managed Deployments

MongoDB uses *write ahead logging* to an on-disk [journal](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-journal) to guarantee [write operation](https://www.mongodb.com/docs/manual/crud.md#std-label-crud) durability.

The WiredTiger storage engine does not require journaling to guarantee a consistent state after a crash. The database will be restored to the last consistent [checkpoint](https://www.mongodb.com/docs/manual/core/wiredtiger.md#std-label-storage-wiredtiger-checkpoints) during recovery.  However, if MongoDB exits unexpectedly in between checkpoints, journaling is required to recover writes that occurred after the last checkpoint.

If [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) stops unexpectedly, the program can recover everything written to the journal. MongoDB will re-apply the write operations on restart and maintain a consistent state. By default, the greatest extent of lost writes, i.e., those not made to the journal, are those made in the last 100 milliseconds, plus the time it takes to perform the actual journal writes. See [`commitIntervalMs`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-storage.journal.commitIntervalMs) for more information on the default.

## Procedures

### Get Commit Acknowledgement

You can get commit acknowledgment with the [Write Concern](https://www.mongodb.com/docs/manual/reference/write-concern.md#std-label-write-concern) and the [`j`](https://www.mongodb.com/docs/manual/reference/write-concern.md#mongodb-writeconcern-writeconcern.j) option. For details, see [Write Concern.](https://www.mongodb.com/docs/manual/reference/write-concern.md#std-label-write-concern-operation)

### Monitor Journal Status

The [`serverStatus`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-dbcommand-dbcmd.serverStatus) command/[`db.serverStatus()`](https://www.mongodb.com/docs/manual/reference/method/db.serverstatus.md#mongodb-method-db.serverStatus) method returns [`wiredTiger.log`](https://www.mongodb.com/docs/manual/reference/command/serverstatus.md#mongodb-serverstatus-serverstatus.wiredTiger.log), which contains statistics on the journal.

### Recover Data After Unexpected Shutdown

On a restart after a crash, MongoDB replays all journal files in the journal directory before the server becomes available. If MongoDB must replay journal files, [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) notes these events in the log output.

There is no reason to run `--repair`.

### Change WiredTiger Journal Compressor

With the WiredTiger storage engine, MongoDB, by default, uses the `snappy` compressor for the journal. To specify a different compressions algorithm or no compression for a [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance:

**Tip:**

If you encounter an unclean shutdown for a [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) during this procedure, you must use the old compressor settings to recover using the journal files. Once recovered, you can retry the procedure.

### Standalone

Use the following procedure to change the journal compressor for a standalone [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance:

1. Update [`storage.wiredTiger.engineConfig.journalCompressor`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-storage.wiredTiger.engineConfig.journalCompressor) to the new value.

   If you use command-line options instead of a configuration file, you must update the [`--wiredTigerJournalCompressor`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--wiredTigerJournalCompressor) command-line option during the restart below.

2. Perform a clean shutdown of the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance. For example, connect [`mongosh`](https://www.mongodb.com/docs/mongodb-shell.md#mongodb-binary-bin.mongosh) to the instance and issue [`db.shutdownServer()`:](https://www.mongodb.com/docs/manual/reference/method/db.shutdownserver.md#mongodb-method-db.shutdownServer)

   ```javascript
   db.getSiblingDB('admin').shutdownServer()
   ```

3. Once you have confirmed that the process is no longer running, restart the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance:

   - If you are using a configuration file:

     ```bash
     mongod -f <path/to/myconfig.conf>
     ```

   - If you are using command-line options instead of a configuration file, update [`--wiredTigerJournalCompressor`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--wiredTigerJournalCompressor) to the new value.

     ```bash
     mongod --wiredTigerJournalCompressor <differentCompressor|none>  ...
     ```
