简体   繁体   中英

Error on startup for mongodb server

totally new to mongodb. I'm trying to install locomotive CMS on my server, which is cool, but I've always used SQL/MySQL so mongo is totally new to me.

I installed all the needed mongodb modules, but when I run: sudo service mongod start I get an error code. When I look in the logs for the error, here is what is output:

Fri Mar 21 18:13:47.186 [initandlisten] MongoDB starting : pid=5053 port=27017 dbpath=/var/lib/mongo 64-bit host=vagrant-centos64.vagrantup.com
Fri Mar 21 18:13:47.186 [initandlisten] db version v2.4.9
Fri Mar 21 18:13:47.186 [initandlisten] git version: 52fe0d21959e32a5bdbecdc62057db386e4e029c
Fri Mar 21 18:13:47.186 [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
Fri Mar 21 18:13:47.186 [initandlisten] allocator: tcmalloc
Fri Mar 21 18:13:47.186 [initandlisten] options: { config: "/etc/mongod.conf", dbpath: "/var/lib/mongo", fork: "true", logappend: "true", logpath: "/var/log/mongo/mongod.log", pidfilepath: "/var/run/mo$
Fri Mar 21 18:13:47.192 [initandlisten] journal dir=/var/lib/mongo/journal
Fri Mar 21 18:13:47.192 [initandlisten] recover : no journal files present, no recovery needed
Fri Mar 21 18:13:47.192 [initandlisten]
Fri Mar 21 18:13:47.192 [initandlisten] ERROR: Insufficient free space for journal files
Fri Mar 21 18:13:47.192 [initandlisten] Please make at least 3379MB available in /var/lib/mongo/journal or use --smallfiles
Fri Mar 21 18:13:47.192 [initandlisten]
Fri Mar 21 18:13:47.193 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
Fri Mar 21 18:13:47.193 dbexit:
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: going to close listening sockets...
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: going to flush diaglog...
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: going to close sockets...
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: waiting for fs preallocator...
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: lock for final commit...
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: final commit...
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: closing all files...
Fri Mar 21 18:13:47.193 [initandlisten] closeAllFiles() finished
Fri Mar 21 18:13:47.193 [initandlisten] journalCleanup...
Fri Mar 21 18:13:47.193 [initandlisten] removeJournalFiles
Fri Mar 21 18:13:47.193 [initandlisten] shutdown: removing fs lock...
Fri Mar 21 18:13:47.193 dbexit: really exiting now

Also, I run: sudo service mongod status and the output is mongod is stopped so I know it's not running.

Following the stack, it looks like the error has something to do with insufficient space, but my server has 15gb free and im running sudo, so i know it's not a permission error....how can I allocate more space...or better yet, what should i allocate more space to?

Any help is appreciated.

Add smallfiles = true to "/etc/mongodb.conf".

Now try to start the service, I assume this should fix the issue!!

Set to true to modify MongoDB to use a smaller default data file size. Specifically, smallfiles reduces the initial size for data files and limits them to 512 megabytes. The smallfiles setting also reduces the size of each journal files from 1 gigabyte to 128 megabytes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM