2013-04-16 81 views
2

我試圖從mongo的突然關閉中恢復,正如本文所寫: fady mohamed osman,但我遇到了一些問題。這裏是日誌文件mongo恢復異常

我的日誌:

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 
+0

您是否更改了MongoDB版本? –

+0

我不記得,我怎麼檢查我是否?我怎樣才能找出使用哪個版本? –

+0

這是mongo版本在突然關機之前和恢復之後是否一樣?您可以在連接到數據庫時檢查版本。 –

回答

3

這也可能發生是因爲不重新啓動/關機,如bug SERVER-5380中所述。刪除/db/data/journal中的所有文件(對於您的設置可能不同,您可以在開始服務時生成的日誌中確認此文件)文件夾並重新啓動服務。

0

從日誌中我可以看到你正在使用2.0.2。如果崩潰前的Mongo版本與此不同,則會出現以上錯誤。使用相同版本的Mongo來解決問題。