【问题标题】:Mongodb failing on DebianMongodb 在 Debian 上失败
【发布时间】:2013-07-05 20:13:18
【问题描述】:

我正在构建一个 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 网站上的官方install instructions。我找到了this patch fix,但这也不能解决错误,只会抛出一个新错误。我还看到从 dpkg/status 中删除坏包可以修复错误,但我什至不知道从哪里开始。

编辑 1

我按照顶部voted answer here 中的步骤进行操作,现在我可以访问mongo shell,但是当我service mongodb start 时它仍然显示失败。我之前无法访问 shell,是吗?

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:~#

【问题讨论】:

    标签: mongodb debian


    【解决方案1】:

    检查你的日志“/var/log/mongodb/mongodb.log

    请在此处粘贴您的日志。

    可能与几件事有关。你有多少硬盘空间可用? 可能与日记有关。 默认情况下,MongoDB 在 /journal 中至少需要 3379MB 根据您安装 MongoDB 的原因,您可以更改配置以使用“小文件”,这将占用最多 512MB 文件,尽管它会随着文件的增长而变慢,因为文件将被分开,或者禁用日志,这不是可取的。 希望这会有所帮助。

    【讨论】:

      【解决方案2】:

      如果您在日志中没有发现任何痕迹:

      tail -f -n50 /var/log/mongodb/mongodb.log
      

      你应该尝试在前台启动服务器:

      sudo -u mongodb mongod --dbpath /var/lib/mongodb/
      

      看看发生了什么。 例如,我遇到了语言环境问题。

      【讨论】:

        【解决方案3】:

        我遇到了同样的错误消息。就我而言,问题是我在 $LOCALE 环境 (en_US.UTF-8) 变量中指定的语言环境无法被 Linux 识别。

        (每当我打开 bash shell 时,我都会收到有关 setlocale 的警告。)

        在我的情况下,在安装之前执行以下操作:

        locale-gen en_US.UTF-8
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-08-25
          • 2013-05-09
          • 2016-12-08
          • 1970-01-01
          • 1970-01-01
          • 2018-01-01
          • 2021-05-31
          • 2014-12-16
          相关资源
          最近更新 更多