使用自制软件将mongo升级到2.6,现在无法连接 [英] Upgraded mongo to 2.6 using home-brew and now can't connect
本文介绍了使用自制软件将mongo升级到2.6,现在无法连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行OSX 10.9.2,我只运行了brew upgrade mongo
,将我的mongo
升级到了2.6版
Running OSX 10.9.2, I just ran brew upgrade mongo
which upgraded my mongo
to version 2.6
按照我执行的说明
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
但是现在当我运行mongo
时,它会说
But now when I run mongo
it says
MongoDB shell version: 2.6.0
connecting to: test
2014-05-05T10:07:22.769+1000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2014-05-05T10:07:22.770+1000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
我尝试过的事情:
- 我已经看到了其他SX问题所涉及的内容,人们建议创建一个
/data/db
文件夹,但是以前不需要这样做,并且我也不想丢失我的mongo
的旧实例中的数据.无论如何,我尝试了一下,并chown
对其进行了设置,以允许从我的用户帐户中进行读取/写入,但这没什么区别. (仅供参考,我的数据保存在/usr/local/var/mongodb/
中,这对我来说是OSX的典型情况.) - 许多其他问题也都假定使用Linux而不是Mac,或者他们涉足与我无关的
PHP
领域. - 我还尝试过重启Mac.
- I've seen this covered on other SX questions and people have suggested creating a
/data/db
folder but this wasn't needed previously and I don't want to lose the data from my old instance ofmongo
. Regardless, I tried it, andchown
ed it to allow read/write from my user account, but that made no difference. (FYI my data lives in/usr/local/var/mongodb/
which is typical I believe for OSX.) - A lot of the other questions also assume Linux rather than Mac, or they wade off into
PHP
land which is not relevant to me. - I've also tried rebooting my Mac.
推荐答案
我通过强制自制程序重新启动它来修复它.
I fixed it by forcing home-brew to restart it.
brew services restart mongodb
和瞧
$ mongo
MongoDB shell version: 2.6.0
connecting to: test
>
现在可以治疗了.
这篇关于使用自制软件将mongo升级到2.6,现在无法连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文