1

Background: I installed below 2 rpm packages on CentOS 6.3(Final) 64bits with Ext4 file system -

  • mongo-10gen-2.2.1-mongodb_1.x86_64.rpm
  • mongo-10gen-server-2.2.1-mongodb_1.x86_64.rpm

Symptom: When mongod starts up at first time, there are no preallocated journal files created in specified folder. As aside note, the journal option is enable by default.

Questions: Is it normal case or not? I review manual on MongoDB. It claims

If no journal files exist, when mongod starts, it MUST preallocates new journal files

I posted mongod relevant mongo.conf below -

configurations:

logpath=/drbd0/mongo/log/mongod.log
logappend=true
fork = true
port = 27017
dbpath=/drbd0/mongo/data
pidfilepath = /var/run/mongodb/mongod.pid
bind_ip=admin1_ss_nc
replSet=rstest

Thanks in advance.

Chait
  • 1,052
  • 2
  • 18
  • 30
jameszhou
  • 31
  • 1
  • 3

1 Answers1

2

MongoDB will only pre-allocate the journal files if it believes that it'll be faster to pre-allocate files of a given size (three files 128 MB each if running with --smallfiles and three files 1 GB each if not running with --smallfiles) than to allocate them on-demand.

angela
  • 155
  • 5
  • Thank you Chaithanya! Appreciate! – jameszhou Feb 04 '13 at 01:29
  • Thank you akskung! Appreciate! – jameszhou Feb 04 '13 at 01:32
  • Thank you! This explains why I'm seeing the three prealloc files on one machine and not on another, with identical mongo versions. I was tearing my hair out trying to figure out if one was configured incorrectly or broken. They do have different OS (Debian 7 and Ubuntu 12.04) and different hardware... MongoDB self-tuning would explain it! – Peter Hansen Mar 03 '15 at 23:37