0

我刚刚通过 Homebrew 安装了 MongoDB,我正在尝试启动并运行它。我已经mongod在命令行中使用它启动了它,现在我试图在mongo它运行后使用该命令进入 shell。但是,当我运行命令时没有任何反应。这是我的日志的粘贴:

Fri Sep  6 16:54:02.458 [initandlisten] MongoDB starting : pid=17731 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=lsadmin’s-MacBook-Pro
Fri Sep  6 16:54:02.458 [initandlisten] 
Fri Sep  6 16:54:02.458 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Fri Sep  6 16:54:02.458 [initandlisten] db version v2.4.6
Fri Sep  6 16:54:02.458 [initandlisten] git version: nogitversion
Fri Sep  6 16:54:02.458 [initandlisten] build info: Darwin minimountain.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/    RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Fri Sep  6 16:54:02.458 [initandlisten] allocator: tcmalloc
Fri Sep  6 16:54:02.458 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/usr/local/etc/mongod.conf", dbpath: "/usr/local/var/mongodb", logappend: "true",     logpath: "/usr/local/var/log/mongodb/mongo.log" }
Fri Sep  6 16:54:02.458 [initandlisten] journal dir=/usr/local/var/mongodb/journal
Fri Sep  6 16:54:02.459 [initandlisten] recover : no journal files present, no recovery needed
Fri Sep  6 16:54:02.543 [websvr] admin web console waiting for connections on port 28017
Fri Sep  6 16:54:02.543 [initandlisten] waiting for connections on port 27017
Fri Sep  6 16:55:02.552 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 14ms

这是我的配置文件的粘贴:

# Store data in /usr/local/var/mongodb instead of the default /data/db
dbpath = /usr/local/var/mongodb

# Append logs to /usr/local/var/log/mongodb/mongo.log
logpath = /usr/local/var/log/mongodb/mongo.log
logappend = true

# Only accept local connections
bind_ip = 127.0.0.1

和命令行粘贴:

-> mongod
all output going to: /usr/local/var/log/mongodb/mongo.log
mongo
4

1 回答 1

0

./mongo运行第二个shell 然后运行/usr/local/cellar/mongodb/2.4.6/允许我访问 shell。

明显的解决方案,但文档使您看起来可以从 mongod 提示符运行它。

于 2013-09-07T01:34:25.290 回答