由于流式传输错误,无法添加新的 Cassandra 数据中心

Can't add a new Cassandra datacenter due to streaming errors

使用 DSE 4.8.6 (C* 2.1.13.1218)

当我尝试在新数据中心添加新节点时,bootstrap重建/节点重建总是被流错误中断。

来自 system.log 的错误示例:

ERROR [STREAM-IN-/172.31.47.213] 2016-04-19 12:30:28,531  StreamSession.java:621 - [Stream #743d44e0-060e-11e6-985c-c1820b05e9ae] Remote peer 172.31.47.213 failed stream session.
INFO  [STREAM-IN-/172.31.47.213] 2016-04-19 12:30:30,665  StreamResultFuture.java:180 - [Stream #743d44e0-060e-11e6-985c-c1820b05e9ae] Session with /172.31.47.213 is complete

大约有 500GB 的数据要流式传输到新节点。 Boostrap 或重建操作流式传输来自另一个(主)DC 上的 4 个不同节点的那些。

发生流式传输错误时,所有同步数据都会被擦除(我必须重新开始)。

到目前为止我尝试了什么:

还有什么我应该尝试的吗?我正在每个故障节点上 运行ning nodetool scrub 以查看这是否有帮助...

在流出节点上,这些是错误消息:

ERROR [STREAM-IN-/172.31.45.28] 2016-05-11 13:10:43,842  StreamSession.java:505 - [Stream #ecfe0390-1763-11e6-b6c8-c1820b05e9ae] Streaming error occurred
java.net.SocketTimeoutException: null
        at sun.nio.ch.SocketAdaptor$SocketInputStream.read(SocketAdaptor.java:229) ~[na:1.7.0_80]
        at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) ~[na:1.7.0_80]
        at java.nio.channels.Channels$ReadableByteChannelImpl.read(Channels.java:385) ~[na:1.7.0_80]
        at org.apache.cassandra.streaming.messages.StreamMessage.deserialize(StreamMessage.java:51) ~[cassandra-all-2.1.14.1272.jar:2.1.14.1272]
        at org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:257) ~[cassandra-all-2.1.14.1272.jar:2.1.14.1272]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80]

然后:

INFO  [STREAM-IN-/172.31.45.28] 2016-05-10 07:59:14,023  StreamResultFuture.java:180 - [Stream #ea1271b0-1679-11e6-917a-c1820b05e9ae] Session with /172.31.45.28 is complete
WARN  [STREAM-IN-/172.31.45.28] 2016-05-10 07:59:14,023  StreamResultFuture.java:207 - [Stream #ea1271b0-1679-11e6-917a-c1820b05e9ae] Stream failed
ERROR [STREAM-OUT-/172.31.45.28] 2016-05-10 07:59:14,024  StreamSession.java:505 - [Stream #ea1271b0-1679-11e6-917a-c1820b05e9ae] Streaming error occurred
java.lang.AssertionError: Memory was freed
        at org.apache.cassandra.io.util.SafeMemory.checkBounds(SafeMemory.java:97) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.io.util.Memory.getLong(Memory.java:249) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.io.compress.CompressionMetadata.getTotalSizeForSections(CompressionMetadata.java:247) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.streaming.messages.FileMessageHeader.size(FileMessageHeader.java:112) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.streaming.StreamSession.fileSent(StreamSession.java:546) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.streaming.messages.OutgoingFileMessage.serialize(OutgoingFileMessage.java:50) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.streaming.messages.OutgoingFileMessage.serialize(OutgoingFileMessage.java:41) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:45) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:358) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]
        at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:338) ~[cassandra-all-2.1.13.1218.jar:2.1.13.1218]

如 Cassandra 票证 CASSANDRA-11345 中所回答,此问题是由于正在传输一个大的 SSTable 文件 (40GB)。

所述文件的传输需要超过 1 小时,如果传出传输需要超过 1 小时,默认情况下流操作会超时。

要更改此默认行为,您可以将 cassandra.yaml 配置文件中的 streaming_socket_timeout_in_ms 设置为较大的值(例如:72000000 毫秒或 20 小时)

不要忘记在现有节点上也更改此值,而不仅仅是新节点! (并不是说我在这里承认任何事情...)