2017-03-07 420 views
0

我們已經實現了MongoDB主從複製並刪除了數據庫。從損壞的MongoDB安裝中恢復WiredTiger集合時出錯

我們使用extundelete命令從Mongo數據目錄恢復已刪除的文件。

Undelete Bloghttps://github.com/RIKSOF/development/wiki/Restoring-deleted-files-on-Linux

我們希望至少還原一個集合,我們得到了WT(有線定時器)文件。我們正在嘗試使用下面的命令來恢復該文件,我們得到以下錯誤

Recovering a WiredTiger collection from a corrupt MongoDB installation

wget http://source.wiredtiger.com/releases/wiredtiger-2.7.0.tar.bz2 tar xvf wiredtiger-2.7.0.tar.bz2 cd wiredtiger-2.7.0 sudo apt-get install libsnappy-dev build-essential ./configure --enable-snappy make

./wt -v -h ../mongo-bak -C "extensions=[./ext/compressors/snappy/.libs/libwiredtiger_snappy.so]" -R salvage collection-2657--1723320556100349955.wt

錯誤 -

./wt -v -h ../mongo-bak -C "extensions=[./ext/compressors/snappy/.libs/libwiredtiger_snappy.so]" -R salvage collection-246--7553069514495955510.wt [1488888117:36780][13536:0x7f7b633cd740], file:WiredTiger.wt, connection: read checksum error for 4096B block at offset 12288: block header checksum of 1955562709 doesn't match expected checksum of 3146787951 [1488888117:36809][13536:0x7f7b633cd740], file:WiredTiger.wt, connection: WiredTiger.wt: encountered an illegal file format or internal value [1488888117:36817][13536:0x7f7b633cd740], file:WiredTiger.wt, connection: the process must exit and restart: WT_PANIC: WiredTiger library panic lt-wt: WT_PANIC: WiredTiger library panic

回答

0

這可能與損壞有關.wt文件(例如WiredTiger.wt/WiredTiger.turtle)根據SERVER-31076錯誤報告。

嘗試通過以下命令在所有數據庫上運行修復:

mongod --repair --dbpath /path/to/data/db 

還要確保所有data/db文件具有讀取權和寫入權限。