无法在Mac上安装和运行MongoDB

时间:2015-06-21 01:53:12

标签: mongodb

我尝试在Mac上安装MongoDB,运行Yosemite。我使用

下载了Mongo
$ curl -O http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.4.tgz

解压缩它:

$ tar -zxvf mongodb-osx-x86_64-2.6.4.tgz

重命名目录:

$ mv mongodb-osx-x86_64-2.6.4 mongodb

创建了data / db目录:

$ mkdir -p /data/db

设置文件夹权限:

$ chown -R $USER /data/db

到目前为止,这么好。现在我想运行它。所以:

$ cd mongodb/bin
$ mongod

我得到了所有这些错误:

2015-06-20T18:35:18.558-0700 [initandlisten] MongoDB starting : pid=589 port=27017 dbpath=/data/db 64-bit host=Brian-ONeills-iMac.local

2015-06-20T18:35:18.558-0700 [initandlisten] 

2015-06-20T18:35:18.558-0700 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

2015-06-20T18:35:18.558-0700 [initandlisten] db version v2.6.4

2015-06-20T18:35:18.558-0700 [initandlisten] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910

2015-06-20T18:35:18.558-0700 [initandlisten] build info: Darwin bs-osx108-4 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49

2015-06-20T18:35:18.558-0700 [initandlisten] allocator: system

2015-06-20T18:35:18.558-0700 [initandlisten] options: {}

2015-06-20T18:35:18.639-0700 [initandlisten] journal dir=/data/db/journal

2015-06-20T18:35:18.639-0700 [initandlisten] recover : no journal files present, no recovery needed

2015-06-20T18:35:18.994-0700 [initandlisten] preallocateIsFaster=true 5.28

2015-06-20T18:35:19.811-0700 [initandlisten] ****

2015-06-20T18:35:19.811-0700 [initandlisten] ****

2015-06-20T18:35:19.811-0700 [initandlisten] need to upgrade database local with pdfile version 4.22, new version: 4.5

2015-06-20T18:35:19.811-0700 [initandlisten]     Not upgrading, exiting

2015-06-20T18:35:19.811-0700 [initandlisten]     run --upgrade to upgrade dbs, then start again

2015-06-20T18:35:19.811-0700 [initandlisten] ****

2015-06-20T18:35:19.811-0700 [initandlisten] dbexit: 

2015-06-20T18:35:19.811-0700 [initandlisten] shutdown: going to close listening sockets...

2015-06-20T18:35:19.811-0700 [initandlisten] shutdown: going to flush diaglog...

2015-06-20T18:35:19.811-0700 [initandlisten] shutdown: going to close sockets...

2015-06-20T18:35:19.811-0700 [initandlisten] shutdown: waiting for fs preallocator...

2015-06-20T18:35:19.811-0700 [initandlisten] shutdown: lock for final commit...

2015-06-20T18:35:19.811-0700 [initandlisten] shutdown: final commit...

2015-06-20T18:35:19.811-0700 [initandlisten] shutdown: closing all files...

2015-06-20T18:35:19.811-0700 [initandlisten] closeAllFiles() finished

2015-06-20T18:35:19.811-0700 [initandlisten] journalCleanup...

2015-06-20T18:35:19.811-0700 [initandlisten] removeJournalFiles

2015-06-20T18:35:19.812-0700 [initandlisten] shutdown: removing fs lock...

2015-06-20T18:35:19.812-0700 [initandlisten] dbexit: really exiting now

知道可能会发生什么以及如何解决?

提前致谢!

1 个答案:

答案 0 :(得分:1)

这些诊断建议/ data / db已经安装了早期(较旧)的mongodb版本。查看 http://docs.mongodb.org/manual/release-notes/2.4-upgrade/