我知道这个问题已被问过几次,但我已经尝试了所有提到的解决方案但它没有用。我安装了mongodb,如mongodb docs,10gen包中所述。我已经检查了日志和数据文件夹的权限,并将它们设置为mongodb。
这是日志文件
Wed Oct 2 13:33:52.511 [initandlisten] MongoDB starting : pid=21678 port=27017 dbpath=/var/lib/mongodb 64-bit host=copperdroid
Wed Oct 2 13:33:52.511 [initandlisten] db version v2.4.6
Wed Oct 2 13:33:52.511 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Wed Oct 2 13:33:52.511 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Wed Oct 2 13:33:52.511 [initandlisten] allocator: tcmalloc
Wed Oct 2 13:33:52.511 [initandlisten] options: { config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log" }
Wed Oct 2 13:33:52.513 [initandlisten] journal dir=/var/lib/mongodb/journal
Wed Oct 2 13:33:52.513 [initandlisten] recover : no journal files present, no recovery needed
Wed Oct 2 13:33:52.550 [FileAllocator] allocating new datafile /var/lib/mongodb/local.ns, filling with zeroes...
Wed Oct 2 13:33:52.550 [FileAllocator] creating directory /var/lib/mongodb/_tmp
Wed Oct 2 13:33:52.551 [FileAllocator] done allocating datafile /var/lib/mongodb/local.ns, size: 16MB, took 0 secs
Wed Oct 2 13:33:52.551 [FileAllocator] allocating new datafile /var/lib/mongodb/local.0, filling with zeroes...
Wed Oct 2 13:33:52.551 [FileAllocator] done allocating datafile /var/lib/mongodb/local.0, size: 64MB, took 0 secs
Wed Oct 2 13:33:52.553 [websvr] admin web console waiting for connections on port 28017
Wed Oct 2 13:33:52.553 [initandlisten] waiting for connections on port 27017
这似乎没有显示任何问题。当我尝试启动mongoconsole时,我得到了
Wed Oct 2 13:37:32.769 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145