我来自riak和redis,在那里我从未有过这个服务启动或互动的问题。

这是蒙古人普遍存在的问题,我对此一无所知。重启也无济于事。我是蒙哥的新手。

mongo
MongoDB shell version: 2.2.1
connecting to: test
Fri Nov  9 16:44:06 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed

这是我在日志里看到的。

 now open)
Fri Nov  9 16:44:34 [conn47] end connection 10.29.16.208:5306 (1 connection now open)
Fri Nov  9 16:45:04 [initandlisten] connection accepted from 10.29.16.208:5307 #48 (2 connections now open)
Fri Nov  9 16:45:04 [conn48] end connection 10.29.16.208:5307 (1 connection now open)
Fri Nov  9 16:45:04 [initandlisten] connection accepted from 10.29.16.208:5308 #49 (2 connections now open)
Fri Nov  9 16:45:04 [conn49] end connection 10.29.16.208:5308 (1 connection now open)
Fri Nov  9 16:45:34 [initandlisten] connection accepted from 10.29.16.208:5316 #50 (2 connections now open)
Fri Nov  9 16:45:34 [conn50] end connection 10.29.16.208:5316 (1 connection now open)
Fri Nov  9 16:45:34 [initandlisten] connection accepted from 10.29.16.208:5317 #51 (2 connections now open)
Fri Nov  9 16:45:34 [conn51] end connection 10.29.16.208:5317 (1 connection now open)
Fri Nov  9 16:46:04 [initandlisten] connection accepted from 10.29.16.208:5320 #52 (2 connections now open)
Fri Nov  9 16:46:04 [conn52] end connection 10.29.16.208:5320 (1 connection now open)
Fri Nov  9 16:46:04 [initandlisten] connection accepted from 10.29.16.208:5321 #53 (2 connections now open)
Fri Nov  9 16:46:04 [conn53] end connection 10.29.16.208:5321 (1 conn

当前回答

最后我得到了这是在一个简单的方式..

打开终端并进入mongodb位置。对我来说就是这样

e:\mongodb\bin> 

并输入以下命令并按enter..

mongod --config e:\mongodb\mongo.config

打开另一个终端,启动mongodb使用

mongo.exe

这是它. .你可以用mongo

其他回答

Resolved. This problem could be solved by the below mentioned 4 steps 1) Remove .lock file sudo rm /var/lib/mongodb/mongod.lock 2) repair the mongodb mongod -–repair 3) start the mongod server sudo service mongod start 4) start the mongo client mongo For more details take a look at http://shakthydoss.com/error-couldnt-connect-to-server-127-0-0-127017-srcmongoshellmongo-js-exception-connect-failed/ http://shakthydoss.com/technical/error-couldnt-connect-to-server-127-0-0-127017-srcmongoshellmongo-js-exception-connect-failed/

首先,转到c:\mongodb\bin>打开mongodb,如果你在控制台上看到mongodb正在监听端口27017,那就OK了 如果不是,关闭控制台并创建文件夹c:\data\db并重新启动mongod

我也有同样的问题,我已经删除了E:\Mongo Data Files\db\mongod。锁文件,所以它开始工作。该问题是由于服务器不适当的关闭。所以锁文件不干净。

这工作我:-

以Mongodb 3.2为窗口,启动Mongodb服务。因此,以管理员身份运行命令提示符,然后net start MongoDB

如果以上方法都不奏效:进入service (start>search>services),启动mongodb服务。然后,在cmd提示符中,进入bin后,键入:/>mongo