我正在构建一个MongoDB虚拟机,但无法让它工作。输出如下:Mongodb在Debian上失败
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
[master 462b01d] saving uncommitted changes in /etc prior to apt run
Author: root <[email protected]>
1 files changed, 5 insertions(+), 5 deletions(-)
Setting up mongodb-10gen (2.4.5) ...
Starting database: mongodb failed!
invoke-rc.d: initscript mongodb, action "start" failed.
dpkg: error processing mongodb-10gen (--configure):
subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
[email protected]:~#
我一直在关注从mongodb的网站的官方install instructions。我发现this patch fix但这并不能解决错误,只是抛出一个新的。我也看到从dpkg/status中删除一个错误的包可以修复错误,但我甚至不知道从哪里开始。
编辑1
我跟着上面voted answer here的步骤,现在我可以访问蒙戈外壳,但是当我service mongodb start
还在说失败了。之前我无法访问shell,所以这是一件事,是吗?
[email protected]:~# service mongodb start
Starting database: mongodb failed!
[email protected]:~# mongo
MongoDB shell version: 2.4.5
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
> ^C
bye
[email protected]:~#
为什么会这样帮助?这可能会破坏其他需要本地主机名称的事情吗? – UpTheCreek
好吧,如果你注释它安装Mongo然后改回它它并没有真正破坏任何东西。对我来说,当我创建集群时,它帮助了6到7次。从理论上讲,它可能会破坏其他事情,但另一方面,为什么任何应用程序都相信任何人都可以更改的值?另外,应用程序使用127.0.0.1和:: 1而不是本地主机。 –