启动mongodb服务器时出错

时间:2014-03-21 18:00:28

标签: ruby-on-rails-3 apache mongodb centos6 locomotivecms

对于mongodb来说是全新的。我正在尝试在我的服务器上安装机车CMS,这很酷,但我总是使用SQL / MySQL所以mongo对我来说是全新的。

我安装了所有需要的mongodb模块,但是当我运行时:sudo service mongod start我收到错误代码。当我查看日志中的错误时,输出结果如下:

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

另外,我运行:sudo service mongod status,输出为mongod is stopped,所以我知道它没有运行。

在堆栈之后,看起来错误与空间不足有关,但我的服务器有15gb免费且我正在运行sudo,所以我知道这不是权限错误....我怎样才能分配更多空间。 ..或者更好的是,我应该分配更多的空间?

感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

将smallfiles = true添加到“/etc/mongodb.conf”。

现在尝试启动该服务,我认为这应该解决问题!!

设置为true以修改MongoDB以使用较小的默认数据文件大小。具体来说,smallfiles减少了数据文件的初始大小,并将它们限制为512兆字节。 smallfiles设置还将每个日志文件的大小从1千兆字节减少到128兆字节。