我正在尝试在我的系统上安装 mongodb 并按照以下步骤(http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/)这样做。我已经安装了 Homebrew 和 MacPorts,并使用 Homebrew 和 MacPorts 安装了 mongodb。但是当我输入 mongod 时:
我明白了:
mongod --help for help and startup options
Sun Sep 9 20:58:35 [initandlisten] MongoDB starting : pid=6381 port=27017 dbpath=/data/db/ 64-bit host=Cs-MacBook-Pro.local
Sun Sep 9 20:58:35 [initandlisten] db version v2.0.7, pdfile version 4.5
Sun Sep 9 20:58:35 [initandlisten] git version: nogitversion
Sun Sep 9 20:58:35 [initandlisten] build info: Darwin Cs-MacBook-Pro.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
Sun Sep 9 20:58:35 [initandlisten] options: {}
Sun Sep 9 20:58:35 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating
Sun Sep 9 20:58:35 dbexit:
Sun Sep 9 20:58:35 [initandlisten] shutdown: going to close listening sockets...
Sun Sep 9 20:58:35 [initandlisten] shutdown: going to flush diaglog...
Sun Sep 9 20:58:35 [initandlisten] shutdown: going to close sockets...
Sun Sep 9 20:58:35 [initandlisten] shutdown: waiting for fs preallocator...
Sun Sep 9 20:58:35 [initandlisten] shutdown: lock for final commit...
Sun Sep 9 20:58:35 [initandlisten] shutdown: final commit...
Sun Sep 9 20:58:35 [initandlisten] shutdown: closing all files...
Sun Sep 9 20:58:35 [initandlisten] closeAllFiles() finished
Sun Sep 9 20:58:35 dbexit: really exiting now
当我输入 mongo 时,我得到了这个:
MongoDB shell version: 2.0.7
connecting to: test
Sun Sep 9 20:58:39 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84
exception: connect failed
在这方面需要一些帮助...