首先尝试运行mongo,我回答这个:
Mac-Pro-de-User: ~ user $mongo MongoDB shell version: 2.6.4 connecting to: test 2014-10-28T10: 47: 08713-0700 warning: Failed to connect to 127.0.0.1:27017,reason: errno: 61 Connection refused 2014-10-28T10: 47: 08713-0700 Error: Could not connect to server 127.0.0.1:27017 (127.0.0.1) Attempt connection Failed at src / mongo / shell / mongo.Js: 146 exception: connect Failed
然后尝试检查mongod,我回答这个:
Mac-Pro-de-User: ~ user $mongod mongod --help for help and startup options 2014-10-28T10: 59: 34485-0700 [initandListen] MongoDB starting: pID = 926 port = 27017 dbpath = / data / db host = 64-bit Mac-Pro-de-Ernesto.local 2014-10-28T10: 59: 34485-0700 [initandListen] 2014-10-28T10: 59: 34485-0700 [initandListen] ** WARNING: soft rlimits too low. Number of files is 256,Should be at Least 1000 2014-10-28T10: 59: 34485-0700 [initandListen] db version v2.6.4 2014-10-28T10: 59: 34485-0700 [initandListen] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910 2014-10-28T10: 59: 34485-0700 [initandListen] Build info: Darwin bs-osx108-4 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root: xnu-2050.48.12 ~ 1 / x86_64 RELEASE_X86_64 BOOST_liB_VERSION = 1_49 2014-10-28T10: 59: 34485-0700 [initandListen] allocator: system 2014-10-28T10: 59: 34485-0700 [initandListen] options: {} 2014-10-28T10: 59: 34486-0700 [initandListen] journal dir = / data / db / journal 2014-10-28T10: 59: 34486-0700 [initandListen] recover: no journal files present,no recovery needed 2014-10-28T10: 59: 34500-0700 [fileAllocator] allocating new datafile /data/db/local.ns,filling zeroes With ... 2014-10-28T10: 59: 34500-0700 [fileAllocator] creating directory / data / db / _tmp 2014-10-28T10: 59: 34512-0700 [fileAllocator] done allocating datafile /data/db/local.ns,size: 16MB,took 0.011 secs 2014-10-28T10: 59: 34726-0700 [fileAllocator] allocating new datafile /data/db/local.0,filling zeroes With ... 2014-10-28T10: 59: 35398-0700 [fileAllocator] done allocating datafile /data/db/local.0,size: 64MB,took 0.671 secs 2014-10-28T10: 59: 35695-0700 [initandListen] build index on: local.startup_log propertIEs: {v: 1,key: {_ID: 1},name: "_ID_" ns "local.startup_log"} 2014-10-28T10: 59: 35695-0700 [initandListen] index added to empty collection 2014-10-28T10: 59: 35695-0700 [initandListen] Local command $cmd command. Create {create: "startup_log" size: 10485760,capped: true} ntoreturn: 1 KeyUpdates: 0 numYIElds: 0 reslen: 37 1194ms 2014-10-28T10: 59: 35695-0700 [initandListen] waiting for connections on port 27017 2014-10-28T11: 00: 34516-0700 [clIEntcursormon] mem (MB) res: 33 virt: 2653 2014-10-28T11: 00: 34516-0700 [clIEntcursormon] mapped (incl journal vIEw): 160 2014-10-28T11: 00: 34516-0700 [clIEntcursormon] connections: 0
然后再试一次连接,花一些时间,再说一遍:
2014-10-28T11: 05: 34589-0700 [clIEntcursormon] mem (MB) res: 33 virt: 2653 2014-10-28T11: 05: 34589-0700 [clIEntcursormon] mapped (incl journal vIEw): 160 2014-10-28T11: 05: 34589-0700 [clIEntcursormon] connections: 0
等等.如果你能帮助会非常感激.
解决方法 您是否在同一终端中运行所有这些命令作为您的时间戳提示的单独 *** 作? (如果没有,我希望看到故障和日志之间的重叠,以便正确诊断).PS: There is already the / data / db with 777 permissions,and I’m
using OSX Mavericks 10.9.5
如果是这样,那么你正在做的是如下:
>启动shell,尝试连接到不运行的数据库(拒绝连接)
>启动数据库,在日志中看到0个连接
>停止数据库(Ctrl-C或类似),启动一个shell,由于数据库已被关闭,因此无法再次连接
>启动数据库,在日志中看到0个连接
>重复
数据库需要与shell同时运行,以便您可以连接到它.因此,您应该在一个终端中启动mongod进程,使其运行,然后打开一个新终端(或选项卡),然后运行mongo命令连接到正在运行的数据库.另一个选项是run mongod
as a daemon,它将允许您在同一终端返回时运行mongo命令.
注意:您不应该有一个具有777权限的文件夹,它不是必需的,并且是一个重大的安全风险.
总结以上是内存溢出为你收集整理的数据库 – MongoDB:无法连接到127.0.0.1:27017,原因:errno:61连接被拒绝全部内容,希望文章能够帮你解决数据库 – MongoDB:无法连接到127.0.0.1:27017,原因:errno:61连接被拒绝所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)