2

我试图从 mongo 的突然关闭中恢复,正如 fady mohamed osman在这篇文章中所写的那样,但我遇到了一些问题。这是日志文件

我的日志是:

Tue Apr 16 17:45:25 [initandlisten] MongoDB starting : pid=3563 port=27017 dbpath=/var/lib/mongodb 64-bit host=milos-desktop
Tue Apr 16 17:45:25 [initandlisten] db version v2.0.2, pdfile version 4.5
Tue Apr 16 17:45:25 [initandlisten] git version: 514b122d308928517f5841888ceaa4246a7f18e3
Tue Apr 16 17:45:25 [initandlisten] build info: Linux bs-linux64.10gen.cc 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
Tue Apr 16 17:45:25 [initandlisten] options: { auth: "true", config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb1.log", repair: true }
Tue Apr 16 17:45:25 [initandlisten] journal dir=/var/lib/mongodb/journal
Tue Apr 16 17:45:25 [initandlisten] recover begin
Tue Apr 16 17:45:25 [initandlisten] recover lsn: 77394770
Tue Apr 16 17:45:25 [initandlisten] recover /var/lib/mongodb/journal/j._0
Tue Apr 16 17:45:25 [initandlisten] journal file version number mismatch. recover with old version of mongod, terminate cleanly, then upgrade.
Tue Apr 16 17:45:25 [initandlisten] exception during recovery
Tue Apr 16 17:45:25 [initandlisten] exception in initAndListen: 13536 journal version number mismatch 0, terminating
Tue Apr 16 17:45:25 dbexit: 
Tue Apr 16 17:45:25 [initandlisten] shutdown: going to close listening sockets...
Tue Apr 16 17:45:25 [initandlisten] shutdown: going to flush diaglog...
Tue Apr 16 17:45:25 [initandlisten] shutdown: going to close sockets...
Tue Apr 16 17:45:25 [initandlisten] shutdown: waiting for fs preallocator...
Tue Apr 16 17:45:25 [initandlisten] shutdown: lock for final commit...
Tue Apr 16 17:45:25 [initandlisten] shutdown: final commit...
Tue Apr 16 17:45:25 [initandlisten] shutdown: closing all files...
Tue Apr 16 17:45:25 [initandlisten] closeAllFiles() finished
Tue Apr 16 17:45:25 [initandlisten] shutdown: removing fs lock...
Tue Apr 16 17:45:25 dbexit: really exiting now
4

2 回答 2

3

如错误SERVER-5380中所述,由于不干净的重新启动/关闭也可能发生这种情况。删除/db/data/journal(可能与您的设置不同,您可以在启动服务时生成的日志中确认)文件夹中的所有文件并重新启动服务。

于 2013-05-01T17:23:27.353 回答
0

从日志中我可以看到您使用的是 2.0.2。如果崩溃前的 Mongo 版本与此不同,则会出现上述错误。使用相同版本的 Mongo 来解决问题。

于 2013-04-16T16:45:10.843 回答