sstableloader使用快照生成的sstables来破坏输入数据

时间:2014-07-17 23:32:26

标签: datastax-enterprise

我正在合理使用sstableloader吗?

我正在将一个表从一个Cassandra集群S迁移到另一个T.我还有另一台安装了Cassandra的机器(L)用于运行sstableloader。所有Cassandras都来自Datastax Enterprise v 4.0.3-1。已使用cqlsh手动检查源和目标上的表的模式,并完全匹配。

源计算机(S)上的数据和索引sstables是使用nodetool snapshot命令准备的,并使用sstableloader(L)复制到计算机上。来自其中一个目标节点(集群T)的cassandra.yaml文件被复制到具有sstableloader(L)的计算机,并且保存它的目录被放置在CLASSPATH中,以便sstableloader可以找到配置。

% export CLASSPATH=${HOME}:${HOME}/cassandra.yaml
% sstableloader -d 192.168.4.79,192.168.4.80,192.168.4.81 -v xs/url_table

响应以

开始
Established connection to initial hosts
Opening sstables and calculating sections to stream

然后sstableloader获取数据文件,报告流会话ID,然后中止。来自Lstable的sstableloader的描述

java.lang.IllegalArgumentException: unable to seek to position 2129 in /home/ajacobs/xs/url_table/xs-url_table-jb-4704-Data.db (1557 bytes) in read-only mode
at org.apache.cassandra.io.util.RandomAccessReader.seek(RandomAccessReader.java:274)
at org.apache.cassandra.streaming.StreamWriter.write(StreamWriter.java:91)
at org.apache.cassandra.streaming.messages.OutgoingFileMessage$1.serialize(OutgoingFileMessage.java:59)
at org.apache.cassandra.streaming.messages.OutgoingFileMessage$1.serialize(OutgoingFileMessage.java:42)
at org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:45)
at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:383)
at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:355)
at java.lang.Thread.run(Thread.java:744)

在Cassandra方面,来自其中一个T节点的system.log文件报告

WARN [STREAM-IN-/192.168.4.75] 2014-07-17 23:00:41,939 StreamSession.java (line 540) [Stream #2c22d370-0e06-11e4-ab07-410b0105b818] Retrying for following error
java.io.IOException: Corrupt input data, block did not start with 2 byte signature ('ZV') followed by type byte, 2-byte length)
at com.ning.compress.lzf.LZFDecoder.decompressChunk(LZFDecoder.java:182)
at com.ning.compress.lzf.LZFInputStream.readyBuffer(LZFInputStream.java:254)
at com.ning.compress.lzf.LZFInputStream.read(LZFInputStream.java:111)
at com.ning.compress.lzf.LZFInputStream.skip(LZFInputStream.java:189)
at java.io.FilterInputStream.skip(FilterInputStream.java:151)
at org.apache.cassandra.streaming.StreamReader.drain(StreamReader.java:117)
at org.apache.cassandra.streaming.StreamReader.read(StreamReader.java:96)
at org.apache.cassandra.streaming.messages.IncomingFileMessage$1.deserialize(IncomingFileMessage.java:47)
at org.apache.cassandra.streaming.messages.IncomingFileMessage$1.deserialize(IncomingFileMessage.java:37)
at org.apache.cassandra.streaming.messages.StreamMessage.deserialize(StreamMessage.java:55)
at org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:283)
at java.lang.Thread.run(Thread.java:744)
ERROR [STREAM-IN-/192.168.4.75] 2014-07-17 23:00:41,940 StreamSession.java (line 420) [Stream #2c22d370-0e06-11e4-ab07-410b0105b818] Streaming error occurred
java.lang.IllegalArgumentException: Unknown type 72
at org.apache.cassandra.streaming.messages.StreamMessage$Type.get(StreamMessage.java:89)
at org.apache.cassandra.streaming.messages.StreamMessage.deserialize(StreamMessage.java:54)
at org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:283)
at java.lang.Thread.run(Thread.java:744)

2 个答案:

答案 0 :(得分:0)

sstable文件被重新命名为1557提示,这是一个损坏的sstable文件。您可能想要确认磁盘上的文件大小。如果它确实是腐败的,https://engineering.gosquared.com/dealing-corrupt-sstable-cassandra可能会有用。

答案 1 :(得分:0)

你需要运行"擦洗"去除腐败的sstables。

sh nodetool scrub [Keyspace名称] [列族名称]