我们实现了MongoDB主从复制,数据库被删除了。
我们使用 extundelete
命令从 Mongo 数据目录恢复已删除的文件。
Undelete Blog https://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
光盘 wiredtiger-2.7.0
sudo apt-get install libsnappy-dev build-essential
./configure --enable-snappy
制作
./wt -v -h ../mongo-bak -C "extensions=[./ext/compressors/snappy/.libs/libwiredtiger_snappy.so]"-R salvage collection-2657--1723320556100349955重量
错误-
./wt -v -h ../mongo-bak -C "extensions=[./ext/compressors/snappy/.libs/libwiredtiger_snappy.so]"-R salvage collection-246--7553069514495955510重量
[1488888117:36780][13536:0x7f7b633cd740],文件:WiredTiger.wt,连接:在偏移量 12288 处读取 4096B block 的校验和错误:1955562709 的 block 头校验和与 3146787951 的预期校验和不匹配
[1488888117:36809][13536:0x7f7b633cd740],文件:WiredTiger.wt,连接:WiredTiger.wt:遇到非法文件格式或内部值
[1488888117:36817][13536:0x7f7b633cd740],文件:WiredTiger.wt,连接:进程必须退出并重启:WT_PANIC:WiredTiger library panic
lt-wt:WT_PANIC:WiredTiger 库 panic
最佳答案
根据 SERVER-31076,这可能与损坏的 .wt
文件(例如 WiredTiger.wt
/WiredTiger.turtle
)有关错误报告。
尝试通过以下命令对所有数据库运行修复:
mongod --repair --dbpath /path/to/data/db
还要确保所有 data/db
文件都具有正确的读写权限。
关于linux - 从损坏的 MongoDB 安装中恢复 WiredTiger 集合时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42648009/