日志文件存在于日志目录中,但启动时未启用日志 [英] Journal files are present in journal directory, yet starting without journaling enabled

查看:37
本文介绍了日志文件存在于日志目录中,但启动时未启用日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始学习 MongoDB,并尝试在 Ubuntu 上安装它(我最近从 Windows 转移了它).使用 sudo service mongodb start 启动它时遇到问题.以下是日志:

I have started learning MongoDB and for which trying to install it on Ubuntu (which I recently shifted from windows). Facing issues to start it with sudo service mongodb start. Following are the logs:

Sun Aug  4 20:25:36.774 [initandlisten] options: { config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log" }
**************
Error: journal files are present in journal directory, yet starting without journaling enabled.
It is recommended that you start with journaling enabled so that recovery may occur.
**************
Sun Aug  4 20:25:36.774 [initandlisten] exception in initAndListen: 13597 can't start without --journal enabled when journal/ files are present, terminating
Sun Aug  4 20:25:36.774 dbexit: 
Sun Aug  4 20:25:36.774 [initandlisten] shutdown: going to close listening sockets...

推荐答案

如果 MongoDB 已被强制关闭,则不会清除日志文件.警告在这里,以便您可以决定是否要从故障中恢复(推荐).为了恢复工作,您需要使用 --journal 启动 MongoDB.虽然默认情况下日志是打开的,所以我希望你的 /etc.mongodb.conf 文件有一个 nojournal=true 行.你也可以删除那个.

If MongoDB has been shutdown forcefully then the journal files are not cleaned up. The warning is here so that you can decide whether you want to recover from a failure (recommended). For recovery to work, you need to start MongoDB with --journal. Journalling is turned on by default though so I expect your /etc.mongodb.conf file has a nojournal=true line. You can remove that one instead as well.

如果你真的不关心恢复,那么你可以简单地删除 /var/lib/mongodb/journal 下的所有文件——但要意识到你最终可能会得到损坏的数据文件.

If you really don't care about recovering, then you can simply remove all the files under /var/lib/mongodb/journal—but realise that you might end up with broken data files.

这篇关于日志文件存在于日志目录中,但启动时未启用日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆