MongoDB – How to Separate Journal

mongodb

I'm trying to use NFS as db path for my MongoDB (which I read is not recommended, but a client demands it that way) and I'm having trouble separating the journal files.

How would I do that? I've tried setting the dbpath to /mnt/nfs and it works, but the journal directory is there as well…

Any hints?

Best Answer

You have to create a symbolic link that points to the new mountpoint:

If your server runs out of disk space for journal files, the server process will exit. By default, mongod creates journal files in a sub-directory of dbpath named journal. You may elect to put the journal files on another storage device using a filesystem mount or a symlink.

Note

If you place the journal files on a separate storage device you will not be able to use a file system snapshot tool to capture a valid snapshot of your data files and journal files.

Updated link about: Journal files