mongodb debian squeeze

When you see …

Thu Mar  7 18:02:20 [initandlisten] MongoDB starting : pid=19353 port=27017 dbpath=/var/lib/mongodb 64-bit host=back1
Thu Mar  7 18:02:20 [initandlisten] db version v2.2.3, pdfile version 4.5
Thu Mar  7 18:02:20 [initandlisten] git version: f570771a5d8a3846eb7586eaffcf4c2f4a96bf08
Thu Mar  7 18:02:20 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Thu Mar  7 18:02:20 [initandlisten] options: { config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log" }
Thu Mar  7 18:02:20 [initandlisten] journal dir=/var/lib/mongodb/journal
Thu Mar  7 18:02:20 [initandlisten] recover : no journal files present, no recovery needed
Thu Mar  7 18:02:20 [initandlisten] 
Thu Mar  7 18:02:20 [initandlisten] ERROR: Insufficient free space for journal files
Thu Mar  7 18:02:20 [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
Thu Mar  7 18:02:20 [initandlisten] 
Thu Mar  7 18:02:20 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
Thu Mar  7 18:02:20 dbexit: 
Thu Mar  7 18:02:20 [initandlisten] shutdown: going to close listening sockets...
Thu Mar  7 18:02:20 [initandlisten] shutdown: going to flush diaglog...
Thu Mar  7 18:02:20 [initandlisten] shutdown: going to close sockets...
Thu Mar  7 18:02:20 [initandlisten] shutdown: waiting for fs preallocator...
Thu Mar  7 18:02:20 [initandlisten] shutdown: lock for final commit...
Thu Mar  7 18:02:20 [initandlisten] shutdown: final commit...
Thu Mar  7 18:02:20 [initandlisten] shutdown: closing all files...
Thu Mar  7 18:02:20 [initandlisten] closeAllFiles() finished
Thu Mar  7 18:02:20 [initandlisten] journalCleanup...
Thu Mar  7 18:02:20 [initandlisten] removeJournalFiles
Thu Mar  7 18:02:20 [initandlisten] shutdown: removing fs lock...
Thu Mar  7 18:02:20 dbexit: really exiting now

MongoDB ต้องการพื้นที่อย่างน้อย 3379MB เพื่อทำ journal files

ถ้าเรามีพื้นที่ไม่พอสำหรับทำ journal files เราก็ต้องไปแก้ไข /etc/mongodb.conf
เพิ่มไปว่า

smallfiles = true