正如我所探索的,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
请帮助我在这之后无法前进