At https://docs.mongodb.com/manual/core/write-performance/, it says
If the journal and the data file reside on the same block device, the data files and the journal may have to contend for a finite number of available I/O resources. Moving the journal to a separate device may increase the capacity for write operations.
That sounds great! Except in dur_journal.cpp, at src/mongo/db/storage/mmap_v1 (https://github.com/mongodb/mongo/blob/master/src/mongo/db/storage/mmap_v1/dur_journal.cpp), it has the following code:
boost::filesystem::path getJournalDir() {
boost::filesystem::path p(storageGlobalParams.dbpath);
p /= "journal";
return p;
}
So it appears that the journal directory is hard coded to be a sub directory of the database directory. I could use a symbolic link to put it on a different disk, but this feels like I'm doing something wrong.
How do I handle this?
You would mount another volume at the hardcoded location.
mount /dev/<device> <dbpath>/journal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With