我正在构建一个 MongoDB 虚拟机,但它无法正常工作。输出如下:
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 <root@mongo>
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)
root@mongo:~#
我一直在遵循 mongodb 网站上的官方安装说明。我找到了这个补丁修复,但这也不能修复错误,只是抛出一个新错误。我还看到从 dpkg/status 中删除坏包可以修复错误,但我什至不知道从哪里开始。
编辑 1
我在这里按照投票最多的答案中的步骤进行操作,现在我可以访问 mongo shell,但是当我service mongodb start
仍然说失败时。我之前无法访问外壳,所以这就是问题,是吗?
root@mongo:~# service mongodb start
Starting database: mongodb failed!
root@mongo:~# 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
root@mongo:~#