我了解到,Mongodb创建的日志文件使用snappy压缩算法进行压缩。但是我无法解压这个压缩的日志文件。尝试解压时会出现错误。
错误流中缺少snappy标识符
我使用的Python代码如下:
import collections
import bson
from bson.codec_options import CodecOptions
import snappy
from cStringIO import StringIO
try:
with open('journal/WiredTigerLog.0000000011') as f:
content = f.readlines()
fh = StringIO()
snappy.stream_decompress(StringIO("".join(content)),fh)
print fh
except Exception,e:
print str(e)
pass
请帮忙,我在这之后无法继续进行。
\377\006\0\0sNaPpY
,如 *nix 魔术文件或十六进制中的ff06 0000 734e 6150 7059
。也许 WiredTiger 存储引擎正在使用不同的压缩选项进行写入? - Lex Scarisbrick