这是我尝试运行 mongo 时遇到的错误
MongoDB shell version: 2.2.2
connecting to: test
Wed Dec 12 15:51:57 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed
每当我在 shell 上运行 mongod 时,我都会得到这个:
Wed Dec 12 15:53:04 [initandlisten] MongoDB starting : pid=763 port=27017 dbpath=/data/db/ 64-bit host=rachitpuri.one97.delhi.net
Wed Dec 12 15:53:04 [initandlisten]
Wed Dec 12 15:53:04 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Wed Dec 12 15:53:04 [initandlisten] db version v2.2.2, pdfile version 4.5
Wed Dec 12 15:53:04 [initandlisten] git version: nogitversion
Wed Dec 12 15:53:04 [initandlisten] build info: Darwin tensix-slave.macports.org 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Wed Dec 12 15:53:04 [initandlisten] options: {}
Wed Dec 12 15:53:04 [initandlisten] journal dir=/data/db/journal
Wed Dec 12 15:53:04 [initandlisten] recover : no journal files present, no recovery needed
Wed Dec 12 15:53:04 [websvr] admin web console waiting for connections on port 28017
Wed Dec 12 15:53:04 [initandlisten] waiting for connections on port 27017
我对 mongod.conf 文件的一些看法是,系统在不同位置存在冲突,但它们都没有 dbpath=/data/db