Double MongoDb版本

时间:2014-04-28 08:54:22

标签: mongodb

MongoDB版本的问题

我安装了Mongo Db,请点击此链接

http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/

用Brew更新后

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/

mongod --help for help and startup options
2014-04-28T10:49:46.475+0200 [initandlisten] MongoDB starting : pid=2197 port=27017 dbpath=/data/db 64-bit host=Foo.local
2014-04-28T10:49:46.475+0200 [initandlisten]
2014-04-28T10:49:46.475+0200 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-04-28T10:49:46.475+0200 [initandlisten] db version v2.6.0
2014-04-28T10:49:46.475+0200 [initandlisten] git version: nogitversion
2014-04-28T10:49:46.475+0200 [initandlisten] build info: Darwin minimavericks.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2014-04-28T10:49:46.476+0200 [initandlisten] allocator: tcmalloc
2014-04-28T10:49:46.476+0200 [initandlisten] options: {}
2014-04-28T10:49:46.476+0200 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
2014-04-28T10:49:46.476+0200 [initandlisten] dbexit:
2014-04-28T10:49:46.476+0200 [initandlisten] shutdown: going to close listening sockets...
2014-04-28T10:49:46.476+0200 [initandlisten] shutdown: going to flush diaglog...
2014-04-28T10:49:46.476+0200 [initandlisten] shutdown: going to close sockets...
2014-04-28T10:49:46.476+0200 [initandlisten] shutdown: waiting for fs preallocator...
2014-04-28T10:49:46.476+0200 [initandlisten] shutdown: lock for final commit...
2014-04-28T10:49:46.476+0200 [initandlisten] shutdown: final commit...
2014-04-28T10:49:46.476+0200 [initandlisten] shutdown: closing all files...
2014-04-28T10:49:46.477+0200 [initandlisten] closeAllFiles() finished
2014-04-28T10:49:46.477+0200 [initandlisten] shutdown: removing fs lock...
2014-04-28T10:49:46.477+0200 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
2014-04-28T10:49:46.477+0200 [initandlisten] dbexit: really exiting now

➜  ~  mongo --version
MongoDB shell version: 2.6.0

但如果我这样做:

> use foo
switched to db foo
> use foo
switched to db foo
> foo.version()
2.4.9

如何清理双重安装? 我想要2.6.0

1 个答案:

答案 0 :(得分:0)

@monkeyUser,

运行两个不同的MongoDB实例本身不是问题,前提是它们使用不同的数据目录。在您的情况下,看起来您有两个MongoDB安装,并为两者配置了相同的数据目录。如果您打算同时保留这两个实例,则需要更改其中一个实例的dbPath以指向其他目录。

如果您不打算运行两个实例并且只打算运行最新实例,请使用博文中的相同步骤卸载以前安装的实例,但是以相反的顺序(自下而上)执行它们,反之亦然,即如果博客有步骤要创建目录/ data / db,您将执行以下步骤"删除数据目录/ data / db"。一旦你删除了其中一个实例,第二个实例就可以了。