在mongo恢复期间的异常

时间:2013-04-16 16:07:55

标签: mongodb

我试图通过突然关闭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

2 个答案:

答案 0 :(得分:3)

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

答案 1 :(得分:0)

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